1 Star 0 Fork 0

litian / rke

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
job-deployer.go 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
package templates
const JobDeployerTemplate = `
{{- $addonName := .AddonName }}
{{- $nodeName := .NodeName }}
{{- $image := .Image }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{$addonName}}-deploy-job
spec:
backoffLimit: 10
template:
metadata:
name: pi
spec:
tolerations:
- key: node-role.kubernetes.io/controlplane
operator: Exists
effect: NoExecute
- key: node-role.kubernetes.io/etcd
operator: Exists
effect: NoExecute
hostNetwork: true
serviceAccountName: rke-job-deployer
nodeName: {{$nodeName}}
containers:
- name: {{$addonName}}-pod
image: {{$image}}
command: [ "kubectl", "apply", "-f" , "/etc/config/{{$addonName}}.yaml"]
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`
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/litian33/rke.git
git@gitee.com:litian33/rke.git
litian33
rke
rke
v0.1.8-rc5

搜索帮助

344bd9b3 5694891 D2dac590 5694891