【发布时间】:2020-10-21 19:45:57
【问题描述】:
我正在尝试设置 helm“安装后”挂钩并看到以下错误。 错误: sh:脚本/jenkins.sh:未找到
postinstall.yaml 内容
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ .Release.Name }}"
annotations:
# This is what defines this resource as a hook. Without this line, the
# job is considered part of the release.
"helm.sh/hook": post-install
"helm.sh/hook-weight": "-5"
spec:
template:
spec:
containers:
- name: post-install-jenkins-job
image: alpine:3.3
imagePullPolicy: IfNotPresent
command: [ "/bin/sh", "-c", "scripts/jenkins.sh"]
restartPolicy: Never
terminationGracePeriodSeconds: 0
helm包的文件夹结构 scripts/jenkins.h 是我尝试使用“postinstall.yaml”作为安装后 helm hook 执行的脚本。
riq-agent
├── Chart.yaml
├── README.md
├── scripts
│ └── jenkins.sh
├── templates
│ ├── NOTES.txt
│ ├── Untitled-1.yml
│ ├── _helpers.tpl
│ ├── awssecret.yaml
│ ├── clusterrolebinding.yaml
│ ├── configurationFiles-configmap.yaml
│ ├── deployment.yaml
│ ├── hook-aws-ecr.yaml
│ ├── initializationFiles-configmap.yaml
│ ├── postinstall.yaml
│ ├── pvc.yaml
│ ├── secrets.yaml
│ ├── serviceaccount.yaml
│ ├── servicemonitor.yaml
│ ├── svc.yaml
│ └── tests
│ ├── test-configmap.yaml
│ └── test.yaml
└── values.yaml
我尝试在 helm hook 中执行 shell 脚本(存储在 helm 包中)的方式是否有任何错误?
【问题讨论】:
标签: sh hook kubernetes-helm