Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: unable to recognize "deployment.yaml": no matches for kind "Deployment" in version "extensions/v1beta1" #2126

Open
longfei-zhang opened this issue Oct 9, 2019 · 4 comments

Comments

@longfei-zhang
Copy link

@longfei-zhang longfei-zhang commented Oct 9, 2019

I have installed minikube then try to install etcd operator but got following error:

[root@longfei-cd-test example]# kubectl create -f deployment.yaml 
error: unable to recognize "deployment.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"

here is my kubectl version info:

[root@longfei-cd-test etcd-operator]# kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:27:17Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
@longfei-zhang longfei-zhang changed the title error: unable to recognize "example/deployment.yaml": no matches for kind "Deployment" in version "extensions/v1" error: unable to recognize "deployment.yaml": no matches for kind "Deployment" in version "extensions/v1beta1" Oct 9, 2019
@longfei-zhang

This comment has been minimized.

Copy link
Author

@longfei-zhang longfei-zhang commented Oct 9, 2019

oh I see

https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/

DaemonSet, Deployment, StatefulSet, and ReplicaSet (in the extensions/v1beta1 and apps/v1beta2 API groups)
Migrate to use the apps/v1 API, available since v1.9. Existing persisted data can be retrieved/updated via the apps/v1 API.

@longfei-zhang

This comment has been minimized.

Copy link
Author

@longfei-zhang longfei-zhang commented Oct 9, 2019

Now changed the deployment.yaml to the following, it's working fine.

[root@longfei-cd-test example]# cat deployment.yaml 
apiVersion: apps/v1
kind: Deployment
metadata:
  name: etcd-operator
spec:
  selector:
    matchLabels:
      app: etcd-operator
  replicas: 1
  template:
    metadata:
      labels:
        app: etcd-operator
    spec:
      containers:
      - name: etcd-operator
        image: quay.io/coreos/etcd-operator:v0.9.4
        command:
        - etcd-operator
        # Uncomment to act for resources in all namespaces. More information in doc/user/clusterwide.md
        #- -cluster-wide
        env:
        - name: MY_POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: MY_POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
@longfei-zhang

This comment has been minimized.

Copy link
Author

@longfei-zhang longfei-zhang commented Oct 10, 2019

Here are my PR
#2127

@huzhou520

This comment has been minimized.

Copy link

@huzhou520 huzhou520 commented Dec 3, 2019

---
+ apiVersion: apps/v1
- apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: ambassador
spec:
  replicas: 3
+   selector:
+     matchLabels:
+       service: ambassador
  template:
...
fly2nadeem added a commit to fly2nadeem/kubernetes-katas that referenced this issue Dec 31, 2019
Getting Error when try to use the YAML file. As per the below link by changing the  "apiVersion: apps/v1" has resolve the issue.
Hence changed "apiVersion: extensions/v1beta1" to "apiVersion: apps/v1" in the YAML file

coreos/etcd-operator#2126

Error : - 

PS C:\Users\Samu\.kube> kubectl apply -f "C:\Users\Samu\.kube\nginx-simple-deployment.yaml"
error: unable to recognize "C:\\Users\\Samu\\.kube\\nginx-simple-deployment.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"

PS C:\Users\Samu\.kube> kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.8", GitCommit:"211047e9a1922595eaa3a1127ed365e9299a6c23", GitTreeState:"clean", BuildDate:"2019-10-15T12:11:03Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.