Skip to content

Commit

Permalink
wip(common): add a common deployment.yaml #281 [pack]
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Feb 4, 2022
1 parent 6e1640d commit 927eb7c
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions charts/common/templates/_deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{- define "common.node-deployment" -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
template:
metadata:
labels: {{- include "common.labels.standard" . | nindent 8 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ include "common.names.name" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.env }}
env:
{{- include "common.environment.render" (dict "env" .Values.env "context" $) | indent 12 }}
{{- end }}
ports:
- name: {{ include "common.names.name" . }}
containerPort: {{ .Values.containerPort }}
readinessProbe:
tcpSocket:
port: {{ include "common.names.name" . }}
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: {{ .Values.livenessEndpoint | default "/" }}
port: {{ include "common.names.name" . }}
initialDelaySeconds: 60
periodSeconds: 15
{{- end }}

0 comments on commit 927eb7c

Please sign in to comment.