Skip to content

Instantly share code, notes, and snippets.

@martincalvert
Created November 9, 2017 16:41
Show Gist options
  • Save martincalvert/d70323e3488c7bb0da3a7bbe5ee3a278 to your computer and use it in GitHub Desktop.
Save martincalvert/d70323e3488c7bb0da3a7bbe5ee3a278 to your computer and use it in GitHub Desktop.
K8s: Random Templates
{{ define "affinity_notation" }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: {{ .Values.nodeAffinity.key }}
operator: In
values:
- {{ .Values.nodeAffinity.value }}
{{ end }}
{{ define "pod_resources" }}
resources:
requests:
memory: {{ .request.memory }}
cpu: {{ .request.cpu }}
limits:
memory: {{ .limit.memory }}
cpu: {{ .limit.cpu }}
{{ end }}
{{ define "http_get_probe" }}
{{ .type }}:
httpGet:
path: {{ .path | default "/health.json" }}
port: {{ .port | default 3000 }}
initialDelaySeconds: {{ .initialDelay | default 60 }}
periodSeconds: {{ .periodSeconds | default 30 }}
timeoutSeconds: {{ .timeoutSeconds | default 5 }}
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment