I am trying to deploy an upgrade to an helm chart on my k8s cluster (GKE) using a CI/CD pipeline (google container builder) but I get an error.
Google Cloud SDK 195.0.0
GKE Cluster version: v1.9.6-gke.0
kubectl v1.8.6
I am using this builder: https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/helm
I am triggering the build like this:
gcloud container builds submit . --config=cloudbuild.yaml --substitutions=TAG_NAME=v0.1.8
Here's the section of the cloudbuild.yaml that is causing this error:
- name: 'gcr.io/$PROJECT_ID/helm'
args:
- upgrade
- mmh-user
- ./mmh-users-0.1.7.tgz
- --reuse-values
- --set
- image.tag=${TAG_NAME}
env:
- 'CLOUDSDK_COMPUTE_ZONE=northamerica-northeast1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=mycluster'
Starting Step #17
Step #17: Already have image (with digest): gcr.io/myproject-2018/helm
Step #17: Running: helm init --client-only
Step #17: $HELM_HOME has been configured at /builder/home/.helm.
Step #17: Not installing Tiller due to 'client-only' flag having been set
Step #17: Happy Helming!
Step #17: Running: helm repo update
Step #17: Hang tight while we grab the latest from your chart repositories...
Step #17: ...Skip local chart repository
Step #17: ...Successfully got an update from the "stable" chart repository
Step #17: Update Complete. ⎈ Happy Helming!⎈
Step #17: Running: helm upgrade mmh-user ./mmh-users-0.1.7.tgz --reuse-values --set image.tag=v0.1.8
Step #17: Error: UPGRADE FAILED: failed to create patch: failed to get versionedObject: unable to convert unstructured object to extensions/v1beta1, Kind=Ingress: unrecognized type: string
Finished Step #17
helm upgrade mmh-user ./mmh-users-0.1.7.tgz --reuse-values --set image.tag=v0.1.8
) from my laptop, no issues.Any clues as to what else I could do to find a cause/solution?
Thanks to juanchimienti from the Kubernetes #helm-users slack channel, I was able to solve this problem. Juanchimienti suggested that it might have something to do with the tls-acme annotation's value that was showing as:
kubernetes.io/tls-acme: true
but should have been shown as "true"
.
I changed my build step to include the annotation like this:
- --set
- 'ingress.annotations.kubernetes\.io/tls-acme="true"'
and now its working.
I presume that this has something to do with the version of kubectl that is in the helm builder (https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/helm) because running the same command without the annotation from my laptop was working just fine. My laptop had a more recent version of kubectl. I didn't confirm this.