Skip to content

Instantly share code, notes, and snippets.

@bkonkle
Last active October 27, 2016 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkonkle/849f93f4b5844306b5328398b0239cca to your computer and use it in GitHub Desktop.
Save bkonkle/849f93f4b5844306b5328398b0239cca to your computer and use it in GitHub Desktop.
Helm Replication Controller example
apiVersion: v1
kind: ReplicationController
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
replicas: {{ .Values.replicas }}
selector:
app: {{ template "fullname" . }}
template:
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
spec:
containers:
- name: {{ template "fullname" . }}
image: "{{ .Values.imageName }}:{{ .Values.imageTag }}"
imagePullPolicy: Always
resources:
requests:
cpu: "{{ .Values.cpu }}"
memory: "{{ .Values.memory }}"
limits:
cpu: "{{ .Values.cpu }}"
memory: "{{ .Values.memory }}"
env:
- name: PORT
value: "{{ .Values.port }}"
{{- range .Values.env }}
- name: {{ .name }}
value: {{ .value }}
{{- end }}
ports:
- name: node
containerPort: 3000
readinessProbe:
tcpSocket:
port: 3000
initialDelaySeconds: 30
timeoutSeconds: 1
livenessProbe:
tcpSocket:
port: 3000
initialDelaySeconds: 30
timeoutSeconds: 1
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.imagePullSecrets }}
- name: {{ .name }}
{{- end }}
{{- end -}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment