mirror of
https://github.com/thomiceli/opengist.git
synced 2025-01-09 10:02:39 +00:00
Add helm chart
This commit is contained in:
parent
f881e1c13c
commit
c19588e36a
22 changed files with 747 additions and 2 deletions
23
deploy/helm/.helmignore
Normal file
23
deploy/helm/.helmignore
Normal 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/
|
9
deploy/helm/Chart.yaml
Normal file
9
deploy/helm/Chart.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
apiVersion: v2
|
||||||
|
name: opengist
|
||||||
|
description: Opengist chart for Kubernetes
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
|
appVersion: "1.7.3"
|
||||||
|
maintainers:
|
||||||
|
- name: thomiceli
|
||||||
|
url: https://github.com/thomiceli
|
81
deploy/helm/README.md
Normal file
81
deploy/helm/README.md
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
# opengist
|
||||||
|
|
||||||
|
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=default) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=default) ![AppVersion: 1.7.3](https://img.shields.io/badge/AppVersion-1.7.3-informational?style=default)
|
||||||
|
|
||||||
|
Opengist chart for Kubernetes
|
||||||
|
|
||||||
|
## Maintainers
|
||||||
|
|
||||||
|
| Name | Url |
|
||||||
|
| ---- | --- |
|
||||||
|
| thomiceli | <https://github.com/thomiceli> |
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Key | Type | Default |
|
||||||
|
|-----|------|---------|
|
||||||
|
| affinity | object | `{}` |
|
||||||
|
| autoscaling.enabled | bool | `false` |
|
||||||
|
| autoscaling.maxReplicas | int | `100` |
|
||||||
|
| autoscaling.minReplicas | int | `1` |
|
||||||
|
| autoscaling.targetCPUUtilizationPercentage | int | `80` |
|
||||||
|
| autoscaling.targetMemoryUtilizationPercentage | int | `80` |
|
||||||
|
| certManager.enabled | bool | `false` |
|
||||||
|
| certManager.issuer | string | `"letsencrypt-prod"` |
|
||||||
|
| config | object | `{}` |
|
||||||
|
| configSecret | object | `{}` |
|
||||||
|
| env | list | `[]` |
|
||||||
|
| extraVolumeMounts | list | `[]` |
|
||||||
|
| image.pullPolicy | string | `"IfNotPresent"` |
|
||||||
|
| image.repository | string | `"ghcr.io/thomiceli/opengist"` |
|
||||||
|
| image.tag | string | `""` |
|
||||||
|
| imagePullSecrets | list | `[]` |
|
||||||
|
| ingress.annotations | object | `{}` |
|
||||||
|
| ingress.className | string | `""` |
|
||||||
|
| ingress.enabled | bool | `false` |
|
||||||
|
| ingress.hosts[0].host | string | `"demo.opengist.io"` |
|
||||||
|
| ingress.hosts[0].paths[0].path | string | `"/"` |
|
||||||
|
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` |
|
||||||
|
| ingress.tls | list | `[]` |
|
||||||
|
| livenessProbe.enabled | bool | `true` |
|
||||||
|
| livenessProbe.failureThreshold | int | `10` |
|
||||||
|
| livenessProbe.initialDelaySeconds | int | `300` |
|
||||||
|
| livenessProbe.periodSeconds | int | `30` |
|
||||||
|
| livenessProbe.successThreshold | int | `1` |
|
||||||
|
| livenessProbe.timeoutSeconds | int | `3` |
|
||||||
|
| nodeSelector | object | `{}` |
|
||||||
|
| persistence.accessMode | string | `"ReadWriteOnce"` |
|
||||||
|
| persistence.enabled | bool | `true` |
|
||||||
|
| persistence.filestore_dir | string | `"/opengist"` |
|
||||||
|
| persistence.size | string | `"10Gi"` |
|
||||||
|
| podAnnotations | object | `{}` |
|
||||||
|
| podLabels | object | `{}` |
|
||||||
|
| podSecurityContext | object | `{}` |
|
||||||
|
| readinessProbe.enabled | bool | `true` |
|
||||||
|
| readinessProbe.failureThreshold | int | `2` |
|
||||||
|
| readinessProbe.initialDelaySeconds | int | `60` |
|
||||||
|
| readinessProbe.periodSeconds | int | `30` |
|
||||||
|
| readinessProbe.successThreshold | int | `1` |
|
||||||
|
| readinessProbe.timeoutSeconds | int | `3` |
|
||||||
|
| replicaCount | int | `1` |
|
||||||
|
| resources | object | `{}` |
|
||||||
|
| securityContext | object | `{}` |
|
||||||
|
| serviceAccount.annotations | object | `{}` |
|
||||||
|
| serviceAccount.automount | bool | `true` |
|
||||||
|
| serviceAccount.create | bool | `true` |
|
||||||
|
| serviceAccount.name | string | `""` |
|
||||||
|
| serviceHttp.annotations | object | `{}` |
|
||||||
|
| serviceHttp.port | int | `6157` |
|
||||||
|
| serviceHttp.type | string | `"ClusterIP"` |
|
||||||
|
| serviceSsh.annotations."metallb.universe.tf/allow-shared-ip" | string | `"opengist"` |
|
||||||
|
| serviceSsh.enabled | bool | `true` |
|
||||||
|
| serviceSsh.port | int | `2222` |
|
||||||
|
| serviceSsh.type | string | `"LoadBalancer"` |
|
||||||
|
| strategy.rollingUpdate.maxSurge | string | `"100%"` |
|
||||||
|
| strategy.rollingUpdate.maxUnavailable | int | `0` |
|
||||||
|
| strategy.type | string | `"RollingUpdate"` |
|
||||||
|
| tolerations | list | `[]` |
|
||||||
|
| volumes | list | `[]` |
|
||||||
|
|
||||||
|
----------------------------------------------
|
||||||
|
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
|
22
deploy/helm/templates/NOTES.txt
Normal file
22
deploy/helm/templates/NOTES.txt
Normal 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.serviceHttp.type }}
|
||||||
|
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "opengist.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.serviceHttp.type }}
|
||||||
|
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||||
|
You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "opengist.fullname" . }}'
|
||||||
|
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "opengist.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||||
|
echo http://$SERVICE_IP:{{ .Values.serviceHttp.port }}
|
||||||
|
{{- else if contains "ClusterIP" .Values.serviceHttp.type }}
|
||||||
|
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "opengist.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 }}
|
73
deploy/helm/templates/_helpers.tpl
Normal file
73
deploy/helm/templates/_helpers.tpl
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "opengist.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 "opengist.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 "opengist.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Common labels
|
||||||
|
*/}}
|
||||||
|
{{- define "opengist.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "opengist.chart" . }}
|
||||||
|
{{ include "opengist.selectorLabels" . }}
|
||||||
|
{{- if .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Selector labels
|
||||||
|
*/}}
|
||||||
|
{{- define "opengist.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "opengist.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the name of the service account to use
|
||||||
|
*/}}
|
||||||
|
{{- define "opengist.serviceAccountName" -}}
|
||||||
|
{{- if .Values.serviceAccount.create }}
|
||||||
|
{{- default (include "opengist.fullname" .) .Values.serviceAccount.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- default "default" .Values.serviceAccount.name }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create image URI
|
||||||
|
*/}}
|
||||||
|
{{- define "opengist.image" -}}
|
||||||
|
{{- if .Values.image.digest -}}
|
||||||
|
{{- printf "%s@%s" .Values.image.repository .Values.image.digest -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s:%s" .Values.image.repository (.Values.image.tag | default .Chart.AppVersion) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
43
deploy/helm/templates/configmap.yaml
Normal file
43
deploy/helm/templates/configmap.yaml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "opengist.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
{{ include "opengist.labels" . | indent 4 }}
|
||||||
|
data:
|
||||||
|
config.yml: |-
|
||||||
|
{{ tpl (.Values.config | toYaml) . | indent 4 }}
|
||||||
|
replace_secrets.sh: |
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
config_file="/tmp/config/config.yml"
|
||||||
|
output_file="/config/config.yml"
|
||||||
|
|
||||||
|
echo "Starting secret processing"
|
||||||
|
|
||||||
|
# Copy the original config to the output location
|
||||||
|
cp "$config_file" "$output_file"
|
||||||
|
|
||||||
|
# Process each secret file
|
||||||
|
for secret_file in /tmp/secrets/*; do
|
||||||
|
if [ -f "$secret_file" ]; then
|
||||||
|
key=$(basename "$secret_file")
|
||||||
|
value=$(cat "$secret_file")
|
||||||
|
echo "Processing secret: $key"
|
||||||
|
|
||||||
|
if [ -s "$output_file" ] && [ "$(cat "$output_file")" != "null" ]; then
|
||||||
|
awk -v key="$key" -v value="$value" '
|
||||||
|
$0 ~ "^"key":" { found=1; print key": "value; next }
|
||||||
|
{ print }
|
||||||
|
END { if (!found) print key": "value }
|
||||||
|
' "$output_file" > "${output_file}.tmp" && mv "${output_file}.tmp" "$output_file"
|
||||||
|
else
|
||||||
|
echo "$key: $value" > "$output_file"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# Ensure the main container can read the config file
|
||||||
|
chmod 644 "$output_file"
|
||||||
|
echo "Permissions set on $output_file"
|
135
deploy/helm/templates/deployment.yaml
Normal file
135
deploy/helm/templates/deployment.yaml
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ include "opengist.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "opengist.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
{{- if not .Values.autoscaling.enabled }}
|
||||||
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
{{- end }}
|
||||||
|
strategy:
|
||||||
|
type: {{ .Values.strategy.type }}
|
||||||
|
{{- if eq .Values.strategy.type "RollingUpdate" }}
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: {{ .Values.strategy.rollingUpdate.maxSurge }}
|
||||||
|
maxUnavailable: {{ .Values.strategy.rollingUpdate.maxUnavailable }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "opengist.selectorLabels" . | nindent 6 }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||||
|
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
||||||
|
{{- if .Values.podAnnotations }}
|
||||||
|
{{- toYaml .Values.podAnnotations | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
labels:
|
||||||
|
{{- include "opengist.labels" . | nindent 8 }}
|
||||||
|
{{- with .Values.podLabels }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
initContainers:
|
||||||
|
- name: init-config
|
||||||
|
image: busybox
|
||||||
|
command: [ "/bin/sh", "/scripts/replace_secrets.sh" ]
|
||||||
|
volumeMounts:
|
||||||
|
- name: config-template
|
||||||
|
mountPath: /tmp/config
|
||||||
|
- name: secret-config
|
||||||
|
mountPath: /tmp/secrets
|
||||||
|
readOnly: true
|
||||||
|
- name: scripts
|
||||||
|
mountPath: /scripts
|
||||||
|
- name: config
|
||||||
|
mountPath: /config
|
||||||
|
{{- with .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
serviceAccountName: {{ include "opengist.serviceAccountName" . }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||||
|
containers:
|
||||||
|
- name: {{ .Chart.Name }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
|
image: {{ include "opengist.image" $ }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: {{ .Values.serviceHttp.port }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- if .Values.livenessProbe.enabled }}
|
||||||
|
livenessProbe:
|
||||||
|
{{- toYaml (omit .Values.livenessProbe "enabled") | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
port: http
|
||||||
|
path: /healthcheck
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readinessProbe.enabled }}
|
||||||
|
readinessProbe:
|
||||||
|
{{- toYaml (omit .Values.readinessProbe "enabled") | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
port: http
|
||||||
|
path: /healthcheck
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ include "opengist.fullname" . }}
|
||||||
|
{{ with .Values.env }}
|
||||||
|
env:
|
||||||
|
{{- toYaml . | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: opengist-data
|
||||||
|
mountPath: {{ .Values.persistence.filestore_dir }}
|
||||||
|
- name: config
|
||||||
|
mountPath: /config.yml
|
||||||
|
subPath: config.yml
|
||||||
|
{{- if .Values.extraVolumeMounts }}
|
||||||
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
- name: opengist-data
|
||||||
|
{{- if .Values.persistence.enabled }}
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ .Values.persistence.existingClaim | default ( include "opengist.fullname" . ) }}
|
||||||
|
{{- else }}
|
||||||
|
emptyDir: {}
|
||||||
|
{{- end }}
|
||||||
|
- name: config
|
||||||
|
emptyDir: {}
|
||||||
|
- name: config-template
|
||||||
|
configMap:
|
||||||
|
name: {{ include "opengist.fullname" . }}
|
||||||
|
- name: secret-config
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "opengist.fullname" . }}-secret
|
||||||
|
- name: scripts
|
||||||
|
configMap:
|
||||||
|
name: {{ include "opengist.fullname" . }}
|
||||||
|
items:
|
||||||
|
- key: replace_secrets.sh
|
||||||
|
path: replace_secrets.sh
|
||||||
|
mode: 0755
|
||||||
|
{{- if .Values.volumes }}
|
||||||
|
{{- toYaml .Values.volumes | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.nodeSelector }}
|
||||||
|
nodeSelector:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
32
deploy/helm/templates/hpa.yaml
Normal file
32
deploy/helm/templates/hpa.yaml
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{{- if .Values.autoscaling.enabled }}
|
||||||
|
apiVersion: autoscaling/v2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: {{ include "opengist.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "opengist.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: {{ include "opengist.fullname" . }}
|
||||||
|
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
||||||
|
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||||
|
metrics:
|
||||||
|
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: cpu
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: memory
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
72
deploy/helm/templates/ingress.yaml
Normal file
72
deploy/helm/templates/ingress.yaml
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
{{- if .Values.ingress.enabled -}}
|
||||||
|
{{- $fullName := include "opengist.fullname" . -}}
|
||||||
|
{{- $svcPort := .Values.serviceHttp.port -}}
|
||||||
|
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||||
|
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
||||||
|
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||||
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
{{- else -}}
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
{{- end }}
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: {{ $fullName }}
|
||||||
|
labels:
|
||||||
|
{{- include "opengist.labels" . | nindent 4 }}
|
||||||
|
annotations:
|
||||||
|
{{- with .Values.ingress.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.certManager.enabled }}
|
||||||
|
cert-manager.io/issuer: {{ .Values.certManager.issuer | quote }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
||||||
|
ingressClassName: {{ .Values.ingress.className }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.ingress.tls .Values.certManager.enabled }}
|
||||||
|
tls:
|
||||||
|
{{- if .Values.certManager.enabled }}
|
||||||
|
- hosts:
|
||||||
|
{{- range .Values.ingress.hosts }}
|
||||||
|
- {{ .host | quote }}
|
||||||
|
{{- end }}
|
||||||
|
secretName: {{ $fullName }}-tls
|
||||||
|
{{- else }}
|
||||||
|
{{- range .Values.ingress.tls }}
|
||||||
|
- hosts:
|
||||||
|
{{- range .hosts }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
secretName: {{ .secretName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
{{- range .Values.ingress.hosts }}
|
||||||
|
- host: {{ .host | quote }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
{{- range .paths }}
|
||||||
|
- path: {{ .path }}
|
||||||
|
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
|
||||||
|
pathType: {{ .pathType }}
|
||||||
|
{{- end }}
|
||||||
|
backend:
|
||||||
|
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||||
|
service:
|
||||||
|
name: {{ $fullName }}-http
|
||||||
|
port:
|
||||||
|
number: {{ $svcPort }}
|
||||||
|
{{- else }}
|
||||||
|
serviceName: {{ $fullName }}-http
|
||||||
|
servicePort: {{ $svcPort }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
22
deploy/helm/templates/pvc.yaml
Normal file
22
deploy/helm/templates/pvc.yaml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{{- if and .Values.persistence.enabled ( not .Values.persistence.existingClaim ) }}
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: {{ include "opengist.fullname" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
{{ include "opengist.labels" . | indent 4 }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- {{ .Values.persistence.accessMode | quote }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.size | quote }}
|
||||||
|
{{- if .Values.persistence.storageClass }}
|
||||||
|
{{- if (eq "-" .Values.persistence.storageClass) }}
|
||||||
|
storageClassName: ""
|
||||||
|
{{- else }}
|
||||||
|
storageClassName: "{{ .Values.persistence.storageClass }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
12
deploy/helm/templates/secret.yaml
Normal file
12
deploy/helm/templates/secret.yaml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "opengist.fullname" . }}-secret
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
{{ include "opengist.labels" . | indent 4 }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
{{- range $key, $value := .Values.configSecret }}
|
||||||
|
{{ $key }}: {{ $value | b64enc | quote }}
|
||||||
|
{{- end }}
|
20
deploy/helm/templates/service-http.yaml
Normal file
20
deploy/helm/templates/service-http.yaml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "opengist.fullname" . }}-http
|
||||||
|
labels:
|
||||||
|
{{- include "opengist.labels" . | nindent 4 }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml .Values.serviceHttp.annotations | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.serviceHttp.type }}
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.serviceHttp.port }}
|
||||||
|
targetPort: http
|
||||||
|
protocol: TCP
|
||||||
|
name: http
|
||||||
|
{{- if .Values.serviceHttp.nodePort }}
|
||||||
|
nodePort: {{ .Values.serviceHttp.nodePort }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
{{- include "opengist.selectorLabels" . | nindent 4 }}
|
22
deploy/helm/templates/service-ssh.yaml
Normal file
22
deploy/helm/templates/service-ssh.yaml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{{- if .Values.serviceSsh.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "opengist.fullname" . }}-ssh
|
||||||
|
labels:
|
||||||
|
{{- include "opengist.labels" . | nindent 4 }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml .Values.serviceSsh.annotations | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.serviceSsh.type }}
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.serviceSsh.port }}
|
||||||
|
targetPort: {{ .Values.serviceSsh.port }}
|
||||||
|
protocol: TCP
|
||||||
|
name: ssh
|
||||||
|
{{- if .Values.serviceSsh.nodePort }}
|
||||||
|
nodePort: {{ .Values.serviceSsh.nodePort }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
{{- include "opengist.selectorLabels" . | nindent 4 }}
|
||||||
|
{{- end }}
|
13
deploy/helm/templates/serviceaccount.yaml
Normal file
13
deploy/helm/templates/serviceaccount.yaml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{{- if .Values.serviceAccount.create -}}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: {{ include "opengist.serviceAccountName" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "opengist.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.serviceAccount.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
|
||||||
|
{{- end }}
|
15
deploy/helm/templates/tests/test-connection.yaml
Normal file
15
deploy/helm/templates/tests/test-connection.yaml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: "{{ include "opengist.fullname" . }}-test-connection"
|
||||||
|
labels:
|
||||||
|
{{- include "opengist.labels" . | nindent 4 }}
|
||||||
|
annotations:
|
||||||
|
"helm.sh/hook": test
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: wget
|
||||||
|
image: busybox
|
||||||
|
command: ['wget']
|
||||||
|
args: ['{{ include "opengist.fullname" . }}:{{ .Values.serviceHttp.port }}']
|
||||||
|
restartPolicy: Never
|
151
deploy/helm/values.yaml
Normal file
151
deploy/helm/values.yaml
Normal file
|
@ -0,0 +1,151 @@
|
||||||
|
# Default values for opengist.
|
||||||
|
# This is a YAML-formatted file.
|
||||||
|
# Declare variables to be passed into your templates.
|
||||||
|
|
||||||
|
image:
|
||||||
|
repository: ghcr.io/thomiceli/opengist
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
tag: ""
|
||||||
|
|
||||||
|
## - YAML config of Opengist https://github.com/thomiceli/opengist/blob/master/docs/configuration/cheat-sheet.md - ##
|
||||||
|
# Uses a ConfigMap for non-sensitive configuration
|
||||||
|
config: {}
|
||||||
|
# log-output: stdout
|
||||||
|
|
||||||
|
# Uses a Secret for sensitive configuration
|
||||||
|
configSecret: {}
|
||||||
|
# gitea.client-key:
|
||||||
|
# gitea.secret:
|
||||||
|
|
||||||
|
env: []
|
||||||
|
# - name: KEY
|
||||||
|
# value: VALUE
|
||||||
|
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: 100%
|
||||||
|
maxUnavailable: 0
|
||||||
|
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
serviceHttp:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 6157
|
||||||
|
# nodePort:
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
serviceSsh:
|
||||||
|
enabled: true # enable ssh service
|
||||||
|
type: LoadBalancer
|
||||||
|
port: 2222
|
||||||
|
# nodePort:
|
||||||
|
annotations:
|
||||||
|
metallb.universe.tf/allow-shared-ip: "opengist" # allow shared ip for ssh service
|
||||||
|
|
||||||
|
livenessProbe:
|
||||||
|
enabled: true
|
||||||
|
initialDelaySeconds: 300
|
||||||
|
timeoutSeconds: 3
|
||||||
|
periodSeconds: 30
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 10
|
||||||
|
|
||||||
|
readinessProbe:
|
||||||
|
enabled: true
|
||||||
|
initialDelaySeconds: 60
|
||||||
|
timeoutSeconds: 3
|
||||||
|
periodSeconds: 30
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 2
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
className: ""
|
||||||
|
annotations: {}
|
||||||
|
# kubernetes.io/ingress.class: nginx
|
||||||
|
# kubernetes.io/tls-acme: "true"
|
||||||
|
hosts:
|
||||||
|
- host: demo.opengist.io
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: ImplementationSpecific
|
||||||
|
tls: [] # leave as it is if cert-manager is enabled
|
||||||
|
# - secretName: web-ssl
|
||||||
|
# hosts:
|
||||||
|
# - demo.opengist.io
|
||||||
|
|
||||||
|
certManager:
|
||||||
|
enabled: false
|
||||||
|
issuer: "letsencrypt-prod"
|
||||||
|
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
# existingClaim:
|
||||||
|
# storageClass:
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 10Gi
|
||||||
|
filestore_dir: /opengist
|
||||||
|
|
||||||
|
autoscaling:
|
||||||
|
enabled: false
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 100
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
targetMemoryUtilizationPercentage: 80
|
||||||
|
|
||||||
|
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: {}
|
||||||
|
|
||||||
|
serviceAccount:
|
||||||
|
create: true
|
||||||
|
automount: true
|
||||||
|
annotations: {}
|
||||||
|
name: ""
|
||||||
|
|
||||||
|
podAnnotations: {}
|
||||||
|
|
||||||
|
podLabels: {}
|
||||||
|
|
||||||
|
podSecurityContext: {}
|
||||||
|
# fsGroup: 2000
|
||||||
|
|
||||||
|
securityContext: {}
|
||||||
|
# capabilities:
|
||||||
|
# drop:
|
||||||
|
# - ALL
|
||||||
|
# readOnlyRootFilesystem: true
|
||||||
|
# runAsNonRoot: true
|
||||||
|
# runAsUser: 1000
|
||||||
|
|
||||||
|
# Additional volumes on the output Deployment definition.
|
||||||
|
volumes: []
|
||||||
|
# - name: foo
|
||||||
|
# secret:
|
||||||
|
# secretName: mysecret
|
||||||
|
# optional: false
|
||||||
|
|
||||||
|
# Additional volumeMounts on the output Deployment definition.
|
||||||
|
extraVolumeMounts: []
|
||||||
|
# - name: foo
|
||||||
|
# mountPath: "/etc/foo"
|
||||||
|
# readOnly: true
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ metadata:
|
||||||
name: opengist
|
name: opengist
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- https://github.com/thomiceli/opengist/deploy/
|
- https://github.com/thomiceli/opengist/deploy/kustomize
|
||||||
```
|
```
|
||||||
|
|
||||||
## Full example
|
## Full example
|
||||||
|
@ -28,7 +28,7 @@ namespace: opengist
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
- https://github.com/thomiceli/opengist/deploy/?ref:v1.7.3
|
- https://github.com/thomiceli/opengist/deploy/kustomize?ref:v1.7.3
|
||||||
|
|
||||||
images:
|
images:
|
||||||
- name: ghcr.io/thomiceli/opengist
|
- name: ghcr.io/thomiceli/opengist
|
Loading…
Reference in a new issue