From 04b8b83db6a5a7e90b249b87a08837269708b19d Mon Sep 17 00:00:00 2001 From: Tom Teichler <tom.teichler@teckids.org> Date: Sun, 5 Dec 2021 01:10:32 +0100 Subject: [PATCH] Implement secret/configmap --- Chart.yaml | 4 +- templates/configmap.yaml | 10 ++++ templates/deployment.yaml | 8 +-- templates/hpa.yaml | 28 ----------- templates/secret.yaml | 10 ++++ templates/tests/test-connection.yaml | 15 ------ values.yaml | 75 ++++++++++++++++++++++------ 7 files changed, 87 insertions(+), 63 deletions(-) create mode 100644 templates/configmap.yaml delete mode 100644 templates/hpa.yaml create mode 100644 templates/secret.yaml delete mode 100644 templates/tests/test-connection.yaml diff --git a/Chart.yaml b/Chart.yaml index 4a4c974..aaf3c1b 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: greenlight -description: A Helm chart for Kubernetes +description: A Helm chart for installing greenlight on Kubernetes # A chart can be either an 'application' or a 'library' chart. # @@ -21,4 +21,4 @@ version: 0.1.0 # 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. # It is recommended to use it with quotes. -appVersion: "1.16.0" +appVersion: "1.0.0" diff --git a/templates/configmap.yaml b/templates/configmap.yaml new file mode 100644 index 0000000..a0ebd48 --- /dev/null +++ b/templates/configmap.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "greenlight.fullname" . }}-config + labels: + {{- include "greenlight.labels" . | nindent 4 }} +data: + {{- range $key, $val := .Values.config }} + {{ $key }}: {{ $val | quote}} + {{- end }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 65979ca..e12a355 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -5,9 +5,6 @@ metadata: labels: {{- include "greenlight.labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} selector: matchLabels: {{- include "greenlight.selectorLabels" . | nindent 6 }} @@ -47,6 +44,11 @@ spec: port: http resources: {{- toYaml .Values.resources | nindent 12 }} + envFrom: + - configMapRef: + name: {{ .Release.Name }}-config + - secretRef: + name: {{ .Release.Name }}-secret {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/templates/hpa.yaml b/templates/hpa.yaml deleted file mode 100644 index 331be27..0000000 --- a/templates/hpa.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "greenlight.fullname" . }} - labels: - {{- include "greenlight.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "greenlight.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/templates/secret.yaml b/templates/secret.yaml new file mode 100644 index 0000000..65382c2 --- /dev/null +++ b/templates/secret.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "greenlight.fullname" . }}-secret + labels: + {{- include "greenlight.labels" . | nindent 4 }} +data: + {{- range $key, $val := .Values.secret }} + {{ $key }}: {{ $val | quote}} + {{- end }} diff --git a/templates/tests/test-connection.yaml b/templates/tests/test-connection.yaml deleted file mode 100644 index 16e8d9e..0000000 --- a/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "greenlight.fullname" . }}-test-connection" - labels: - {{- include "greenlight.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "greenlight.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/values.yaml b/values.yaml index ac630ae..e8beedf 100644 --- a/values.yaml +++ b/values.yaml @@ -1,14 +1,8 @@ -# Default values for greenlight. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - image: - repository: nginx + repository: bigbluebutton/greenlight pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "" + tag: "release-2.10.0" imagePullSecrets: [] nameOverride: "" @@ -68,15 +62,66 @@ resources: {} # cpu: 100m # memory: 128Mi -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - nodeSelector: {} tolerations: [] affinity: {} + +secret: + BIGBLUEBUTTON_SECRET: "BIGBLUEBUTTON_SECRET" + SECRET_KEY_BASE: "SECRET_KEY_BASE" +# GOOGLE_OAUTH2_SECRET: "" +# OFFICE365_SECRET: "" +# LDAP_PASSWORD: "" +# SMTP_PASSWORD: "" +# DB_PASSWORD: "" + +config: + BIGBLUEBUTTON_ENDPOINT: "BIGBLUEBUTTON_ENDPOINT" + +# GOOGLE_OAUTH2_ID: "" +# GOOGLE_OAUTH2_HD: "" +# OFFICE365_KEY: "" +# OFFICE365_HD: "" + +# LDAP_SERVER: "" +# LDAP_PORT: 389 +# LDAP_METHOD: plain +# LDAP_UID: uid +# LDAP_BASE: "LDAP_BASE" +# LDAP_BIND_DN: "LDAP_BIND_DN" +# LDAP_ROLE_FIELD: "" + +# ALLOW_GREENLIGHT_ACCOUNTS: true + +# RECAPTCHA_SITE_KEY: "" +# RECAPTCHA_SECRET_KEY: "" + +# GOOGLE_ANALYTICS_TRACKING_ID: "" + +# SMTP_SERVER: "" +# SMTP_PORT: "" +# SMTP_DOMAIN: "" +# SMTP_USERNAME: "" +# SMTP_AUTH: "" +# SMTP_STARTTLS_AUTO: "" + +# SMTP_SENDER: "" + + ROOM_FEATURES: mute-on-join,require-moderator-approval,anyone-can-start,all-join-moderator + PAGINATION_NUMBER: 25 + NUMBER_OF_ROWS: 25 + + ENABLE_GOOGLE_CALENDAR_BUTTON: false + + MAINTENANCE_MODE: false +# MAINTENANCE_WINDOW: "" +# REPORT_ISSUE_URL: #https://github.com/bigbluebutton/greenlight/issues/new + + DB_ADAPTER: postgresql + DB_HOST: "localhost" + DB_NAME: greenlight + DB_USERNAME: greenlight + + DEFAULT_REGISTRATION: open -- GitLab