Browse Source

Adiciona o chart Helm para OSTicket v0.3.0

master
Vitor Choi 3 weeks ago
parent
commit
cbf780ef79
  1. 22
      charts/osticket/v0.3.0/.helmignore
  2. 9
      charts/osticket/v0.3.0/Chart.lock
  3. 16
      charts/osticket/v0.3.0/Chart.yaml
  4. 24
      charts/osticket/v0.3.0/README.md
  5. BIN
      charts/osticket/v0.3.0/charts/mariadb-10.4.4.tgz
  6. BIN
      charts/osticket/v0.3.0/charts/memcached-6.0.10.tgz
  7. 45
      charts/osticket/v0.3.0/templates/_helpers.tpl
  8. 91
      charts/osticket/v0.3.0/templates/deployment.yaml
  9. 38
      charts/osticket/v0.3.0/templates/ingress.yaml
  10. 16
      charts/osticket/v0.3.0/templates/service.yaml
  11. 15
      charts/osticket/v0.3.0/templates/tests/test-connection.yaml
  12. 39
      charts/osticket/v0.3.0/templates/velero-schedule-weekdays.yaml
  13. 103
      charts/osticket/v0.3.0/values.yaml

22
charts/osticket/v0.3.0/.helmignore

@ -0,0 +1,22 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

9
charts/osticket/v0.3.0/Chart.lock

@ -0,0 +1,9 @@
dependencies:
- name: mariadb
repository: https://charts.bitnami.com/bitnami
version: 10.4.4
- name: memcached
repository: https://charts.bitnami.com/bitnami
version: 6.0.10
digest: sha256:82bd28a75702fa0313d8aedd8686527365365c914f2a5776e722da436e45135c
generated: "2022-04-01T11:42:33.634085-03:00"

16
charts/osticket/v0.3.0/Chart.yaml

@ -0,0 +1,16 @@
apiVersion: v2
appVersion: "1.18.4"
description: OSTicket Open Source Ticket System
name: osticket
icon: https://osticket.com/wp-content/uploads/2021/03/osticket-supsys-new-1-e1616621912452.png
version: 0.3.0
dependencies:
- name: mariadb
version: 10.4.4
repository: https://charts.bitnami.com/bitnami
condition: mariadb.internal
- name: memcached
version: 6.0.10
repository: https://charts.bitnami.com/bitnami
condition: memcached.internal

24
charts/osticket/v0.3.0/README.md

@ -0,0 +1,24 @@
# OSTicket support ticket system Helm chart
This is a Helm chart to install OSTicket with MySQL as database and memcached as session storage.
Requirements:
- Default persistent storage class (StorageClass)
- Ingress Controller (ex: nginx)
## Parameters and default values
| Parametro | Description | Default |
|---------------------------|--------------------------------------------|--------------------------|
| image.repository | Repository of docker image | `interlegis/osticket` |
| image.tag | Docker image version | `1.14.1` |
| image.pullPolicy | Docker image Pull Policy | `IfNotPresent` |
| replicaCount | Number of OSTicket replicas | `1` |
| persistence.enabled | Enable persistent volumes | `true` |
| persistence.storageClass | Persistent volume storage class | `` |
| persistence.accessMode | Persistent volume acces mode | `ReadWriteOnce` |
| persistence.size | Persistent volume size | `10Gi ` |
| installSecret | OSTicket install secret | `` |
| mariadb.auth.database | OSTicket database name | `osticket` |
| mariadb.auth.username | OSTicket database user name | `osticket` |
| mariadb.auth.password | OSTicket database user password | `mysecretpw` |

BIN
charts/osticket/v0.3.0/charts/mariadb-10.4.4.tgz

Binary file not shown.

BIN
charts/osticket/v0.3.0/charts/memcached-6.0.10.tgz

Binary file not shown.

45
charts/osticket/v0.3.0/templates/_helpers.tpl

