gbif / stackable

GBIF Stackable Infrastructure
Apache License 2.0
4 stars 0 forks source link

Add hooks for CRDs updating and cleanup #8

Closed zaultooz closed 5 months ago

zaultooz commented 1 year ago

With helm and helmfile you are able to create hooks for some of the phases during the install or upgrade process. As there are quite a few operators being installed as part of 01-operators.yaml, it could be good to have a way to automated it through helmfile through hooks with condition flags. The flags is to ensure it is an active choice to either update or delete.

An example of a hook that cleans all CRDs:

releases:
- name: some-release
  namespace: some-namespace
  chart: some-charts.yaml
  version: 1.0.0
  installed: false
  hooks: 
  - events: ["postuninstall"]
    showlogs: true
    command: "../scripts/clean_crd.sh"

However you should always be cautious when it comes to delete or upgrading CRDs as it will affect running instances of the given CRD which could very likely result in datalose.

zaultooz commented 5 months ago

Auto cleanup of CRDs is a dangerous action as it would remove anything running on the cluster. Therefore I don't think this enhancement makes sense.