import helm chart

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
This commit is contained in:
2026-07-15 17:58:02 +02:00
parent 5572902aac
commit 2ae1f8e480
13 changed files with 596 additions and 0 deletions
+23
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/
+23
View File
@@ -0,0 +1,23 @@
apiVersion: v2
name: prosody
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# 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
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.11.6
+21
View File
@@ -0,0 +1,21 @@
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 }}{{ . }}
{{- 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 "vncdirectory.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 "vncdirectory.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "vncdirectory.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 "vncdirectory.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
{{- end }}
+62
View File
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "prosody.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 "prosody.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 "prosody.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "prosody.labels" -}}
helm.sh/chart: {{ include "prosody.chart" . }}
{{ include "prosody.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "prosody.selectorLabels" -}}
app.kubernetes.io/name: {{ include "prosody.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "prosody.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "prosody.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
+130
View File
@@ -0,0 +1,130 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "prosody.fullname" . }}
labels:
{{- include "prosody.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "prosody.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "prosody.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "prosody.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
- name: secret-volume
secret:
secretName: {{ .Values.tlsUpdates.secretName }}
optional: true
- name: etc-prosody
emptyDir:
sizeLimit: 50Mi
- name: etc-sidecar
emptyDir:
sizeLimit: 50Mi
- name: var-log-prosody
emptyDir:
sizeLimit: 1Gi
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:
- name: c2s
containerPort: 5222
protocol: TCP
- name: s2s
containerPort: 5269
protocol: TCP
- name: http
containerPort: 5280
protocol: TCP
- name: telnet
containerPort: 5582
protocol: TCP
volumeMounts:
- name: secret-volume
mountPath: "/etc/tls-update"
- name: etc-prosody
mountPath: /etc/prosody
- name: var-log-prosody
mountPath: /var/log/prosody
livenessProbe:
exec:
command:
- /vnc/config/healthcheck.sh
periodSeconds: 30
initialDelaySeconds: 5
timeoutSeconds: 20
failureThreshold: 4
readinessProbe:
tcpSocket:
port: 5582
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
{{- range $key, $value := $.Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: sidecar
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh"]
args: ["-c", "/vnc/config/startup-sidecar.sh"]
ports:
- name: web2
containerPort: 8080
protocol: TCP
volumeMounts:
- name: secret-volume
mountPath: "/etc/tls-update"
- name: etc-sidecar
mountPath: /etc/prosody/public
livenessProbe:
httpGet:
path: /
port: 8080
readinessProbe:
httpGet:
path: /
port: 8080
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
{{- range $key, $value := $.Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- 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 }}
@@ -0,0 +1,9 @@
apiVersion: networking.gke.io/v1beta1
kind: FrontendConfig
metadata:
name: {{ include "prosody.fullname" . }}
labels:
{{- include "prosody.labels" . | nindent 4 }}
spec:
redirectToHttps:
enabled: true
+32
View File
@@ -0,0 +1,32 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "prosody.fullname" . }}
labels:
{{- include "prosody.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "prosody.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- end }}
@@ -0,0 +1,43 @@
{{- if .Values.ingress_additional_host.enabled -}}
{{- $fullName := include "prosody.fullname" . -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
apiVersion: extensions/v1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}-additional
labels:
{{- include "prosody.labels" . | nindent 4 }}
{{- with .Values.ingress_additional_host.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress_additional_host.tls }}
tls:
{{- range .Values.ingress_additional_host.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress_additional_host.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
pathType: ImplementationSpecific
{{- end }}
backend:
service:
name: {{ .service.name }}
port:
number: {{ .service.port.number }}
{{- end }}
{{- end }}
+43
View File
@@ -0,0 +1,43 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "prosody.fullname" . -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
apiVersion: extensions/v1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "prosody.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
pathType: ImplementationSpecific
{{- end }}
backend:
service:
name: {{ .service.name }}
port:
number: {{ .service.port.number }}
{{- end }}
{{- end }}
+11
View File
@@ -0,0 +1,11 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "prosody.fullname" . }}-pdb
labels:
{{- include "prosody.labels" . | nindent 4 }}
spec:
maxUnavailable: {{ .Values.pdb.maxUnavailable | default "50%" }}
selector:
matchLabels:
{{- include "prosody.selectorLabels" . | nindent 6 }}
+89
View File
@@ -0,0 +1,89 @@
apiVersion: v1
kind: Service
metadata:
name: http
labels:
{{- include "prosody.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: NodePort
ports:
- port: 5280
targetPort: 5280
protocol: TCP
name: http
selector:
{{- include "prosody.selectorLabels" . | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: s2s
labels:
{{- include "prosody.labels" . | nindent 4 }}
{{- if .Values.service.annotationsenabled }}
{{- with .Values.service.s2s.annotations }}
annotations:
#beta.cloud.google.com/backend-config: '{"ports": {"8000":"prosody"}}'
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
spec:
type: LoadBalancer
ports:
- port: 5222
targetPort: 5222
protocol: TCP
name: c2s
- port: 5269
targetPort: 5269
protocol: TCP
name: s2s
selector:
{{- include "prosody.selectorLabels" . | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: telnet
labels:
{{- include "prosody.labels" . | nindent 4 }}
{{- if .Values.service.annotationsenabled }}
{{- with .Values.service.annotations }}
annotations:
#beta.cloud.google.com/backend-config: '{"ports": {"8000":"prosody"}}'
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
spec:
type: NodePort
ports:
- port: 5582
targetPort: 5582
protocol: TCP
name: telnet
selector:
{{- include "prosody.selectorLabels" . | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: web2
labels:
{{- include "prosody.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
protocol: TCP
name: web2
selector:
{{- include "prosody.selectorLabels" . | nindent 4 }}
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "prosody.serviceAccountName" . }}
labels:
{{- include "prosody.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
+98
View File
@@ -0,0 +1,98 @@
# Default values for owncloud.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: eu.gcr.io/vnc-development/vnctalk-prosody
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: release-13.0.6-vnc
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
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
tlsUpdates:
enabled: false
secretName: none
service:
type: NodePort
port:
number: 5280
annotations: {}
node:
name: prosody-internal
ingress:
enabled: true
annotations:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
tls:
- hosts:
- "xmpp.chart.example"
secretName: xmpp-tls
hosts:
- host: "xmpp.chart.example"
paths: ["/xmpp-websocket*"]
service:
name: xmpp-ws-ingress
port:
number: 5280
name: http
- host: "xmpp.chart.example"
paths: ["/*"]
service:
name: xmpp-plain-ingress
port:
number: 8080
name: http
ingress_additional_host:
enabled: false
resources:
requests:
cpu: 2000m
memory: 2048Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 90
pdb:
maxUnavailable: "50%"
nodeSelector: {}
tolerations: []
affinity: {}