Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
Martyn 2023-11-28 20:40:09 +01:00
parent 31c30b9e44
commit 4f77667ae9
6 changed files with 170 additions and 0 deletions

View File

@ -0,0 +1,43 @@
apiVersion: v1
data:
config.ini: |-
[server]
hidden_host =
port = 8080
bind = 0.0.0.0
tls_cert_path =
tls_key_path =
templates_parent_dir =
static_parent_dir =
pages_parent_dir =
keys_parent_dir =
[database]
type = mysql
filename =
username = writefreely
password = ${MYSQL_PASSWORD}
database = writefreely
host = mysql4blog-mariadb
port = 3306
[app]
site_name = Martyn's random blog
site_description = Where I put stuff that I maybe care about
host = https://musings.martyn.berlin
theme = write
disable_js = false
webfonts = true
single_user = true
open_registration = false
min_username_len = 3
max_blogs = 1
federation = true
public_stats = true
private = false
local_timeline = false
user_invites =
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/name: writefreely
name: blog-config

View File

@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: writefreely
name: blog-writefreely
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: writefreely
template:
metadata:
labels:
app.kubernetes.io/name: writefreely
spec:
containers:
- args:
- -c
- /conf/config.ini
env:
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
key: mariadb-password
name: db-creds
image: writeas/writefreely
imagePullPolicy: IfNotPresent
name: writefreely
volumeMounts:
- mountPath: /conf
name: full-config
dnsPolicy: ClusterFirst
initContainers:
- args:
- config.ini
env:
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
key: mariadb-password
name: db-creds
image: dibi/envsubst
imagePullPolicy: Always
name: processconfig
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /workdir
name: blog-config
- mountPath: /processed
name: full-config
volumes:
- configMap:
defaultMode: 420
name: blog-config
name: blog-config
- name: full-config
persistentVolumeClaim:
claimName: writefreely-config-data

View File

@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt
external-dns.alpha.kubernetes.io/target: home.martyn.berlin
kubernetes.io/ingress.class: nginx
labels:
app.kubernetes.io/name: writefreely
name: blog-writefreely
spec:
rules:
- host: musings.martyn.berlin
http:
paths:
- backend:
service:
name: blog-writefreely
port:
number: 80
path: /
pathType: Prefix
tls:
- hosts:
- musings.martyn.berlin
secretName: musings-tls

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: writefreely-config-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: rook-ceph-block-ssd

View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: writefreely
name: blog-writefreely
spec:
ports:
- port: 80
targetPort: 8080
selector:
app.kubernetes.io/name: writefreely
type: LoadBalancer

View File

@ -0,0 +1,17 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: writefreely
namespace: argocd
spec:
destination:
namespace: writefreely
server: https://kubernetes.default.svc
project: apps
source:
path: apps-kustomized/writefreely
repoURL: https://git.martyn.berlin/martyn/infra4talos
targetRevision: HEAD
syncPolicy:
automated:
selfHeal: true