diff --git a/charts/mailproxy/v0.1.0/.helmignore b/charts/mailproxy/v0.1.0/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/mailproxy/v0.1.0/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/mailproxy/v0.1.0/Chart.yaml b/charts/mailproxy/v0.1.0/Chart.yaml new file mode 100644 index 0000000..97634a3 --- /dev/null +++ b/charts/mailproxy/v0.1.0/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: mailproxy +description: A Mail Proxy using Nginx and a PHP script + +type: application + +version: 0.1.0 + +appVersion: "1.20.2" diff --git a/charts/mailproxy/v0.1.0/templates/NOTES.txt b/charts/mailproxy/v0.1.0/templates/NOTES.txt new file mode 100644 index 0000000..ec82ec5 --- /dev/null +++ b/charts/mailproxy/v0.1.0/templates/NOTES.txt @@ -0,0 +1 @@ +Mailproxy instalado! \ No newline at end of file diff --git a/charts/mailproxy/v0.1.0/templates/_helpers.tpl b/charts/mailproxy/v0.1.0/templates/_helpers.tpl new file mode 100644 index 0000000..3cd5733 --- /dev/null +++ b/charts/mailproxy/v0.1.0/templates/_helpers.tpl @@ -0,0 +1,51 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "mailproxy.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "mailproxy.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "mailproxy.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "mailproxy.labels" -}} +helm.sh/chart: {{ include "mailproxy.chart" . }} +{{ include "mailproxy.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "mailproxy.selectorLabels" -}} +app.kubernetes.io/name: {{ include "mailproxy.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} \ No newline at end of file diff --git a/charts/mailproxy/v0.1.0/templates/deployment.yaml b/charts/mailproxy/v0.1.0/templates/deployment.yaml new file mode 100644 index 0000000..06071a5 --- /dev/null +++ b/charts/mailproxy/v0.1.0/templates/deployment.yaml @@ -0,0 +1,62 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "mailproxy.fullname" . }} + labels: + {{- include "mailproxy.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + 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.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + {{- range $i, $port := .Values.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.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 }} diff --git a/charts/mailproxy/v0.1.0/templates/hpa.yaml b/charts/mailproxy/v0.1.0/templates/hpa.yaml new file mode 100644 index 0000000..8016a3c --- /dev/null +++ b/charts/mailproxy/v0.1.0/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- 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 }} diff --git a/charts/mailproxy/v0.1.0/templates/service.yaml b/charts/mailproxy/v0.1.0/templates/service.yaml new file mode 100644 index 0000000..9460523 --- /dev/null +++ b/charts/mailproxy/v0.1.0/templates/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mailproxy.fullname" . }} + labels: + {{- include "mailproxy.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + {{- range $i, $port := .Values.service.ports }} + - port: {{ $port.number }} + targetPort: {{ $port.number }} + protocol: {{ $port.protocol }} + name: {{ $port.name }} + {{- end }} + selector: + {{- include "mailproxy.selectorLabels" . | nindent 4 }} diff --git a/charts/mailproxy/v0.1.0/values.yaml b/charts/mailproxy/v0.1.0/values.yaml new file mode 100644 index 0000000..4529451 --- /dev/null +++ b/charts/mailproxy/v0.1.0/values.yaml @@ -0,0 +1,64 @@ +# Default values for mailproxy. + +replicaCount: 2 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + ports: + - name: imaps + number: 993 + protocol: TCP + - name: pops + number: 995 + protocol: TCP + - name: smtp + number: 587 + protocol: TCP + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {}