kubernetes - can not create deployment correctly

5/30/2018

I create a deployment.yaml to create deployment of kubernetes.

Here is my tries:

apiVersion: apps/v1

get error: unable to recognize "./slate-master/deployment.yaml": no matches for kind "Deployment" in version "apps/v1"

apiVersion: extensions/v1beta1 and apiVersion: apps/v1beta1

both of them, get Error from server (BadRequest): error when creating "./slate-master/deployment.yaml": Deployment in version "v1beta1" cannot be handled as a Deployment: v1beta1.Deployment: ...

here is my kubernetes version:

Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.2", GitCommit:"81753b10df112992bf51bbc2c2f85208aad78335", GitTreeState:"clean", BuildDate:"2018-05-12T04:12:12Z", GoVersion:"go1.9.6", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.7", GitCommit:"b30876a5539f09684ff9fde266fda10b37738c9c", GitTreeState:"clean", BuildDate:"2018-01-16T21:52:38Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

So, why kubernetes create deployment failed?

-- slideshowp2
kubernetes

2 Answers

5/30/2018

Change the apiVersion: apps/v1 by:

apiVersion: extensions/v1beta1
-- suren
Source: StackOverflow

12/5/2018

Check in "env" section, for apiVersion:

apps/v1
apps/v1beta1
apps/v1beta2

All the env variables should be a string, add the quote: e.g

- name: POSTGRES_PORT
  value: {{ .Values.db.env.POSTGRES_PORT | quote }}
-- Rub21
Source: StackOverflow