Created
November 9, 2017 16:33
-
-
Save martincalvert/64584ddca406a42d953e575fc2a4cd60 to your computer and use it in GitHub Desktop.
K8s: Deployment Template
This file contains 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
{{ define "ruby_api_deployment" }} | |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: {{ .Values.rubyApi.name }}-api | |
labels: | |
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | |
annotations: | |
"helm/created": {{ .Release.Time.Seconds | quote }} | |
spec: | |
replicas: {{ .Values.rubyApi.replicas }} | |
template: | |
metadata: | |
labels: | |
app: {{ .Values.rubyApi.name }} | |
tier: {{ .Values.rubyApi.name }}-api | |
annotations: | |
date: {{ .Release.Time.Seconds | quote }} | |
spec: | |
{{ include "affinity_notation" . | indent 6 }} | |
containers: | |
- name: {{ .Values.rubyApi.name }} | |
image: {{ .Values.rubyApi.image.name }}:{{ .Values.rubyApi.image.tag }} | |
imagePullPolicy: {{ .Values.rubyApi.image.pullPolicy }} | |
command: | |
- bundle | |
- exec | |
- unicorn | |
- "-E" | |
- {{ .Values.environment }} | |
- "-c" | |
- /etc/unicorn/unicorn.rb | |
- "-l" | |
- :3000 | |
ports: | |
- containerPort: 3000 | |
{{ include "pod_resources" .Values.rubyApi.resources | indent 8 }} | |
{{ include "http_get_probe" .Values.rubyApi.livenessProbe | indent 8 }} | |
{{ include "http_get_probe" .Values.rubyApi.readinessProbe | indent 8 }} | |
volumeMounts: | |
- mountPath: /etc/unicorn/unicorn.rb | |
subPath: unicorn.rb | |
name: {{ .Values.rubyApi.name }}-unicorn-config | |
readOnly: true | |
volumes: | |
- name: {{ .Values.rubyApi.name }}-unicorn-config | |
configMap: | |
name: {{ .Values.rubyApi.name }}-unicorn-config | |
{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment