Browse Source

Added msa component for saberes

master
Fábio Kaiser Rauber 3 years ago
parent
commit
589a08cf7c
  1. 7
      charts/saberes/v0.1.0/templates/_helpers.tpl
  2. 80
      charts/saberes/v0.1.0/templates/msa-deployment.yaml
  3. 21
      charts/saberes/v0.1.0/templates/postfixspool-pvc.yaml
  4. 17
      charts/saberes/v0.1.0/templates/service-msa.yaml
  5. 28
      charts/saberes/v0.1.0/values.yaml

7
charts/saberes/v0.1.0/templates/_helpers.tpl

@ -48,4 +48,11 @@ Selector labels
{{- define "saberes.selectorLabels" -}}
app.kubernetes.io/name: {{ include "saberes.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: app
{{- end }}
{{- define "saberes.msaSelectorLabels" -}}
app.kubernetes.io/name: {{ include "saberes.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: msa
{{- end }}

80
charts/saberes/v0.1.0/templates/msa-deployment.yaml

@ -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 -}}

21
charts/saberes/v0.1.0/templates/postfixspool-pvc.yaml

@ -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 }}

17
charts/saberes/v0.1.0/templates/service-msa.yaml

@ -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 -}}

28
charts/saberes/v0.1.0/values.yaml

@ -98,4 +98,30 @@ velero:
nodeSelector: {}
tolerations: []
tolerations: []
msa:
image:
repository: porto.interlegis.leg.br/library/alpine-postfix
tag: latest
pullPolicy: IfNotPresent
enabled: true
replicas: 1
config:
relayHost: yoursmart.host
domain: cluster.local
msgSizeLimit: "50000000"
relayNets: 10.42.0.0/16
resources:
limits:
cpu: 600m
memory: 1Gi
requests:
cpu: 300m
memory: 250Mi
nodeSelector: {}
persistence:
enabled: true
#storageClass: ""
accessMode: ReadWriteMany
size: 5Gi
Loading…
Cancel
Save