Created
August 20, 2018 11:21
-
-
Save mrballcb/8a837ef1e6effa61fc848abd1b175351 to your computer and use it in GitHub Desktop.
Helm daemonset yaml template for pre-pulling images.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1beta2 | |
kind: DaemonSet | |
metadata: | |
name: {{ .Release.Name }}-prepull | |
labels: | |
app: {{ template "name" . }} | |
env: {{ .Values.environment }} | |
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | |
release: {{ .Release.Name }} | |
heritage: {{ .Release.Service }} | |
spec: | |
selector: | |
matchLabels: | |
name: {{ .Release.Name }}-prepull | |
template: | |
metadata: | |
labels: | |
name: {{ .Release.Name }}-prepull | |
release: {{ .Release.Name }} | |
env: {{ .Values.environment }} | |
spec: | |
imagePullSecrets: | |
- name: {{ .Values.image.imagePullSecret }} | |
initContainers: | |
- name: prepull | |
image: {{ .Values.image.repository}}:{{ .Values.image.tag }} | |
command: ["sh", "-c", "echo 'Pre-Pull of {{ .Values.image.repository}}:{{ .Values.image.tag }} successful'"] | |
volumeMounts: | |
- name: docker | |
mountPath: /var/run | |
volumes: | |
- name: docker | |
hostPath: | |
path: /var/run | |
containers: | |
- name: pause | |
image: gcr.io/google_containers/pause | |
{{- if .Values.toleration }} | |
nodeSelector: | |
kops.k8s.io/instancegroup: {{ .Values.toleration.name }} | |
tolerations: | |
- key: "{{ .Values.toleration.name }}" | |
operator: "Exists" | |
effect: "{{ .Values.toleration.type }}" | |
{{- end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi mrballcb,
I have a silly question: How to use this yaml file? Tried
helm install my-chart -f daemonset.yaml
but there's always the errorError: failed to parse daemonsets.yaml: error converting YAML to JSON: yaml: line 3: did not find expected key
.