@ -0,0 +1,45 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "osticket.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 "osticket.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 "osticket.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "osticket.labels" -}}
app.kubernetes.io/name: {{ include "osticket.name" . }}
helm.sh/chart: {{ include "osticket.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

91
charts/osticket/v0.3.0/templates/deployment.yaml

@ -0,0 +1,91 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "osticket.fullname" . }}
labels:
{{ include "osticket.labels" . | indent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "osticket.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "osticket.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
- name: {{ .Chart.Name }}-install
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: INSTALL_SECRET
value: "{{ .Values.installSecret }}"
- name: MYSQL_HOST
value: "{{ include "osticket.name" . }}-mariadb"
- name: MYSQL_PASSWORD
value: "{{ .Values.mariadb.auth.password }}"
- name: USE_MEMCACHE
value: "true"
- name: MEMCACHE_NAME
value: "{{ include "osticket.name" . }}-memcached"
command:
- "php"
- "/data/bin/install.php"
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
env:
- name: INSTALL_SECRET
value: "{{ .Values.installSecret }}"
- name: MYSQL_HOST
value: "{{ include "osticket.name" . }}-mariadb"
- name: MYSQL_PASSWORD
value: "{{ .Values.mariadb.auth.password }}"
- name: USE_MEMCACHE
value: "true"
- name: MEMCACHE_NAME
value: "{{ include "osticket.name" . }}-memcached"
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
httpGet:
path: /
port: http
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 2
timeoutSeconds: 1
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 }}

38
charts/osticket/v0.3.0/templates/ingress.yaml

@ -0,0 +1,38 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "osticket.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{ include "osticket.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
name: http
{{- end }}
{{- end }}

16
charts/osticket/v0.3.0/templates/service.yaml

@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "osticket.fullname" . }}
labels:
{{ include "osticket.labels" . | indent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "osticket.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}

15
charts/osticket/v0.3.0/templates/tests/test-connection.yaml

@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "osticket.fullname" . }}-test-connection"
labels:
{{ include "osticket.labels" . | indent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "osticket.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never

39
charts/osticket/v0.3.0/templates/velero-schedule-weekdays.yaml

@ -0,0 +1,39 @@
{{- if .Values.velero.backup.enabled }}
apiVersion: velero.io/v1
kind: Schedule
metadata:
name: {{ include "osticket.fullname" . }}-weekdays
namespace: {{ .Values.velero.namespace }}
spec:
# generate a random backup time between 1 and 5 AM on weekdays
schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * 1-5
template:
includedNamespaces:
- {{ .Release.Namespace }}
{{- with .Values.velero.backup.excludedResources }}
excludedResources:
{{- toYaml . | nindent 8 }}
{{- end }}
snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }}
# every weekday backup is good for the next week (7 days)
ttl: 168h0m0s
defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }}
hooks:
resources:
- name: mysqldump
includedResources:
- pods
labelSelector:
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: mariadb
pre:
- exec:
command:
- "/bin/bash"
- "-c"
- "/opt/bitnami/mariadb/bin/mysqldump osticket -u osticket -p$MARIADB_PASSWORD > /bitnami/mariadb/osticket.dump"
timeout: 360s
onError: Continue
useOwnerReferencesInBackup: false
{{- end }}

103
charts/osticket/v0.3.0/values.yaml

@ -0,0 +1,103 @@
# Default values for osticket.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: porto.interlegis.leg.br/seit/osticket
tag: ""
pullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
installSecret: ""
persistence:
enabled: true
#storageClass: ""
accessMode: ReadWriteOnce
size: 10Gi
velero:
namespace: velero
backup:
enabled: true
snapshotVolumes: false
defaultVolumesToRestic: true
# cert-manager objects are usually blocked during backup
excludedResources:
- certificates.cert-manager.io
- orders.acme.cert-manager.io
- certificaterequests.cert-manager.io
- challenges.acme.cert-manager.io
service:
type: ClusterIP
port: 80
ingress:
enabled: true
path: "/"
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
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
mariadb:
internal: true
image:
tag: 10.5.13-debian-10-r58
architecture: standalone
auth:
database: osticket
username: osticket
password: mysecretpw
primary:
persistence:
enabled: true
accessModes:
- ReadWriteOnce
size: 50Gi
resources:
requests:
memory: 700Mi
cpu: 100m
service:
type: ClusterIP
memcached:
internal: true
image:
tag: 1.6.13-debian-10-r0
architecture: standalone
replicaCount: 1
pdb:
minAvailable: 1
nodeSelector: {}
tolerations: []
affinity: {}
Loading…
Cancel
Save