no matches for kind "Deployment" in version "extensions/v1beta1

dan picture dan · Oct 21, 2019 · Viewed 70.1k times · Source

I have been having the issue while deploying mojaloop .kubernetes is responding with an error log like

I have checked my Kubernetes version and 1.16 is the version so how can I fix such kind of problem with the API version .from investigating I have found that Kubernetes don't support apps/v1beta2, apps/v1beta1 so how can I make Kubernetes to use currently not deprecated version or supported version I am new to Kubernetes and anyone who can support me I am happy

Error: validation failed: [unable to recognize "": no matches for kind "Deployment" in version "apps/v1beta2", unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1", unable to recognize "": no matches for kind "StatefulSet" in version "apps/v1beta2", unable to recognize "": no matches for kind "StatefulSet" in version "apps/v1beta1"]

Answer

PjoterS picture PjoterS · Oct 21, 2019

In Kubernetes 1.16 some apis have been changed.

You can check which apis support current Kubernetes object using

$ kubectl api-resources | grep deployment
deployments                       deploy       apps                           true         Deployment

This means that only apiVersion with apps is correct for Deployments (extensions is not supporting Deployment). The same situation with StatefulSet.

You need to change Deployment and StatefulSet apiVersion to apiVersion: apps/v1.

If this does not help, please add your YAML to the question.

EDIT As issue is caused by HELM templates included old apiVersions in Deployments which are not supported in version 1.16, there are 2 possible solutions:

1. git clone whole repo and replace apiVersion to apps/v1 in all templates/deployment.yaml using script
2. Use older version of Kubernetes (1.15) when validator accept extensions as apiVersion for Deployment and StatefulSet.