Skip to content

Instantly share code, notes, and snippets.

@timReynolds
Created August 28, 2018 19:52
Show Gist options
  • Save timReynolds/2e4d08a44a036b58eaec90b919ac4cbb to your computer and use it in GitHub Desktop.
Save timReynolds/2e4d08a44a036b58eaec90b919ac4cbb to your computer and use it in GitHub Desktop.
Yuck.yaml
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ include "fullname" . }}
namespace: default
labels:
app: {{ include "name" . }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ include "name" . }}
template:
metadata:
labels:
app: {{ include "name" . }}
spec:
containers:
- name: {{ .Values.name }}
image: "{{ .Values.image.name }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if gt (( .Values.ports | len )) 0 }}
ports:
{{- range $index, $value := .Values.ports }}
- containerPort: {{ $value.internal }}
name: {{ $value.name }}
protocol: {{ default "TCP" $value.protocol }}
{{- end }}
{{- end }}
{{- if .Values.probes }}
{{ toYaml .Values.probes | indent 8 }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment