Browse Source

Included mailauth in mailproxy chart

master
Fábio Kaiser Rauber 3 years ago
parent
commit
e7fc7c2c57
  1. 28
      charts/mailproxy/v0.1.0/templates/hpa.yaml
  2. 12
      charts/mailproxy/v0.1.0/templates/mailauth-deployment.yaml
  3. 17
      charts/mailproxy/v0.1.0/templates/mailauth-service.yaml
  4. 60
      charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml
  5. 6
      charts/mailproxy/v0.1.0/templates/nginx-service.yaml
  6. 71
      charts/mailproxy/v0.1.0/values.yaml

28
charts/mailproxy/v0.1.0/templates/hpa.yaml

@ -1,28 +0,0 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "mailproxy.fullname" . }}
labels:
{{- include "mailproxy.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "mailproxy.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

12
charts/mailproxy/v0.1.0/templates/deployment.yaml → charts/mailproxy/v0.1.0/templates/mailauth-deployment.yaml

@ -5,9 +5,7 @@ metadata:
labels: labels:
{{- include "mailproxy.labels" . | nindent 4 }} {{- include "mailproxy.labels" . | nindent 4 }}
spec: spec:
{{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.mailauth.replicaCount }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector: selector:
matchLabels: matchLabels:
{{- include "mailproxy.selectorLabels" . | nindent 6 }} {{- include "mailproxy.selectorLabels" . | nindent 6 }}
@ -30,10 +28,10 @@ spec:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
securityContext: securityContext:
{{- toYaml .Values.securityContext | nindent 12 }} {{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" image: "{{ .Values.mailauth.image.repository }}:{{ .Values.mailauth.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.mailauth.image.pullPolicy }}
ports: ports:
{{- range $i, $port := .Values.service.ports }} {{- range $i, $port := .Values.mailauth.service.ports }}
- name: {{ $port.name }} - name: {{ $port.name }}
containerPort: {{ $port.number }} containerPort: {{ $port.number }}
protocol: {{ $port.protocol }} protocol: {{ $port.protocol }}
@ -47,7 +45,7 @@ spec:
path: / path: /
port: http port: http
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.mailauth.resources | nindent 12 }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}

17
charts/mailproxy/v0.1.0/templates/mailauth-service.yaml

@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "mailproxy.fullname" . }}-mailauth
labels:
{{- include "mailproxy.labels" . | nindent 4 }}
spec:
type: {{ .Values.mailauth.service.type }}
ports:
{{- range $i, $port := .Values.mailauth.service.ports }}
- port: {{ $port.number }}
targetPort: {{ $port.number }}
protocol: {{ $port.protocol }}
name: {{ $port.name }}
{{- end }}
selector:
{{- include "mailproxy.selectorLabels" . | nindent 4 }}

60
charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml

@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "mailproxy.fullname" . }}
labels:
{{- include "mailproxy.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.nginx.replicaCount }}
selector:
matchLabels:
{{- include "mailproxy.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "mailproxy.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
ports:
{{- range $i, $port := .Values.nginx.service.ports }}
- name: {{ $port.name }}
containerPort: {{ $port.number }}
protocol: {{ $port.protocol }}
{{- end }}
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.nginx.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 }}

6
charts/mailproxy/v0.1.0/templates/service.yaml → charts/mailproxy/v0.1.0/templates/nginx-service.yaml

@ -1,13 +1,13 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ include "mailproxy.fullname" . }} name: {{ include "mailproxy.fullname" . }}-nginx
labels: labels:
{{- include "mailproxy.labels" . | nindent 4 }} {{- include "mailproxy.labels" . | nindent 4 }}
spec: spec:
type: {{ .Values.service.type }} type: {{ .Values.nginx.service.type }}
ports: ports:
{{- range $i, $port := .Values.service.ports }} {{- range $i, $port := .Values.nginx.service.ports }}
- port: {{ $port.number }} - port: {{ $port.number }}
targetPort: {{ $port.number }} targetPort: {{ $port.number }}
protocol: {{ $port.protocol }} protocol: {{ $port.protocol }}

71
charts/mailproxy/v0.1.0/values.yaml

@ -1,31 +1,13 @@
# Default values for mailproxy. # Default values for mailproxy.
replicaCount: 2 nginx:
image:
image:
repository: nginx repository: nginx
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion. # Overrides the image tag whose default is the chart appVersion.
tag: "" tag: ""
replicaCount: 2
imagePullSecrets: [] service:
nameOverride: ""
fullnameOverride: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP type: ClusterIP
ports: ports:
- name: imaps - name: imaps
@ -37,12 +19,27 @@ service:
- name: smtp - name: smtp
number: 587 number: 587
protocol: TCP protocol: TCP
resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
resources: {} mailauth:
# We usually recommend not to specify default resources and to leave this as a conscious image:
# choice for the user. This also increases chances charts run on environments with little repository: porto.interlegis.leg.br/seit/rancher-nginx-mailproxy
# resources, such as Minikube. If you do want to specify resources, uncomment the following pullPolicy: IfNotPresent
# lines, adjust them as necessary, and remove the curly braces after 'resources:'. tag: "0.0.8"
replicaCount: 2
service:
type: ClusterIP
ports:
- name: php-fpm
number: 9000
protocol: TCP
resources: {}
# limits: # limits:
# cpu: 100m # cpu: 100m
# memory: 128Mi # memory: 128Mi
@ -50,12 +47,20 @@ resources: {}
# cpu: 100m # cpu: 100m
# memory: 128Mi # memory: 128Mi
autoscaling: imagePullSecrets: []
enabled: false
minReplicas: 1 podAnnotations: {}
maxReplicas: 100
targetCPUUtilizationPercentage: 80 podSecurityContext: {}
# targetMemoryUtilizationPercentage: 80 # fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
nodeSelector: {} nodeSelector: {}

Loading…
Cancel
Save