From fcf02da0d622d89bb8ee9973cf64079d52214919 Mon Sep 17 00:00:00 2001 From: chris Date: Wed, 2 Nov 2022 18:38:19 +0100 Subject: [PATCH] feat(gotosocial): import chart for socaas --- README.md | 3 ++ gotosocial/.helmignore | 23 +++++++++ gotosocial/Chart.yaml | 13 +++++ gotosocial/templates/NOTES.txt | 1 + gotosocial/templates/deployment.yaml | 73 ++++++++++++++++++++++++++++ gotosocial/templates/ingress.yaml | 50 +++++++++++++++++++ gotosocial/templates/pvc.yaml | 13 +++++ gotosocial/templates/service.yaml | 12 +++++ gotosocial/values.yaml | 23 +++++++++ 9 files changed, 211 insertions(+) create mode 100644 README.md create mode 100644 gotosocial/.helmignore create mode 100644 gotosocial/Chart.yaml create mode 100644 gotosocial/templates/NOTES.txt create mode 100644 gotosocial/templates/deployment.yaml create mode 100644 gotosocial/templates/ingress.yaml create mode 100644 gotosocial/templates/pvc.yaml create mode 100644 gotosocial/templates/service.yaml create mode 100644 gotosocial/values.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..17d6817 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# helm charts + +* *gotosocial/* -- [gotosocial](https://github.com/superseriousbusiness/gotosocial/), specifically tailored for [SocaaS](https://socaas.site). diff --git a/gotosocial/.helmignore b/gotosocial/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/gotosocial/.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/gotosocial/Chart.yaml b/gotosocial/Chart.yaml new file mode 100644 index 0000000..24cea28 --- /dev/null +++ b/gotosocial/Chart.yaml @@ -0,0 +1,13 @@ +apiVersion: v2 +name: gotosocial +description: Simple gotosocial installation +icon: https://docs.gotosocial.org/en/latest/assets/sloth.png +home: https://github.com/superseriousbusiness/gotosocial + +type: application +version: 0.1.1 +appVersion: "0.5.2" + +maintainers: + - name: chris + url: https://chaos.social/@tercean diff --git a/gotosocial/templates/NOTES.txt b/gotosocial/templates/NOTES.txt new file mode 100644 index 0000000..0f6119b --- /dev/null +++ b/gotosocial/templates/NOTES.txt @@ -0,0 +1 @@ +Happy socializing! diff --git a/gotosocial/templates/deployment.yaml b/gotosocial/templates/deployment.yaml new file mode 100644 index 0000000..58136a2 --- /dev/null +++ b/gotosocial/templates/deployment.yaml @@ -0,0 +1,73 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + labels: + gts: {{ .Release.Name }} + name: {{ .Release.Name }} + namespace: socaas +spec: + replicas: {{ .Values.replicas }} + selector: + matchLabels: + gts: {{ .Release.Name }} + template: + metadata: + annotations: + labels: + gts: {{ .Release.Name }} + spec: + initContainers: + - env: + - name: GTS_ACCOUNT_DOMAIN + value: {{ .Release.Name }}.{{ .Values.gtsBulkDomain }} + - name: GTS_APPLICATION_NAME + value: {{ .Release.Name }}-gts + - name: GTS_DB_ADDRESS + value: /gotosocial/storage/sqlite.db + - name: GTS_DB_TYPE + value: sqlite + - name: GTS_HOST + value: {{ .Release.Name }}.{{ .Values.gtsBulkDomain }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + name: init-{{ .Release.Name }}-gts + volumeMounts: + - mountPath: /gotosocial/storage + name: data + command: + - /bin/sh + - -c + - /gotosocial/gotosocial admin account create --username {{ .Values.gtsAdminAccountName }} --email {{ .Values.gtsAdminAccountMail }} --password '{{ .Values.gtsAdminAccountPass }}' || exit 0 && /gotosocial/gotosocial admin account confirm --username {{ .Values.gtsAdminAccountName }} && /gotosocial/gotosocial admin account promote --username {{ .Values.gtsAdminAccountName }} + + containers: + - env: + - name: GTS_ACCOUNT_DOMAIN + value: {{ .Release.Name }}.{{ .Values.gtsBulkDomain }} + - name: GTS_APPLICATION_NAME + value: {{ .Release.Name }}-gts + - name: GTS_DB_ADDRESS + value: /gotosocial/storage/sqlite.db + - name: GTS_DB_TYPE + value: sqlite + - name: GTS_HOST + value: {{ .Release.Name }}.{{ .Values.gtsBulkDomain }} + - name: GTS_SMTP_FROM + value: noreply@{{ .Values.gtsBulkDomain }} + - name: GTS_SMTP_HOST + value: 172.27.137.7 + - name: GTS_SMTP_PORT + value: "25" + - name: GTS_TRUSTED_PROXIES + value: 0.0.0.0/0 + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + name: {{ .Release.Name }}-gts + volumeMounts: + - mountPath: /gotosocial/storage + name: data + resources: + {{- toYaml .Values.resources | nindent 12 }} + restartPolicy: Always + volumes: + - name: data + persistentVolumeClaim: + claimName: {{ .Release.Name }}-data diff --git a/gotosocial/templates/ingress.yaml b/gotosocial/templates/ingress.yaml new file mode 100644 index 0000000..9409dd8 --- /dev/null +++ b/gotosocial/templates/ingress.yaml @@ -0,0 +1,50 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-ingress + namespace: socaas + labels: + gts: {{ .Release.Name }} + annotations: + cert-manager.io/cluster-issuer: letsencrypt + traefik.ingress.kubernetes.io/router.entrypoints: websecure +spec: + rules: + - host: {{ .Release.Name }}.{{ .Values.gtsBulkDomain }} + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: {{ .Release.Name }}-service + port: + number: 8080 + tls: + - hosts: + - {{ .Release.Name }}.{{ .Values.gtsBulkDomain }} + secretName: "{{ .Release.Name }}-cert" +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-http + namespace: socaas + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + traefik.ingress.kubernetes.io/router.middlewares: default-https@kubernetescrd + +spec: + rules: + - host: {{ .Release.Name }}.{{ .Values.gtsBulkDomain }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-service + port: + number: 8080 + path: / + pathType: ImplementationSpecific +{{- end }} diff --git a/gotosocial/templates/pvc.yaml b/gotosocial/templates/pvc.yaml new file mode 100644 index 0000000..8a70bd6 --- /dev/null +++ b/gotosocial/templates/pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-data + namespace: socaas + annotations: +spec: + accessModes: + - ReadWriteOnce + storageClassName: longhorn + resources: + requests: + storage: 2Gi diff --git a/gotosocial/templates/service.yaml b/gotosocial/templates/service.yaml new file mode 100644 index 0000000..50c58fd --- /dev/null +++ b/gotosocial/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-service + namespace: socaas +spec: + ports: + - name: http + port: 8080 + targetPort: 8080 + selector: + gts: {{ .Release.Name }} diff --git a/gotosocial/values.yaml b/gotosocial/values.yaml new file mode 100644 index 0000000..0953831 --- /dev/null +++ b/gotosocial/values.yaml @@ -0,0 +1,23 @@ +replicaCount: 1 + +image: + repository: superseriousbusiness/gotosocial + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +ingress: + enabled: true + +resources: + limits: + cpu: 100m + memory: 256Mi + requests: + cpu: 100m + memory: 256Mi + +gtsBulkDomain: "socaas.site" +gtsAdminAccountName: "" +gtsAdminAccountMail: "" +gtsAdminAccountPass: ""