Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1" #23

Closed
NanheKumar opened this issue Mar 31, 2020 · 16 comments · Fixed by #24 or #25

Comments

@NanheKumar
Copy link

When i run bellow command
helm install phpfpm . --set mariadb.mariadbRootPassword=DB_ROOTPASSWORD,mariadb.mariadbUser=DB_USERNAME,mariadb.mariadbPassword=DB_USERPASSWORD,mariadb.mariadbDatabase=DB_NAME

Output
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1"

I have changed in Deployment.yaml and ingress.yaml
apiVersion: extensions/v1beta1 to apiVersion: apps/v1

Again run above command still getting error.

Error: unable to build kubernetes objects from release manifest: [unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1", error validating "": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec]

Screen Shot 2020-03-31 at 7 17 37 PM

@dani8art
Copy link
Contributor

dani8art commented Apr 1, 2020

hi @NanheKumar I was not able to reproduce it

$ helm install phpfpm  \
  --set mariadb.mariadbRootPassword=DB_ROOTPASSWORD \
  --set mariadb.mariadbUser=DB_USERNAME \
  --set mariadb.mariadbPassword=DB_USERPASSWORD \
  --set mariadb.mariadbDatabase=DB_NAME \
  .

# NAME: phpfpm
# LAST DEPLOYED: Wed Apr  1 09:38:40 2020
# NAMESPACE: darteaga
# STATUS: deployed
# REVISION: 1
# TEST SUITE: None
# NOTES:
# 1. Get the application URL by running these commands:
#   export NODE_PORT=$(kubectl get --namespace darteaga -o jsonpath="{.spec.ports[0].nodePort}" services phpfpm-php-app-nginx)
#   export NODE_IP=$(kubectl get nodes --namespace darteaga -o jsonpath="{.items[0].status.addresses[0].address}")
#   echo http://$NODE_IP:$NODE_PORT

I don't know if your ar trying to use DB_ROOTPASSWORD as environment variable, if it is the case you should use mariadb.mariadbRootPassword="$DB_ROOTPASSWORD", also for the rest.

@KarneAsada
Copy link

I'm getting the same error. I'm using:
helm v3.1.2
kubernetes server v1.18.0
kubectl v1.15.5

@dani8art
Copy link
Contributor

dani8art commented Apr 3, 2020

Could you share with us your commands and configurations?

@KarneAsada
Copy link

kubectl get po -A
NAMESPACE     NAME                               READY   STATUS    RESTARTS   AGE
kube-system   coredns-66bff467f8-pngmh           1/1     Running   0          60s
kube-system   coredns-66bff467f8-s84q2           1/1     Running   0          60s
kube-system   etcd-minikube                      1/1     Running   0          75s
kube-system   kindnet-krnmg                      1/1     Running   0          59s
kube-system   kube-apiserver-minikube            1/1     Running   0          75s
kube-system   kube-controller-manager-minikube   1/1     Running   0          75s
kube-system   kube-proxy-9plgr                   1/1     Running   0          59s
kube-system   kube-scheduler-minikube            1/1     Running   0          75s
kube-system   storage-provisioner                1/1     Running   1          74s
kubectl cluster-info

Kubernetes master is running at https://127.0.0.1:32768
KubeDNS is running at https://127.0.0.1:32768/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
helm install phpfpm . --set mariadb.mariadbRootPassword=mini,mariadb.mariadbUser=mini,mariadb.mariadbPassword=mini,mariadb.mariadbDatabase=mini 

Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1"

@KarneAsada
Copy link

Does that help?

@dani8art
Copy link
Contributor

dani8art commented Apr 6, 2020

did you do any changes on the templates?, I'm still unable to reproduce the issue.

I cloned the repo

$ git clone git@github.com:bitnami/tutorials.git
$ cd phpfpm-k8s/helm-chart

Copy your command and execute directly

$ helm install phpfpm . --set mariadb.mariadbRootPassword=mini,mariadb.mariadbUser=mini,mariadb.mariadbPassword=mini,mariadb.mariadbDatabase=mini
# NAME: phpfpm
# LAST DEPLOYED: Mon Apr  6 07:51:59 2020
# NAMESPACE: darteaga
# STATUS: deployed
# REVISION: 1
# TEST SUITE: None
# NOTES:
# 1. Get the application URL by running these commands:
#   export NODE_PORT=$(kubectl get --namespace darteaga -o jsonpath="{.spec.ports[0].nodePort}" services phpfpm-php-app-nginx)
#   export NODE_IP=$(kubectl get nodes --namespace darteaga -o jsonpath="{.items[0].status.addresses[0].address}")
#   echo http://$NODE_IP:$NODE_PORT

@ErikTrapman
Copy link

I have the exact same error as @KarneAsada. But it might not be related with this tutorial, OR, the code in the tutorial is specificly written for a k8s version. Which version are you running @dani8art ?

I found also this issues in which the "no matches for kind..." error is discussed helm/helm#6969 helm/helm#7219

And helm/helm#6969 (comment) for 1.18 specific.

$ helm version --short
v3.2.4+g0ad800e
$ kubectl version --short
Client Version: v1.18.5
Server Version: v1.18.3

@dani8art
Copy link
Contributor

Hi @ErikTrapman, @KarneAsada, @NanheKumar I've just created a PR that should fix this versioning error. Thank you for your feedback!

@koyan
Copy link
Contributor

koyan commented Oct 13, 2020

I get the same errors with the tutorial. I can see the merged code from the PR available, but it still looks for extensions/v1beta1

helm install phpfpm . --set mariadb.mariadbRootPassword=mini,mariadb.mariadbUser=mini,mariadb.mariadbPassword=mini,mariadb.mariadbDatabase=mini
Error: unable to build kubernetes objects from release manifest: [unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1", error validating "": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec]
$ helm version --short
v3.2.4+g0ad800e
$ kubectl version --short
Client Version: v1.19.2
Server Version: v1.19.2

@dani8art
Copy link
Contributor

Hi, sorry I was not able to reproduce it, this is my output where the apiVersion is correct.

$ helm template phpfpm . --set mariadb.mariadbRootPassword=mini,mariadb.mariadbUser=mini,mariadb.mariadbPassword=mini,mariadb.mariadbDatabase=mini -s templates/deployment.yaml
---
# Source: php-app/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: phpfpm-php-app-phpfpm
  labels:
    chart: "php-app-0.1.0"
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: phpfpm-php-app-phpfpm
    spec:
      containers:
      - name: phpfpm-php-app-phpfpm
        image: "USERNAME/phpfpm-app:0.1.0"
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 9000
        resources:
            limits:
              cpu: 100m
              memory: 128Mi
            requests:
              cpu: 100m
              memory: 128Mi
        readinessProbe:
          tcpSocket:
            port: 9000
          initialDelaySeconds: 10
          timeoutSeconds: 5
---
# Source: php-app/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: phpfpm-php-app-nginx
  labels:
    chart: "php-app-0.1.0"
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: phpfpm-php-app-nginx
    spec:
      containers:
      - name: phpfpm-php-app-nginx
        image: "bitnami/nginx:latest"
        imagePullPolicy: "IfNotPresent"
        ports:
        - name: http
          containerPort: 8080
        - name: https
          containerPort: 8443
        livenessProbe:
          httpGet:
            path: /
            port: http
          initialDelaySeconds: 30
          timeoutSeconds: 5
        readinessProbe:
          httpGet:
            path: /
            port: http
          initialDelaySeconds: 5
          timeoutSeconds: 1
        volumeMounts:
        - name: nginx-config
          mountPath: /bitnami/nginx/conf/vhosts
      volumes:
      - name: nginx-config
        configMap:
          name: phpfpm-php-app

did you pull the latest changes?

@koyan
Copy link
Contributor

koyan commented Oct 15, 2020

Thanks for lookign again into this.
Yes, I have the latest changes.
And when I run the above command, I also get the same result (the correct apiVersion), but when I try to deploy it, it gives back the error.

I have tried with different versions of kubectl. I have also tried both on minikube and on an GCE cluster.
I have also tried hardcoding the apiVersion: apps/v1 in the deployment.yaml and ingress.yaml files, but the error still appears, like if it is just ignored.

@dani8art
Copy link
Contributor

Hi @koyan, it seems like mariadb version was too old, and we were missing some selectors required in this new version (apiVersion: apps/v1). It should be solved with the PR.

Thank you so much for the feedback!

@eruiz
Copy link

eruiz commented Oct 16, 2020

I get the same error, how can I install fixed KubeMQ?

Thanks!

@dani8art
Copy link
Contributor

Hi @eruiz I cannot find any KubeMQ chart in this repo, could you point me to it?

@koyan
Copy link
Contributor

koyan commented Oct 19, 2020

Hi @koyan, it seems like mariadb version was too old, and we were missing some selectors required in this new version (apiVersion: apps/v1). It should be solved with the PR.

Thank you so much for the feedback!

Thanks. Confirming that it all works good now.
Thanks

@eruiz
Copy link

eruiz commented Oct 19, 2020

Sorry, I write my comment in the wrong thread. My apologies.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants