chart: Add an annotation for CRDs

So that the CRDs won't be wrongly deleted when the CRD files is
splitted.

https://helm.sh/docs/topics/charts_hooks/#hook-resources-are-not-managed-with-corresponding-releases

Longhorn #1818

Signed-off-by: Shuo Wu <shuo@rancher.com>
This commit is contained in:
Shuo Wu 2020-10-13 19:25:14 +08:00 committed by Sheng Yang
parent 68a1082e6d
commit e5a0491499
2 changed files with 19 additions and 0 deletions

View File

@ -29,6 +29,11 @@ Longhorn is 100% open source software. Project source code is spread across a nu
2. From Rancher UI, navigate to `Catalog Apps` tab and delete Longhorn app.
3. Delete Longhorn CRDs
```
kubectl delete crd engineimages.longhorn.io engines.longhorn.io instancemanagers.longhorn.io nodes.longhorn.io replicas.longhorn.io settings.longhorn.io volumes.longhorn.io
```
## Troubleshooting
### I deleted the Longhorn App from Rancher UI instead of following the uninstallation procedure

View File

@ -3,6 +3,8 @@ kind: CustomResourceDefinition
metadata:
labels: {{- include "longhorn.labels" . | nindent 4 }}
longhorn-manager: Engine
annotations:
helm.sh/resource-policy: keep
name: engines.longhorn.io
spec:
group: longhorn.io
@ -23,6 +25,8 @@ kind: CustomResourceDefinition
metadata:
labels: {{- include "longhorn.labels" . | nindent 4 }}
longhorn-manager: Replica
annotations:
helm.sh/resource-policy: keep
name: replicas.longhorn.io
spec:
group: longhorn.io
@ -43,6 +47,8 @@ kind: CustomResourceDefinition
metadata:
labels: {{- include "longhorn.labels" . | nindent 4 }}
longhorn-manager: Setting
annotations:
helm.sh/resource-policy: keep
name: settings.longhorn.io
spec:
group: longhorn.io
@ -61,6 +67,8 @@ kind: CustomResourceDefinition
metadata:
labels: {{- include "longhorn.labels" . | nindent 4 }}
longhorn-manager: Volume
annotations:
helm.sh/resource-policy: keep
name: volumes.longhorn.io
spec:
group: longhorn.io
@ -81,6 +89,8 @@ kind: CustomResourceDefinition
metadata:
labels: {{- include "longhorn.labels" . | nindent 4 }}
longhorn-manager: EngineImage
annotations:
helm.sh/resource-policy: keep
name: engineimages.longhorn.io
spec:
group: longhorn.io
@ -101,6 +111,8 @@ kind: CustomResourceDefinition
metadata:
labels: {{- include "longhorn.labels" . | nindent 4 }}
longhorn-manager: Node
annotations:
helm.sh/resource-policy: keep
name: nodes.longhorn.io
spec:
group: longhorn.io
@ -121,6 +133,8 @@ kind: CustomResourceDefinition
metadata:
labels: {{- include "longhorn.labels" . | nindent 4 }}
longhorn-manager: InstanceManager
annotations:
helm.sh/resource-policy: keep
name: instancemanagers.longhorn.io
spec:
group: longhorn.io