Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't find type: v1.Deployment

I am following this tutorial.

My objective was to create a Deployment made with a custom container instead of the hello container.

I made this my-custom-server-deployment.yaml:

apiVersion: v1
kind: Deployment
metadata:
  name: my-custom-server-deployment
spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: my-custom
        tier: backend
    spec:
      containers:
        - name: my-custom-server
          image: my-custom-server
          ports:
              containerPort: 3000

I tried to build it with kubectl create -f my-custom-server-deployment.yaml and i got:

error: error validating "my-custom-server-deployment.yaml": error validating data: couldn't find type: v1.Deployment; if you choose to ignore these errors, turn validation off with --vali
date=false

When i add --validate=false i get:

 no matches for /, Kind=Deployment

I thought this was pretty straight forward. What am i doing wrong?

like image 261
Tiago Bértolo Avatar asked Jul 12 '17 23:07

Tiago Bértolo


1 Answers

Try using apiVersion: apps/v1beta1 instead. I believe Deployments is a still a beta feature.

like image 118
Eugene Chow Avatar answered Oct 06 '22 22:10

Eugene Chow