1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-17 23:49:06 +00:00
Files
rke/templates/job-deployer.go
2018-06-21 21:08:36 -07:00

44 lines
1.2 KiB
Go

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: NoSchedule
- 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`