kyma-project / kyma

Kyma is an opinionated set of Kubernetes-based modular building blocks, including all necessary capabilities to develop and run enterprise-grade cloud-native applications.
https://kyma-project.io
Apache License 2.0
1.52k stars 405 forks source link

It is not possible to update a Kyma configuration after installation #8968

Closed hudymi closed 4 years ago

hudymi commented 4 years ago

Description

After installing Kyma it is not possible to update its configuration with overrides, because installation gets stuck. You don't have to pass even any new configuration, you can just trigger installation again with kubectl label installation/kyma-installation action=install

Version: master-ac2e972b6a2c8d2f87e7608cf9c2b0da98c8b381

Expected result

It should be possible to pass overrides to Kyma after installation, or even triggering upgrades to the same version.

Actual result

It is not possible to upgrade Kyma configuration:

2020/07/06 14:13:00 [debug] updating status for rolled back release for knative-eventing
2020/07/06 14:13:00 Step error:  Details: Helm upgrade of release "knative-eventing" failed: rendered manifests contain a resource that already exists. Unable to continue with update: CustomResourceDefinition "apiserversources.sources.knative.dev" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "knative-eventing"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "knative-eventing".
Finding last known deployed revision to rollback to.
Performing rollback to last known deployed revision: 5
Helm rollback of release "knative-eventing" was successfull

Probably the same problem is in other charts, not only knative-eventing.

Steps to reproduce

  1. Install Kyma
  2. Trigger upgrade with kubectl label installation/kyma-installation action=install
k15r commented 4 years ago

i did a quick test on my cluster: I changed the order of installation. As soon as I disabled the knative-eventing chart it failed on the next chart that still had CRDs in the templates:

2020/07/07 08:20:20 Step error:  Details: Helm upgrade of release "service-catalog" failed: rendered manifests contain a resource that already exists. Unable to continue with update: CustomResourceDefinition "clusterservicebrokers.servicecatalog.k8s.io" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "service-catalog"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "kyma-system".
Finding last known deployed revision to rollback to.```

It seems the "backwards-compatible" change (putting CRDs in a block like) 
``` {{- if not (.Capabilities.APIVersions.Has "triggers.eventing.knative.dev/v1alpha1") }}
{{- if .Release.IsUpgrade }}

does not work properly

k15r commented 4 years ago

it seems the capabilities check does not work on helm3: https://github.com/databus23/helm-diff/issues/165

anishj0shi commented 4 years ago

This issue is fixed with #9007