c4824ef261
- Create Helm chart structure with Chart.yaml and values.yaml - Add deployment template with container configuration and environment variables - Implement service template for gRPC port exposure - Add service account template with security configuration - Include horizontal pod autoscaler template for scaling capabilities - Add helper templates for naming and label management - Configure SMTP settings as configurable parameters in values.yaml - Set up resource limits and requests for container performance - Implement liveness and readiness probes for health checks - Add support for existing secrets and custom configurations
110 lines
3.8 KiB
YAML
110 lines
3.8 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "emailks.fullname" . }}
|
|
labels:
|
|
{{- include "emailks.labels" . | nindent 4 }}
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "emailks.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with .Values.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "emailks.selectorLabels" . | nindent 8 }}
|
|
{{- with .Values.podLabels }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "emailks.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
ports:
|
|
- name: grpc
|
|
containerPort: 50051
|
|
protocol: TCP
|
|
env:
|
|
- name: APP_SMTP_HOST
|
|
value: {{ required "smtp.host is required" .Values.smtp.host | quote }}
|
|
- name: APP_SMTP_PORT
|
|
value: {{ .Values.smtp.port | quote }}
|
|
- name: APP_SMTP_TLS
|
|
value: {{ .Values.smtp.tls | quote }}
|
|
{{- with .Values.smtp.username }}
|
|
- name: APP_SMTP_USERNAME
|
|
value: {{ . | quote }}
|
|
{{- end }}
|
|
{{- if .Values.existingSecret.name }}
|
|
- name: APP_SMTP_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Values.existingSecret.name }}
|
|
key: {{ .Values.existingSecret.passwordKey }}
|
|
{{- else if .Values.smtp.password }}
|
|
- name: APP_SMTP_PASSWORD
|
|
value: {{ .Values.smtp.password | quote }}
|
|
{{- end }}
|
|
- name: APP_SMTP_FROM_EMAIL
|
|
value: {{ .Values.smtp.fromEmail | quote }}
|
|
{{- with .Values.smtp.fromName }}
|
|
- name: APP_SMTP_FROM_NAME
|
|
value: {{ . | quote }}
|
|
{{- end }}
|
|
{{- with .Values.smtp.replyTo }}
|
|
- name: APP_SMTP_REPLY_TO
|
|
value: {{ . | quote }}
|
|
{{- end }}
|
|
- name: APP_SMTP_TIMEOUT_SECS
|
|
value: {{ .Values.smtp.timeoutSecs | quote }}
|
|
{{- with .Values.smtp.heloName }}
|
|
- name: APP_SMTP_HELO_NAME
|
|
value: {{ . | quote }}
|
|
{{- end }}
|
|
- name: APP_SMTP_ALLOW_REQUEST_FROM
|
|
value: {{ .Values.smtp.allowRequestFrom | quote }}
|
|
- name: APP_SMTP_QUEUE_CAPACITY
|
|
value: {{ .Values.queue.capacity | quote }}
|
|
- name: APP_SMTP_LISTEN_ADDR
|
|
value: {{ .Values.listenAddr | quote }}
|
|
- name: RUST_LOG
|
|
value: {{ .Values.logLevel | quote }}
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: grpc
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: grpc
|
|
initialDelaySeconds: 3
|
|
periodSeconds: 5
|
|
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 }}
|