Fábio Kaiser Rauber
3 years ago
5 changed files with 152 additions and 1 deletions
@ -0,0 +1,80 @@ |
|||
{{- if .Values.msa.enabled -}} |
|||
apiVersion: apps/v1 |
|||
kind: Deployment |
|||
metadata: |
|||
name: {{ include "saberes.fullname" . }}-msa |
|||
labels: |
|||
{{- include "saberes.labels" . | nindent 4 }} |
|||
spec: |
|||
replicas: {{ .Values.msa.replicas }} |
|||
selector: |
|||
matchLabels: |
|||
{{- include "saberes.msaSelectorLabels" . | nindent 6 }} |
|||
template: |
|||
metadata: |
|||
{{- with .Values.podAnnotations }} |
|||
annotations: |
|||
{{- toYaml . | nindent 8 }} |
|||
{{- end }} |
|||
labels: |
|||
{{- include "saberes.msaSelectorLabels" . | nindent 8 }} |
|||
spec: |
|||
{{- with .Values.imagePullSecrets }} |
|||
imagePullSecrets: |
|||
{{- toYaml . | nindent 8 }} |
|||
{{- end }} |
|||
securityContext: |
|||
{{- toYaml .Values.podSecurityContext | nindent 8 }} |
|||
containers: |
|||
- name: {{ .Chart.Name }}-msa |
|||
securityContext: |
|||
{{- toYaml .Values.securityContext | nindent 12 }} |
|||
image: "{{ .Values.msa.image.repository }}:{{ .Values.msa.image.tag }}" |
|||
imagePullPolicy: {{ .Values.msa.image.pullPolicy }} |
|||
env: |
|||
- name: DOMAIN |
|||
value: "{{ .Release.Namespace }}.{{ .Values.msa.config.domain }}" |
|||
- name: HOSTNAME |
|||
value: "{{ include "saberes.fullname" . }}-msa.{{ .Release.Namespace }}.{{ .Values.msa.config.domain }}" |
|||
- name: MESSAGE_SIZE_LIMIT |
|||
value: "{{ .Values.msa.config.msgSizeLimit }}" |
|||
- name: RELAYHOST |
|||
value: "{{ .Values.msa.config.relayHost }}" |
|||
- name: RELAYNETS |
|||
value: "{{ .Values.msa.config.relayNets }}" |
|||
volumeMounts: |
|||
- mountPath: /var/spool/postfix |
|||
name: postfixspool |
|||
ports: |
|||
- name: smtp |
|||
containerPort: 25 |
|||
protocol: TCP |
|||
readinessProbe: |
|||
tcpSocket: |
|||
port: 25 |
|||
initialDelaySeconds: 5 |
|||
periodSeconds: 10 |
|||
livenessProbe: |
|||
tcpSocket: |
|||
port: 25 |
|||
initialDelaySeconds: 10 |
|||
periodSeconds: 20 |
|||
resources: |
|||
{{- toYaml .Values.msa.resources | nindent 12 }} |
|||
volumes: |
|||
- name: postfixspool |
|||
{{- if .Values.persistence.enabled }} |
|||
persistentVolumeClaim: |
|||
claimName: {{ include "saberes.fullname" . }}-postfixspool |
|||
{{- else }} |
|||
emptyDir: {} |
|||
{{- end }} |
|||
{{- with .Values.msa.nodeSelector }} |
|||
nodeSelector: |
|||
{{- toYaml . | nindent 8 }} |
|||
{{- end }} |
|||
{{- with .Values.tolerations }} |
|||
tolerations: |
|||
{{- toYaml . | nindent 8 }} |
|||
{{- end }} |
|||
{{- end -}} |
@ -0,0 +1,21 @@ |
|||
{{- if and .Values.persistence.enabled .Values.msa.enabled }} |
|||
apiVersion: v1 |
|||
kind: PersistentVolumeClaim |
|||
metadata: |
|||
name: {{ include "saberes.fullname" . }}-postfixspool |
|||
labels: |
|||
{{- include "saberes.labels" . | nindent 4 }} |
|||
spec: |
|||
accessModes: |
|||
- {{ .Values.msa.persistence.accessMode }} |
|||
resources: |
|||
requests: |
|||
storage: {{ .Values.msa.persistence.size }} |
|||
{{- if .Values.msa.persistence.storageClass }} |
|||
{{- if (eq "-" .Values.msa.persistence.storageClass) }} |
|||
storageClassName: "" |
|||
{{- else }} |
|||
storageClassName: "{{ .Values.msa.persistence.storageClass }}" |
|||
{{- end }} |
|||
{{- end }} |
|||
{{- end }} |
@ -0,0 +1,17 @@ |
|||
{{- if .Values.msa.enabled -}} |
|||
apiVersion: v1 |
|||
kind: Service |
|||
metadata: |
|||
name: {{ include "saberes.fullname" . }}-msa |
|||
labels: |
|||
{{- include "saberes.labels" . | nindent 4 }} |
|||
spec: |
|||
type: {{ .Values.service.type }} |
|||
ports: |
|||
- port: 25 |
|||
targetPort: 25 |
|||
protocol: TCP |
|||
name: smtp |
|||
selector: |
|||
{{- include "saberes.msaSelectorLabels" . | nindent 4 }} |
|||
{{- end -}} |
Loading…
Reference in new issue