【问题标题】:not able to delete the helm release using cornjob in kubernets无法在 kubernetes 中使用 crontab 删除 helm 版本
【发布时间】:2021-12-10 18:34:50
【问题描述】:

这里是应该找到并删除 helm 版本的 yaml 文件,但无法删除。

apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: cronbox
  namespace: avinash-new
spec:
  serviceAccount: default
  successfulJobsHistoryLimit: 2
  failedJobsHistoryLimit: 2
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: cronbox
            image: busybox
            args:
            #command: 'sh'
            - '-uexc'
            - 'releases=$(helm ls -a -q nodejs-chart.*); helm delete --purge $releases;'
            env:
            - name: TILLER_NAMESPACE
              value: mynamespace-build
            - name: KUBECONFIG
              value: /kube/config
            #volumeMounts:
            #- mountPath: /kube
              #name: kubeconfig
          restartPolicy: OnFailure
          volumes:
          - name: kubeconfig
            configMap:
              name: cronjob-kubeconfig

请帮助我。期望是“需要像每 5 分钟一样定期删除 helm 版本”。

【问题讨论】:

  • 为什么不呢?发生什么了? (您还在使用旧版本 2 的 Helm 吗?)

标签: kubernetes openshift google-kubernetes-engine kubernetes-helm kubernetes-ingress


【解决方案1】:

image: busybox 不附带helm 命令。你可以试试this image

【讨论】:

  • 还是不行,我可以拉出图像但无法删除 helm release :-( @gohm'c
  • 它有效。但是您的args 是错误的(例如-uexc?),请先了解helm uninstall 的工作原理。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-04-03
  • 1970-01-01
  • 2021-11-21
  • 1970-01-01
  • 1970-01-01
  • 2021-07-24
  • 2022-01-13
相关资源
最近更新 更多