Repository navigation
Closed
Description
This happens only with version 2.12.0 with version 2.11.0 works fine.
When trying to install a chart that installs CRDs with crd-install hook installation fails with the following error:
$ helm repo add presslabs https://presslabs.github.io/charts
"presslabs" has been added to your repositories
$ helm install presslabs/mysql-operator --name oper
Error: customresourcedefinitions.apiextensions.k8s.io "mysqlbackups.mysql.presslabs.org" already exists
The chart crds template can be found here.
The CRDs are installed but the release is failed:
$ kubectl get crds
NAME CREATED AT
mysqlbackups.mysql.presslabs.org 2018-12-13T16:17:52Z
mysqlclusters.mysql.presslabs.org 2018-12-13T16:17:52Z
$ helm ls
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
oper 1 Thu Dec 13 18:17:51 2018 FAILED mysql-operator-0.2.1 v0.2.1 default
After deleting the release the CRDs will be deleted too:
$ helm delete --purge oper
release "oper" deleted
$ kubectl get crds
No resources found.
The CRD description:
$ kubectl describe crd mysqlclusters.mysql.presslabs.org
Name: mysqlclusters.mysql.presslabs.org
Namespace:
Labels: app=mysql-operator
chart=mysql-operator-0.2.1
controller-tools.k8s.io=1.0
heritage=Tiller
release=oper
Annotations: helm.sh/hook=crd-install
API Version: apiextensions.k8s.io/v1beta1
Kind: CustomResourceDefinition
Metadata:
Creation Timestamp: 2018-12-13T16:32:29Z
Generation: 1
Resource Version: 5047801
Self Link: /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/mysqlclusters.mysql.presslabs.org
UID: aebf3973-fef4-11e8-811a-42010a9c0035
Spec:
Additional Printer Columns:
JSON Path: .metadata.creationTimestamp
Description: CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.
Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
Name: Age
Type: date
Group: mysql.presslabs.org
Names:
Kind: MysqlCluster
List Kind: MysqlClusterList
Plural: mysqlclusters
Short Names:
mysql
Singular: mysqlcluster
Scope: Namespaced
Subresources:
Scale:
Spec Replicas Path: .spec.replicas
Status Replicas Path: .status.readyNodes
Status:
Version: v1alpha1
Versions:
Name: v1alpha1
Served: true
Storage: true
Status:
Accepted Names:
Kind: MysqlCluster
List Kind: MysqlClusterList
Plural: mysqlclusters
Short Names:
mysql
Singular: mysqlcluster
Conditions:
Last Transition Time: 2018-12-13T16:32:29Z
Message: no conflicts found
Reason: NoConflicts
Status: True
Type: NamesAccepted
Last Transition Time: <nil>
Message: the initial names have been accepted
Reason: InitialNamesAccepted
Status: True
Type: Established
Stored Versions:
v1alpha1
Events: <none>
Output of helm version:
Client: &version.Version{SemVer:"v2.12.0", GitCommit:"d325d2a9c179b33af1a024cdb5a4472b6288016a", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.12.0", GitCommit:"d325d2a9c179b33af1a024cdb5a4472b6288016a", GitTreeState:"clean"}
Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T20:17:28Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.2-gke.18", GitCommit:"5796233393d7bc034428de15191ad3d2eaff95fb", GitTreeState:"clean", BuildDate:"2018-11-08T20:49:08Z", GoVersion:"go1.10.3b4", Compiler:"gc", Platform:"linux/amd64"}
Cloud Provider/Platform (AKS, GKE, Minikube etc.): GKE, Digital Ocean
Reacted by Deepak, David J. M. Karlsen, jakaruna-MSFT and Gerald
Activity
philoserf commentedon Dec 13, 2018
reference issues: helm/charts#9941, helm/charts#9166
potential source: #4709
jcodybaker commentedon Dec 14, 2018
We have seen this with the istio 1.0.3 chart https://github.com/istio/istio/tree/1.0.3/install/kubernetes/helm/istio as well.
philoserf commentedon Dec 14, 2018
Can you take a look @mmerrill3
I am still looking for any other cause. It may be that in fixing #4704 and the delete case the install case was broken.
mortent commentedon Dec 15, 2018
#4709 is the source of this bug. It causes the CRDs to first be installed in the crd_install hook and then also tries to install it with the other resources. So this will break install of all charts that uses the crd_install hook.
It also changes the semantics of the crd_install hook, since this causes the CRDs to be tracked as part of the release. This causes CRDs to be deleted when a release is removed, which is not safe.
GitBytes commentedon Dec 16, 2018
+1
paskal commentedon Dec 17, 2018
In my case I can't install prometheus-operator as subchart of my own chart at all because of this bug.
Team, could you please revert this change and release bugfix version 12.1 with it?
cc @technosophos
bacongobbler commentedon Dec 17, 2018
Back from kubecon. I can take a closer look.
bacongobbler commentedon Dec 17, 2018
If y'all wouldn't mind testing #5067 and confirm that it retains the old behaviour of the crd-install hook, that'd be much appreciated. Thanks!
philoserf commentedon Dec 17, 2018
I can confirm this corrects the situation @bacongobbler
hobti01 commentedon Dec 17, 2018
We have seen that after installing with 2.12 and downgrading to 2.11 our CRDs were removed - presumably the same deletion will happen with reversal of this. Perhaps because 2.12 owns the CRDs and 2.11 doesn't.
bacongobbler commentedon Dec 17, 2018
that's exactly correct, @hobti01. @mortent wrote up a pretty good summary of the issue in a comment a little further up^
#5054 (comment)
hobti01 commentedon Dec 17, 2018
Yes, his summary is great but perhaps does not highlight the impact of a downgrade or reversion for anyone who worked around the 2.12 issue.
We worked around the issue for cert-manager with 2.12 by installing with the chart-specific ability/flag to not install CRDs, then using normal upgrade. So now we are "ok" for 2.12, but reverting will cause an un-install of all CRDs and therefore all custom resources.
In both cases, CRDs get deleted, which is unfortunate, but we're happy to have reliable behaviour and working installations and upgrades.
Update to Helm 2.12.1