Publish the first chart version
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Nikolai Rodionov 2023-07-17 06:54:40 +02:00
parent e342bf83a6
commit 45319f60a6
Signed by: allanger
GPG Key ID: 19DB54039EBF8F10
10 changed files with 436 additions and 0 deletions

23
.drone.yml Normal file
View File

@ -0,0 +1,23 @@
---
# ----------------------------------------------
# -- Update the helm chart
# ----------------------------------------------
kind: pipeline
type: docker
name: Publish the helm chart
trigger:
event:
- push
steps:
- name: Publish the Helm chart
image: alpine/helm
environment:
GITEA_TOKEN:
from_secret: GITEA_TOKEN
commands:
- helm plugin install https://github.com/chartmuseum/helm-push
- helm package . -d chart-package
- helm repo add --username allanger --password $GITEA_TOKEN iredmail https://git.badhouseplants.net/api/packages/allanger/helm
- helm cm-push "./chart-package/$(ls chart-package)" iredmail

23
.helmignore Normal file
View File

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

20
Chart.yaml Normal file
View File

@ -0,0 +1,20 @@
---
apiVersion: v2
name: iredmail
maintainers:
- name: allanger
email: allanger@zohomail.com
url: https://badhouseplants.net
home: https://git.badhouseplants.net/allanger/helm-iredmail
sources:
- https://git.badhouseplants.net/allanger/helm-iredmail
- https://github.com/iredmail/iRedMail
- https://github.com/iredmail/dockerized
description: iRedMail is a full-featured mail server solution
type: application
version: 0.1.0
appVersion: 1.6.3
keywords:
- email

63
check.yamk Normal file
View File

@ -0,0 +1,63 @@
---
# Source: iredmail/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: iredmail
labels:
helm.sh/chart: iredmail-0.1.0
app.kubernetes.io/name: iredmail
app.kubernetes.io/instance: iredmail
app.kubernetes.io/version: "1.6.3"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: iredmail
app.kubernetes.io/instance: iredmail
template:
metadata:
labels:
app.kubernetes.io/name: iredmail
app.kubernetes.io/instance: iredmail
spec:
containers:
- name: iredmail
image: "registry.hub.docker.com/iredmail/mariadb:stable"
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 80
protocol: TCP
- name: https:
containerPort: 443
protocol: TCP
- name: pop3
containerPort: 110
protocol: TCP
- name: pop3s
containerPort: 995
protocol: TCP
- name: imap
containerPort: 143
protocol: TCP
- name: imaps
containerPort: 993
protocol: TCP
- name: smtp
containerPort: 25
protocol: TCP
- name: smtps
containerPort: 465
protocol: TCP
- name: smtp-modern
containerPort: 587
protocol: TCP
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

22
templates/NOTES.txt Normal file
View File

@ -0,0 +1,22 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "iredmail.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "iredmail.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "iredmail.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "iredmail.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}

62
templates/_helpers.tpl Normal file
View File

@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "iredmail.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 "iredmail.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 "iredmail.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "iredmail.labels" -}}
helm.sh/chart: {{ include "iredmail.chart" . }}
{{ include "iredmail.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "iredmail.selectorLabels" -}}
app.kubernetes.io/name: {{ include "iredmail.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "iredmail.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "iredmail.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

88
templates/deployment.yaml Normal file
View File

@ -0,0 +1,88 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "iredmail.fullname" . }}
labels:
{{- include "iredmail.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "iredmail.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "iredmail.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
- name: https
containerPort: 443
protocol: TCP
- name: pop3
containerPort: 110
protocol: TCP
- name: pop3s
containerPort: 995
protocol: TCP
- name: imap
containerPort: 143
protocol: TCP
- name: imaps
containerPort: 993
protocol: TCP
- name: smtp
containerPort: 25
protocol: TCP
- name: smtps
containerPort: 465
protocol: TCP
- name: smtp-modern
containerPort: 587
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: /var/vmail
name: data
- mountPath: /opt/iredmail/
name: data
- mountPath: /var/lib/mysql
name: data
- mountPath: /var/lib/clamav
name: data
- mountPath: /var/lib/spamassassin
name: data
- mountPath: /var/spool/postfix
name: data
volumes:
- name: data-iredmail
persistentVolumeClaim:
claimName: {{ include "iredmail.fullname" . }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

13
templates/pvc.yaml Normal file
View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "iredmail.fullname" . }}
labels:
{{- include "iredmail.labels" . | nindent 4 }}
spec:
storageClassName: {{ .Values.storageClassName }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi

47
templates/service.yaml Normal file
View File

@ -0,0 +1,47 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "iredmail.fullname" . }}
labels:
{{- include "iredmail.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- name: http
port: 80
targetPort: 80
protocol: TCP
- name: https
port: 443
targetPort: 443
protocol: TCP
- name: pop3
port: 110
targetPort: 110
protocol: TCP
- name: pop3s
port: 995
targetPort: 995
protocol: TCP
- name: imap
port: 143
targetPort: 143
protocol: TCP
- name: imaps
port: 993
targetPort: 993
protocol: TCP
- name: smtp
port: 25
targetPort: 25
protocol: TCP
- name: smtps
port: 465
targetPort: 465
protocol: TCP
- name: smtp-modern
port: 587
targetPort: 587
protocol: TCP
selector:
{{- include "iredmail.selectorLabels" . | nindent 4 }}

75
values.yaml Normal file
View File

@ -0,0 +1,75 @@
# Default values for ..
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: registry.hub.docker.com/iredmail/mariadb
pullPolicy: IfNotPresent
tag: stable
config:
env:
HOSTNAME: mail.mydomain.com
FIRST_MAIL_DOMAIN: mydomain.com >>
# FIRST_MAIL_DOMAIN_ADMIN_PASSWORD: my-secret-password
# MLMMJADMIN_API_TOKEN: $(openssl rand -base64 32)
# ROUNDCUBE_DES_KEY: $(openssl rand -base64 24)
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
service:
type: ClusterIP
port: 80
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
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
nodeSelector: {}
tolerations: []
affinity: {}