代码拉取完成,页面将自动刷新
package templates
const AddonJobTemplate = `
{{- $addonName := .AddonName }}
{{- $nodeName := .NodeName }}
{{- $image := .Image }}
apiVersion: batch/v1
kind: Job
metadata:
{{- if eq .DeleteJob "true" }}
name: {{$addonName}}-delete-job
{{- else }}
name: {{$addonName}}-deploy-job
{{- end }}
namespace: kube-system
spec:
backoffLimit: 10
template:
metadata:
name: rke-deploy
spec:
tolerations:
- key: node-role.kubernetes.io/controlplane
operator: Exists
effect: NoSchedule
- key: node-role.kubernetes.io/etcd
operator: Exists
effect: NoExecute
hostNetwork: true
serviceAccountName: rke-job-deployer
nodeName: {{$nodeName}}
containers:
{{- if eq .DeleteJob "true" }}
- name: {{$addonName}}-delete-pod
{{- else }}
- name: {{$addonName}}-pod
{{- end }}
image: {{$image}}
{{- if eq .DeleteJob "true" }}
command: ["/bin/sh"]
args: ["-c" ,"kubectl get --ignore-not-found=true -f /etc/config/{{$addonName}}.yaml -o name | xargs kubectl delete --ignore-not-found=true"]
{{- else }}
command: [ "kubectl", "apply", "-f" , "/etc/config/{{$addonName}}.yaml"]
{{- end }}
volumeMounts:
- name: config-volume
mountPath: /etc/config
volumes:
- name: config-volume
configMap:
# Provide the name of the ConfigMap containing the files you want
# to add to the container
name: {{$addonName}}
items:
- key: {{$addonName}}
path: {{$addonName}}.yaml
restartPolicy: Never`
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。