Skip to content

Commit

Permalink
New package for helpdesk.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenroug committed Feb 5, 2024
1 parent 8ed1ffa commit 5510135
Show file tree
Hide file tree
Showing 27 changed files with 1,068 additions and 157 deletions.
Binary file added docs/helpdesk-otrs-0.1.0.tgz
Binary file not shown.
332 changes: 175 additions & 157 deletions docs/index.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions sources/helpdesk-otrs/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.helmignore
docker-compose.yml
rancher-compose.yml
6 changes: 6 additions & 0 deletions sources/helpdesk-otrs/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: postfix
repository: https://eea.github.io/helm-charts
version: 0.2.1
digest: sha256:46f57619951b742cfc9a3b7624a120770a309d00c85d93a63641ad546ee39e4c
generated: "2024-02-02T14:23:59.174573121+01:00"
26 changes: 26 additions & 0 deletions sources/helpdesk-otrs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v2
name: helpdesk-otrs
description: Eionet helpdesk
icon: https://raw.githubusercontent.com/eea/helm-charts/main/sources/helpdesk-otrs/logo_eionet.png

type: application

keywords:
- Tickets

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# Version for the main container
appVersion: "v6.0.43-openid-05"

# Remember to do helm dep up .
dependencies:
- name: postfix
version: 0.2.1
repository: https://eea.github.io/helm-charts
# - name: mariadb
# version: 13.1.3
# repository: https://charts.bitnami.com/bitnami
13 changes: 13 additions & 0 deletions sources/helpdesk-otrs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Eionet Helpdesk

This chart is (almost) configured for production.

# Releases

<dl>

<dt>Version 0.1.0</dt>
<dd>Initial version.</dd>

</dl>

Binary file added sources/helpdesk-otrs/charts/postfix-0.2.1.tgz
Binary file not shown.
Binary file added sources/helpdesk-otrs/logo_eionet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions sources/helpdesk-otrs/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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 "appl.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 "appl.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "appl.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 "appl.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 changes: 62 additions & 0 deletions sources/helpdesk-otrs/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "appl.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 "appl.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 "appl.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "appl.labels" -}}
helm.sh/chart: {{ include "appl.chart" . }}
{{ include "appl.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "appl.selectorLabels" -}}
app.kubernetes.io/name: {{ include "appl.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "appl.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "appl.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
17 changes: 17 additions & 0 deletions sources/helpdesk-otrs/templates/article-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: helpdesk-eionet-article
labels:
{{- include "appl.labels" . | nindent 4 }}
component: helpdesk-eionet-article
annotations:
"helm.sh/resource-policy": keep

spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 200Gi

16 changes: 16 additions & 0 deletions sources/helpdesk-otrs/templates/backups-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: helpdesk-eionet-backups
labels:
{{- include "appl.labels" . | nindent 4 }}
component: helpdesk-eionet-backups
annotations:
"helm.sh/resource-policy": keep

spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Mi
16 changes: 16 additions & 0 deletions sources/helpdesk-otrs/templates/css-cache-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: helpdesk-eionet-css-cache
labels:
{{- include "appl.labels" . | nindent 4 }}
component: helpdesk-eionet-css-cache
annotations:
"helm.sh/resource-policy": keep

spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Mi
18 changes: 18 additions & 0 deletions sources/helpdesk-otrs/templates/database-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: mariadb
labels:
{{- include "appl.labels" . | nindent 4 }}
component: database

spec:
type: ClusterIP
ports:
- port: 3306
targetPort: 3306
protocol: TCP
selector:
{{- include "appl.selectorLabels" . | nindent 4 }}
component: database

103 changes: 103 additions & 0 deletions sources/helpdesk-otrs/templates/database-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-db
labels:
{{- include "appl.labels" . | nindent 4 }}
component: database

spec:
replicas: 1
serviceName: mariadb
selector:
matchLabels:
{{- include "appl.selectorLabels" . | nindent 6 }}
component: database
template:
metadata:
labels:
{{- include "appl.selectorLabels" . | nindent 8 }}
component: database
spec:
terminationGracePeriodSeconds: 10
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "appl.serviceAccountName" . }}

containers:
- name: mariadb
image: mariadb:5.5.58
ports:
- containerPort: 3306
protocol: TCP
args:
- mysqld
- --user=mysql
- --default_storage_engine=InnoDB
- --character-set-server=utf8
- --collation-server=utf8_general_ci
- --init-connect=SET NAMES utf8
- --innodb_log_file_size=256M
- --innodb_buffer_pool_size=3GB
- --max_allowed_packet=100M
- --bulk_insert_buffer_size=64M
- --query_cache_size=64M
- --skip-character-set-client-handshake
- --skip-host-cache
- --wait_timeout=600
env:
- name: MYSQL_DATABASE
value: "{{ .Values.database.database }}"
- name: MYSQL_PASSWORD
value: "{{ .Values.database.password }}"
- name: MYSQL_ROOT_PASSWORD
value: "{{ .Values.database.rootpw }}"
- name: MYSQL_USER
value: "{{ .Values.database.username }}"
- name: TZ
value: Europe/Copenhagen

resources:
{{- toYaml .Values.database.resources | nindent 10 }}

securityContext:
{{- toYaml .Values.database.securityContext | nindent 10 }}
volumeMounts:
- mountPath: /var/lib/mysql
name: {{ .Release.Name }}-database

livenessProbe:
tcpSocket:
port: 3306
initialDelaySeconds: 15
periodSeconds: 20

resources:
{{- toYaml .Values.database.resources | nindent 10 }}

restartPolicy: Always

{{- with .Values.database.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.database.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.database.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

volumeClaimTemplates:
- metadata:
name: {{ .Release.Name }}-database
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 30Gi
28 changes: 28 additions & 0 deletions sources/helpdesk-otrs/templates/denymysql-netsecpol.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ .Release.Name }}-database-egress
labels:
{{- include "appl.labels" . | nindent 4 }}

spec:
podSelector:
matchLabels:
{{- include "appl.selectorLabels" . | nindent 6 }}
component: database

policyTypes:
- Egress
- Ingress

egress: []

ingress:
- from:
- podSelector:
matchLabels:
{{- include "appl.selectorLabels" . | nindent 10 }}
ports:
- protocol: TCP
port: 3306

Loading

0 comments on commit 5510135

Please sign in to comment.