From 37117c2f1c6b945b1f332523dd2082dddcff9c8c Mon Sep 17 00:00:00 2001 From: Andras Elso Date: Wed, 10 Apr 2024 23:03:48 +0200 Subject: [PATCH 1/2] Create helm chart --- helm-charts/.helmignore | 23 ++++ helm-charts/Chart.yaml | 7 + helm-charts/templates/NOTES.txt | 3 + helm-charts/templates/_helpers.tpl | 62 +++++++++ helm-charts/templates/hbbr-deployment.yaml | 90 +++++++++++++ helm-charts/templates/hbbr-secret.yaml | 20 +++ helm-charts/templates/hbbr-service.yaml | 46 +++++++ helm-charts/templates/hbbs-config.yaml | 18 +++ helm-charts/templates/hbbs-deployment.yaml | 111 ++++++++++++++++ helm-charts/templates/hbbs-pvc.yaml | 34 +++++ helm-charts/templates/hbbs-service.yaml | 54 ++++++++ helm-charts/templates/serviceaccount.yaml | 13 ++ .../templates/tests/test-connection.yaml | 15 +++ helm-charts/values.yaml | 125 ++++++++++++++++++ 14 files changed, 621 insertions(+) create mode 100644 helm-charts/.helmignore create mode 100644 helm-charts/Chart.yaml create mode 100644 helm-charts/templates/NOTES.txt create mode 100644 helm-charts/templates/_helpers.tpl create mode 100644 helm-charts/templates/hbbr-deployment.yaml create mode 100644 helm-charts/templates/hbbr-secret.yaml create mode 100644 helm-charts/templates/hbbr-service.yaml create mode 100644 helm-charts/templates/hbbs-config.yaml create mode 100644 helm-charts/templates/hbbs-deployment.yaml create mode 100644 helm-charts/templates/hbbs-pvc.yaml create mode 100644 helm-charts/templates/hbbs-service.yaml create mode 100644 helm-charts/templates/serviceaccount.yaml create mode 100644 helm-charts/templates/tests/test-connection.yaml create mode 100644 helm-charts/values.yaml diff --git a/helm-charts/.helmignore b/helm-charts/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/helm-charts/.helmignore @@ -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/ diff --git a/helm-charts/Chart.yaml b/helm-charts/Chart.yaml new file mode 100644 index 00000000..f06a2400 --- /dev/null +++ b/helm-charts/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +appVersion: "1.1.10-3" +name: rustdesk-server +description: A Rustdesk Helm chart for Kubernetes +type: application +icon: https://raw.githubusercontent.com/rustdesk/rustdesk-server/master/ui/icons/icon.png +version: 0.1.0 diff --git a/helm-charts/templates/NOTES.txt b/helm-charts/templates/NOTES.txt new file mode 100644 index 00000000..05bbd760 --- /dev/null +++ b/helm-charts/templates/NOTES.txt @@ -0,0 +1,3 @@ +The RustDesk has been deployed to your cluster. + +See https://rustdesk.com/docs/en/ for more detail. diff --git a/helm-charts/templates/_helpers.tpl b/helm-charts/templates/_helpers.tpl new file mode 100644 index 00000000..1f4cb203 --- /dev/null +++ b/helm-charts/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "rustdesk-server.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 "rustdesk-server.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 "rustdesk-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "rustdesk-server.labels" -}} +helm.sh/chart: {{ include "rustdesk-server.chart" . }} +{{ include "rustdesk-server.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "rustdesk-server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "rustdesk-server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "rustdesk-server.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "rustdesk-server.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm-charts/templates/hbbr-deployment.yaml b/helm-charts/templates/hbbr-deployment.yaml new file mode 100644 index 00000000..2db38c46 --- /dev/null +++ b/helm-charts/templates/hbbr-deployment.yaml @@ -0,0 +1,90 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "rustdesk-server.fullname" . }}-hbbr + labels: + {{- include "rustdesk-server.labels" . | nindent 4 }} + app.kubernetes.io/component: hbbr + {{- with .Values.hbbr.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "rustdesk-server.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: hbbr + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "rustdesk-server.labels" . | nindent 8 }} + app.kubernetes.io/component: hbbr + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "rustdesk-server.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }}-hbbr + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.hbbr.image.repository }}:{{ .Values.hbbr.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.hbbr.image.pullPolicy }} + command: [ "/usr/bin/hbbr" ] + args: + {{- with .Values.hbbr.extraArgs }} + {{- toYaml . | nindent 12 }} + {{- else}} + - "-k" + - "_" + {{- end }} + ports: + - name: hbbr-port + containerPort: 21117 + protocol: TCP + - name: hbbr-websocket + containerPort: 21119 + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - mountPath: /root + readOnly: true + name: hbbr-keys + {{- if .Values.extraVolumeMounts }} + {{ toYaml .Values.extraVolumeMounts | nindent 12 }} + {{- end }} + volumes: + - name: hbbr-keys + secret: + {{- if .Values.hbbr.secret.existingSecret }} + secretName: {{ .Values.hbbr.secret.existingSecret }} + {{- else }} + secretName: {{ include "rustdesk-server.fullname" . }}-hbbr + {{- end }} + {{- if .Values.extraVolumes }} + {{ toYaml .Values.extraVolumes | 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 }} diff --git a/helm-charts/templates/hbbr-secret.yaml b/helm-charts/templates/hbbr-secret.yaml new file mode 100644 index 00000000..cc3d2c18 --- /dev/null +++ b/helm-charts/templates/hbbr-secret.yaml @@ -0,0 +1,20 @@ +{{- if not .Values.hbbr.secret.existingSecret -}} +apiVersion: v1 +kind: Secret +metadata: + labels: + {{- include "rustdesk-server.labels" . | nindent 4 }} + app.kubernetes.io/component: hbbr + {{- with .Values.hbbr.secret.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + name: {{ include "rustdesk-server.fullname" . }}-hbbr + {{- with .Values.hbbr.secret.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +type: Opaque +data: + id_ed25519: {{ .Values.hbbr.secret.private | b64enc | quote }} + id_ed25519.pub: {{ .Values.hbbr.secret.public | b64enc | quote }} +{{- end -}} diff --git a/helm-charts/templates/hbbr-service.yaml b/helm-charts/templates/hbbr-service.yaml new file mode 100644 index 00000000..f49ef7b6 --- /dev/null +++ b/helm-charts/templates/hbbr-service.yaml @@ -0,0 +1,46 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "rustdesk-server.fullname" . }}-hbbr + labels: + {{- include "rustdesk-server.labels" . | nindent 4 }} + app.kubernetes.io/component: hbbr + {{- with .Values.hbbr.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.service.type }} +{{- if .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} +{{- end }} +{{- if .Values.service.externalIPs }} + externalIPs: {{ toYaml .Values.service.externalIPs | nindent 4 }} +{{- end }} +{{- if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} +{{- end }} +{{- if .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: {{ toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }} +{{- end }} +{{- if .Values.service.loadBalancerClass }} + loadBalancerClass: {{ .Values.service.loadBalancerClass }} +{{- end }} +{{- if hasKey .Values.service "allocateLoadBalancerNodePorts" }} + allocateLoadBalancerNodePorts: {{ .Values.service.allocateLoadBalancerNodePorts }} +{{- end }} +{{- if .Values.service.externalTrafficPolicy }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} +{{- end }} + ports: + - port: {{ .Values.service.hbbrPort }} + targetPort: hbbr-port + protocol: TCP + name: hbbr-port + - port: {{ .Values.service.hbbrWebsocket }} + targetPort: hbbr-websocket + protocol: TCP + name: hbbr-websocket + selector: + {{- include "rustdesk-server.selectorLabels" . | nindent 4 }} + app.kubernetes.io/component: hbbr diff --git a/helm-charts/templates/hbbs-config.yaml b/helm-charts/templates/hbbs-config.yaml new file mode 100644 index 00000000..ccc8adf0 --- /dev/null +++ b/helm-charts/templates/hbbs-config.yaml @@ -0,0 +1,18 @@ +{{- if .Values.hbbs.relay -}} +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + {{- include "rustdesk-server.labels" . | nindent 4 }} + app.kubernetes.io/component: hbbr + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + name: {{ include "rustdesk-server.fullname" . }}-hbbs + {{- with .Values.annotations }} + annotations: + {{ toYaml . | indent 4 }} + {{- end }} +data: + RELAY: {{ .Values.hbbs.relay }} +{{- end -}} diff --git a/helm-charts/templates/hbbs-deployment.yaml b/helm-charts/templates/hbbs-deployment.yaml new file mode 100644 index 00000000..0b7f9178 --- /dev/null +++ b/helm-charts/templates/hbbs-deployment.yaml @@ -0,0 +1,111 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "rustdesk-server.fullname" . }}-hbbs + labels: + {{- include "rustdesk-server.labels" . | nindent 4 }} + app.kubernetes.io/component: hbbs + {{- with .Values.hbbs.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "rustdesk-server.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: hbbs + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "rustdesk-server.labels" . | nindent 8 }} + app.kubernetes.io/component: hbbs + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "rustdesk-server.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }}-hbbs + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.hbbs.image.repository }}:{{ .Values.hbbs.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.hbbs.image.pullPolicy }} + command: [ "/usr/bin/hbbs" ] + args: + {{- with .Values.hbbs.extraArgs }} + {{- toYaml . | nindent 12 }} + {{- else}} + - "-r" + - "$(RELAY)" + - "-k" + - "_" + {{- end }} + {{- if .Values.hbbs.relay }} + env: + - name: DB_URL + value: "/db/db_v2.sqlite3" + envFrom: + - configMapRef: + name: {{ include "rustdesk-server.fullname" . }}-hbbs + {{- end }} + ports: + - name: hbbs-nat-test + containerPort: 21115 + protocol: TCP + - name: hbbs-port + containerPort: 21116 + protocol: TCP + - name: hbbs-port-udp + containerPort: 21116 + protocol: UDP + - name: hbbs-websocket + containerPort: 21118 + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - mountPath: /root + readOnly: true + name: hbbr-keys + - mountPath: /db + name: hbbs-db + {{- if .Values.extraVolumeMounts }} + {{ toYaml .Values.extraVolumeMounts | nindent 12 }} + {{- end }} + volumes: + - name: hbbr-keys + secret: + {{- if .Values.hbbr.secret.existingSecret }} + secretName: {{ .Values.hbbr.secret.existingSecret }} + {{- else }} + secretName: {{ include "rustdesk-server.fullname" . }}-hbbr + {{- end }} + - name: hbbs-db + persistentVolumeClaim: + claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "rustdesk-server.fullname" . }}-hbbs-pvc{{- end }} + {{- if .Values.extraVolumes }} + {{ toYaml .Values.extraVolumes | 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 }} diff --git a/helm-charts/templates/hbbs-pvc.yaml b/helm-charts/templates/hbbs-pvc.yaml new file mode 100644 index 00000000..94e60128 --- /dev/null +++ b/helm-charts/templates/hbbs-pvc.yaml @@ -0,0 +1,34 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ template "rustdesk-server.fullname" . }}-hbbs-pvc + labels: + {{- include "rustdesk-server.labels" . | nindent 4 }} + {{- with .Values.persistence.extraPvcLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.persistence.annotations }} + annotations: +{{ toYaml . | indent 4 }} + {{- end }} + {{- with .Values.persistence.finalizers }} + finalizers: +{{ toYaml . | indent 4 }} + {{- end }} +spec: + accessModes: + {{- range .Values.persistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- if .Values.persistence.storageClassName }} + storageClassName: {{ .Values.persistence.storageClassName }} + {{- end -}} + {{- with .Values.persistence.selectorLabels }} + selector: + matchLabels: +{{ toYaml . | indent 6 }} + {{- end }} diff --git a/helm-charts/templates/hbbs-service.yaml b/helm-charts/templates/hbbs-service.yaml new file mode 100644 index 00000000..403a7a19 --- /dev/null +++ b/helm-charts/templates/hbbs-service.yaml @@ -0,0 +1,54 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "rustdesk-server.fullname" . }}-hbbs + labels: + {{- include "rustdesk-server.labels" . | nindent 4 }} + app.kubernetes.io/component: hbbs + {{- with .Values.hbbs.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.service.type }} +{{- if .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} +{{- end }} +{{- if .Values.service.externalIPs }} + externalIPs: {{ toYaml .Values.service.externalIPs | nindent 4 }} +{{- end }} +{{- if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} +{{- end }} +{{- if .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: {{ toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }} +{{- end }} +{{- if .Values.service.loadBalancerClass }} + loadBalancerClass: {{ .Values.service.loadBalancerClass }} +{{- end }} +{{- if hasKey .Values.service "allocateLoadBalancerNodePorts" }} + allocateLoadBalancerNodePorts: {{ .Values.service.allocateLoadBalancerNodePorts }} +{{- end }} +{{- if .Values.service.externalTrafficPolicy }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} +{{- end }} + ports: + - port: {{ .Values.service.hbbsNatTest }} + targetPort: hbbs-nat-test + protocol: TCP + name: hbbs-nat-test + - port: {{ .Values.service.hbbsPort }} + targetPort: hbbs-port + protocol: TCP + name: hbbs-port + - port: {{ .Values.service.hbbsPort }} + targetPort: hbbs-port-udp + protocol: UDP + name: hbbs-port-udp + - port: {{ .Values.service.hbbsWebsocket }} + targetPort: hbbs-websocket + protocol: TCP + name: hbbs-websocket + selector: + {{- include "rustdesk-server.selectorLabels" . | nindent 4 }} + app.kubernetes.io/component: hbbs diff --git a/helm-charts/templates/serviceaccount.yaml b/helm-charts/templates/serviceaccount.yaml new file mode 100644 index 00000000..17a9e9e6 --- /dev/null +++ b/helm-charts/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "rustdesk-server.serviceAccountName" . }} + labels: + {{- include "rustdesk-server.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/helm-charts/templates/tests/test-connection.yaml b/helm-charts/templates/tests/test-connection.yaml new file mode 100644 index 00000000..f930f6a4 --- /dev/null +++ b/helm-charts/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "rustdesk-server.fullname" . }}-test-connection" + labels: + {{- include "rustdesk-server.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "rustdesk-server.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml new file mode 100644 index 00000000..9c84cff5 --- /dev/null +++ b/helm-charts/values.yaml @@ -0,0 +1,125 @@ +# Default values for rustdesk-server. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +hbbs: + enabled: true + image: + repository: rustdesk/rustdesk-server + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + relay: rustdesk.example.com + annotations: {} + # extraArgs: + # - foo + # - bar + +hbbr: + enabled: true + image: + repository: rustdesk/rustdesk-server + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + annotations: {} + # extraArgs: + # - foo + # - bar + secret: + # existingSecret: rustdesk-server-hbbr + private: foo + public: bar + # -- Labels for the Secret + labels: {} + # -- Annotations for the Secret + annotations: {} + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: 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: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + hbbsNatTest: 21115 + hbbsPort: 21116 + hbbsWebsocket: 21118 + hbbrPort: 21117 + hbbrWebsocket: 21119 + +persistence: + # storageClassName: default + accessModes: + - ReadWriteOnce + size: 100Mi + # annotations: {} + finalizers: + - kubernetes.io/pvc-protection + # selectorLabels: {} + ## Sub-directory of the PV to mount. Can be templated. + # subPath: "" + ## Name of an existing PVC. Can be templated. + # existingClaim: + ## Extra labels to apply to a PVC. + extraPvcLabels: {} + +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 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +extraVolumes: [] +## Additional volumes to the pod. +# - name: reverse-proxy-auth-config +# secret: +# secretName: reverse-proxy-auth-config + +## Extra volume mounts that will be added to the container +extraVolumeMounts: [] + +nodeSelector: {} + +tolerations: [] + +affinity: {} From d74140b4d2609bf193b78f42e955a52e632b1442 Mon Sep 17 00:00:00 2001 From: Andras Elso Date: Mon, 23 Sep 2024 13:42:21 +0200 Subject: [PATCH 2/2] Separate replica count parameter --- helm-charts/templates/hbbr-deployment.yaml | 2 +- helm-charts/templates/hbbs-deployment.yaml | 2 +- helm-charts/values.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helm-charts/templates/hbbr-deployment.yaml b/helm-charts/templates/hbbr-deployment.yaml index 2db38c46..a918de02 100644 --- a/helm-charts/templates/hbbr-deployment.yaml +++ b/helm-charts/templates/hbbr-deployment.yaml @@ -10,7 +10,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: - replicas: {{ .Values.replicaCount }} + replicas: {{ .Values.hbbr.replicaCount }} selector: matchLabels: {{- include "rustdesk-server.selectorLabels" . | nindent 6 }} diff --git a/helm-charts/templates/hbbs-deployment.yaml b/helm-charts/templates/hbbs-deployment.yaml index 0b7f9178..9767e550 100644 --- a/helm-charts/templates/hbbs-deployment.yaml +++ b/helm-charts/templates/hbbs-deployment.yaml @@ -10,7 +10,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: - replicas: 1 + replicas: {{ .Values.hbbs.replicaCount }} selector: matchLabels: {{- include "rustdesk-server.selectorLabels" . | nindent 6 }} diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml index 9c84cff5..f377084d 100644 --- a/helm-charts/values.yaml +++ b/helm-charts/values.yaml @@ -2,10 +2,9 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 - hbbs: enabled: true + replicaCount: 1 image: repository: rustdesk/rustdesk-server pullPolicy: IfNotPresent @@ -19,6 +18,7 @@ hbbs: hbbr: enabled: true + replicaCount: 1 image: repository: rustdesk/rustdesk-server pullPolicy: IfNotPresent