Files
home-cluster-ops/apps/ec-config-server/env/k3s-cluster/templates/deployment.yaml

91 lines
3.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ec-config-server.fullname" . }}
namespace: {{ include "ec-config-server.namespace" . }}
labels:
{{- include "ec-config-server.labels" . | nindent 4 }}
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: {{ .Values.rollingUpdate.maxUnavailable }}
maxSurge: {{ .Values.rollingUpdate.maxSurge }}
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "ec-config-server.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "ec-config-server.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "ec-config-server.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
envFrom:
- configMapRef:
name: {{ include "ec-config-server.fullname" . }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8100
protocol: TCP
startupProbe:
failureThreshold: {{ .Values.deployment.startupProbe.failureThreshold }}
httpGet:
path: {{ .Values.deployment.livenesscheckpath }}
port: {{ .Values.deployment.healthcheckport }}
scheme: HTTP
periodSeconds: {{ .Values.deployment.startupProbe.periodSeconds }}
successThreshold: {{ .Values.deployment.startupProbe.successThreshold }}
timeoutSeconds: {{ .Values.deployment.startupProbe.timeoutSeconds }}
initialDelaySeconds: {{ .Values.deployment.startupProbe.initialDelaySeconds }}
livenessProbe:
failureThreshold: {{ .Values.deployment.livenessProbe.failureThreshold }}
httpGet:
path: {{ .Values.deployment.livenesscheckpath }}
port: {{ .Values.deployment.healthcheckport }}
scheme: HTTP
periodSeconds: {{ .Values.deployment.livenessProbe.periodSeconds }}
successThreshold: {{ .Values.deployment.livenessProbe.successThreshold }}
timeoutSeconds: {{ .Values.deployment.livenessProbe.timeoutSeconds }}
readinessProbe:
failureThreshold: {{ .Values.deployment.readinessProbe.failureThreshold }}
httpGet:
path: {{ .Values.deployment.readinesscheckpath }}
port: {{ .Values.deployment.healthcheckport }}
scheme: HTTP
periodSeconds: {{ .Values.deployment.readinessProbe.periodSeconds }}
successThreshold: {{ .Values.deployment.readinessProbe.successThreshold }}
timeoutSeconds: {{ .Values.deployment.readinessProbe.timeoutSeconds }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}