feat(gotosocial): import chart for socaas

This commit is contained in:
chris 2022-11-02 18:38:19 +01:00
commit fcf02da0d6
Signed by: chris
GPG key ID: 75EFC7666CF51AD6
9 changed files with 211 additions and 0 deletions

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# helm charts
* *gotosocial/* -- [gotosocial](https://github.com/superseriousbusiness/gotosocial/), specifically tailored for [SocaaS](https://socaas.site).

23
gotosocial/.helmignore Normal file
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/

13
gotosocial/Chart.yaml Normal file
View file

@ -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

View file

@ -0,0 +1 @@
Happy socializing!

View file

@ -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

View file

@ -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 }}

View file

@ -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

View file

@ -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 }}

23
gotosocial/values.yaml Normal file
View file

@ -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: ""