add coder

This commit is contained in:
Joseph Hanson 2024-09-14 13:27:58 -05:00
parent d1fcc8f1a2
commit a7ab50f161
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
6 changed files with 141 additions and 0 deletions

View file

@ -75,6 +75,11 @@ spec:
- autobrr
password:
type: AlphaNumeric
- name: coder
databases:
- coder
password:
type: AlphaNumeric
- name: gatus
databases:
- gatus

View file

@ -278,3 +278,33 @@ spec:
remoteRef:
remoteKey: kasm
property: KASM_POSTGRES_PASSWORD
---
# yaml-language-server: $schema=https://ks.hsn.dev/external-secrets.io/pushsecret_v1alpha1.json
apiVersion: external-secrets.io/v1alpha1
kind: PushSecret
metadata:
name: coder
spec:
refreshInterval: 1h
secretStoreRefs:
- name: onepassword-connect
kind: ClusterSecretStore
selector:
secret:
name: postgres-pguser-coder
data:
- match:
secretKey: host
remoteRef:
remoteKey: coder
property: CODER_POSTGRES_HOST
- match:
secretKey: user
remoteRef:
remoteKey: coder
property: CODER_POSTGRES_USER
- match:
secretKey: password
remoteRef:
remoteKey: coder
property: CODER_POSTGRES_PASSWORD

View file

@ -0,0 +1,27 @@
---
# yaml-language-server: $schema=https://ks.hsn.dev/external-secrets.io/externalsecret_v1beta1.json
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: coder
namespace: default
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword-connect
target:
name: coder-secret
creationPolicy: Owner
template:
engineVersion: v2
data:
CODER__POSTGRES_HOST: "postgres-primary-real.database.svc"
CODER__POSTGRES_PORT: "5432"
CODER__POSTGRES_USER: "{{ .CODER_POSTGRES_USER }}"
CODER__POSTGRES_PASSWORD: "{{ .CODER_POSTGRES_PASSWORD }}"
CODER__POSTGRES_MAIN_DB: coder
CODER_PG_CONNECTION_URL: "postgres://{{ .CODER_POSTGRES_USER }}:{{ .CODER_POSTGRES_PASSWORD }}@postgres-primary-real.database.svc/coder"
dataFrom:
- extract:
key: coder

View file

@ -0,0 +1,48 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &app coder
spec:
interval: 30m
chart:
spec:
chart: coder
version: 2.15.0
sourceRef:
kind: HelmRepository
name: coder
namespace: flux-system
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
values:
coder:
podAnnotations:
secret.reloader.stakater.com/reload: coder-secret
env:
- name: CODER_ACCESS_URL
value: https://coder.hsn.dev
- name: CODER_WILDCARD_ACCESS_URL
value: "*.coder.hsn.dev"
- name: CODER_PROMETHEUS_ENABLE
value: "true"
envFrom:
- secretRef:
name: coder-secret
ingress:
enable: true
className: external-nginx
annotations:
external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
external-dns.alpha.kubernetes.io/target: external.hsn.dev
host: "coder.hsn.dev"
wildcardHost: "*.coder.hsn.dev"

View file

@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./externalsecret.yaml
- ./helmrelease.yaml

View file

@ -0,0 +1,24 @@
---
# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app coder
namespace: flux-system
spec:
targetNamespace: coder
commonMetadata:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: external-secrets-stores
- name: crunchy-postgres-operator-cluster
path: ./kubernetes/apps/default/coder/app
prune: false
sourceRef:
kind: GitRepository
name: theshire
wait: true
interval: 30m
retryInterval: 1m
timeout: 5m