From 9c96efd8247d6c4d312099d9c45cb6b7e2f509c1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 4 Dec 2021 10:28:33 +0100 Subject: [PATCH] ++nextcloud --- apps/nextcloud/Chart.yaml | 17 +--- apps/nextcloud/templates/deployment.yaml | 103 +++++++++++------------ 2 files changed, 52 insertions(+), 68 deletions(-) diff --git a/apps/nextcloud/Chart.yaml b/apps/nextcloud/Chart.yaml index ccb5282..aca79cb 100644 --- a/apps/nextcloud/Chart.yaml +++ b/apps/nextcloud/Chart.yaml @@ -2,23 +2,8 @@ apiVersion: v2 name: ungleich-nextcloud description: ungleich managed nextcloud -# 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. -# It is recommended to use it with quotes. -appVersion: "21.0.3" +appVersion: "21.0.7-apache" diff --git a/apps/nextcloud/templates/deployment.yaml b/apps/nextcloud/templates/deployment.yaml index 07b1455..659af2e 100644 --- a/apps/nextcloud/templates/deployment.yaml +++ b/apps/nextcloud/templates/deployment.yaml @@ -48,39 +48,43 @@ spec: apiVersion: apps/v1 kind: Deployment metadata: - name: {{ .Release.Name }}-zammad + name: {{ .Release.Name }}-nextcloud spec: selector: matchLabels: - app: {{ .Release.Name }}-zammad + app: {{ .Release.Name }}-nextcloud replicas: 1 template: metadata: labels: - app: {{ .Release.Name }}-zammad + app: {{ .Release.Name }}-nextcloud spec: - # initContainers: - # - name: wait-for-cert - # image: busybox - # command: - # - sh - # - -c - # - until ls /etc/letsencrypt/live/{{ tpl .Values.fqdn . }}/fullchain.pem; do sleep 5; done - # volumeMounts: - # - name: etcletsencrypt - # mountPath: "/etc/letsencrypt" containers: - # - name: nginx - # image: nginx:1.21-alpine - # ports: - # - containerPort: 443 - # volumeMounts: - # - name: nginx-config - # mountPath: "/etc/nginx/conf.d/" - # - name: etcletsencrypt - # mountPath: "/etc/letsencrypt" - # - name: zammad-data - # mountPath: "/var/www/html" + - name: nginx + image: ungleich/ungleich-certbot:0.3.2 + ports: + - containerPort: 443 + name: https + - containerPort: 80 + name: http + env: + - name: DOMAIN + value: "{{ tpl .Values.fqdn . }}" + - name: EMAIL + value: "{{ .Values.email }}" + - name: NGINX + value: "yes" + {{ if eq .Values.letsencryptStaging "no" }} + - name: STAGING + value: "no" + {{ end }} + volumeMounts: + - name: nginx-config + mountPath: "/etc/nginx/conf.d/" + - name: etcletsencrypt + mountPath: "/etc/letsencrypt" + - name: nextcloud-data + mountPath: "/opt/nextcloud" # # Is it ready to work? # readinessProbe: # tcpSocket: @@ -93,14 +97,8 @@ spec: # port: 443 # initialDelaySeconds: 15 # periodSeconds: 20 - - name: elasticsearch - image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.1 - ports: - - containerPort: 9200 - name: elastic - - - name: zammad - image: index.docker.io/zammad/zammad-docker-compose:zammad-{{ .Chart.AppVersion }} + - name: nextcloud + image: nextcloud:{{ .Chart.AppVersion }} # # Wait for 10 minutes to get ready # startupProbe: # httpGet: @@ -122,7 +120,7 @@ spec: # failureThreshold: 3 # periodSeconds: 30 ports: - - containerPort: 9000 + - containerPort: 80 name: fpm env: - name: POSTGRES_DB @@ -130,18 +128,6 @@ spec: secretKeyRef: name: {{ tpl .Values.identifier . }}-postgres-config key: POSTGRES_DB - - name: ZAMMAD_TRUSTED_DOMAINS - value: "{{ tpl .Values.fqdn . }}" - - name: ZAMMAD_ADMIN_USER - valueFrom: - secretKeyRef: - name: {{ tpl .Values.identifier . }}-zammad - key: USERNAME - - name: ZAMMAD_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: {{ tpl .Values.identifier . }}-zammad - key: PASSWORD - name: POSTGRES_USER valueFrom: secretKeyRef: @@ -154,14 +140,27 @@ spec: key: POSTGRES_PASSWORD - name: POSTGRES_HOST value: {{ .Release.Name }}-postgres + - name: NEXTCLOUD_TRUSTED_DOMAINS + value: "{{ tpl .Values.fqdn . }}" + + - name: NEXTCLOUD_ADMIN_USER + valueFrom: + secretKeyRef: + name: {{ tpl .Values.identifier . }}-nextcloud + key: USERNAME + - name: NEXTCLOUD_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: {{ tpl .Values.identifier . }}-nextcloud + key: PASSWORD volumeMounts: - - name: zammad-data + - name: nextcloud-data mountPath: "/var/www/html" volumes: - name: etcletsencrypt persistentVolumeClaim: claimName: {{ tpl .Values.identifier . }}-letsencrypt-certs - - name: zammad-data + - name: nextcloud-data persistentVolumeClaim: claimName: {{ tpl .Values.identifier . }}-data - name: postgres-data @@ -186,7 +185,7 @@ spec: - port: 443 name: https selector: - app: {{ .Release.Name }}-zammad + app: {{ .Release.Name }}-nextcloud --- apiVersion: v1 kind: PersistentVolumeClaim @@ -232,7 +231,7 @@ spec: template: metadata: labels: - app: {{ .Release.Name }}-zammad + app: {{ .Release.Name }}-nextcloud spec: restartPolicy: Never containers: @@ -275,13 +274,13 @@ metadata: secret-generator.v1.mittwald.de/autogenerate: POSTGRES_PASSWORD stringData: POSTGRES_USER: "postgres" - POSTGRES_DB: "zammad" + POSTGRES_DB: "nextcloud" --- apiVersion: v1 kind: Secret metadata: - name: {{ tpl .Values.identifier . }}-zammad + name: {{ tpl .Values.identifier . }}-nextcloud annotations: secret-generator.v1.mittwald.de/autogenerate: PASSWORD stringData: - USERNAME: "zammad" + USERNAME: "nextcloud"