Fábio Kaiser Rauber
3 years ago
6 changed files with 130 additions and 78 deletions
@ -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 }} |
@ -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 }} |
@ -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 }} |
@ -1,13 +1,13 @@ |
|||
apiVersion: v1 |
|||
kind: Service |
|||
metadata: |
|||
name: {{ include "mailproxy.fullname" . }} |
|||
name: {{ include "mailproxy.fullname" . }}-nginx |
|||
labels: |
|||
{{- include "mailproxy.labels" . | nindent 4 }} |
|||
spec: |
|||
type: {{ .Values.service.type }} |
|||
type: {{ .Values.nginx.service.type }} |
|||
ports: |
|||
{{- range $i, $port := .Values.service.ports }} |
|||
{{- range $i, $port := .Values.nginx.service.ports }} |
|||
- port: {{ $port.number }} |
|||
targetPort: {{ $port.number }} |
|||
protocol: {{ $port.protocol }} |
Loading…
Reference in new issue