JovianX / helm-release-plugin

Helm3 plugin that pulls(re-creates) helm Charts from deployed releases, and updates values of deployed releases without the chart.
Apache License 2.0
97 stars 11 forks source link

Add Release TTL to set the time-to-live of a helm release #18

Open rtpro opened 1 year ago

rtpro commented 1 year ago

Add the ability to set the expiration time to a release, after the TTL(time-to-live) expires the release is deleted.

Command to set a TTL after which the release will be deleted.


Design:

Cronjob Object

apiVersion: batch/v1
kind: CronJob
metadata:
  name: <release-name>-ttl
  namespace: <release-namespace>
spec:
  schedule: "* * * * *"  # < date --date="4 days"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: ibmcom/helm
            imagePullPolicy: IfNotPresent
            command:
            - helm uninstall <RELEASE NAME> && \
              kubectl delete chronjob <release-name>-ttl
          restartPolicy: OnFailure