Couldn't find type: v1.Deployment

7/12/2017

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?

-- Tiago BĂ©rtolo
deployment
kubernetes

1 Answer

7/13/2017

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

-- Eugene Chow
Source: StackOverflow