diff --git a/boilerplates/kubernetes/argo-helm.yaml b/boilerplates/kubernetes/argo-helm.yaml index 98496614..7261c05c 100644 --- a/boilerplates/kubernetes/argo-helm.yaml +++ b/boilerplates/kubernetes/argo-helm.yaml @@ -1,26 +1,26 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: &app - namespace: &ns + name: &chart-name coder-db + namespace: argocd spec: project: default + source: + chart: *chart-name + repoURL: https://charts.bitnami.com/bitnami + targetRevision: 15.5.17 + helm: + valuesObject: + # auth: + # username: coder + # password: coder + # database: coder + # persistence: + # size: 10Gi destination: server: "https://kubernetes.default.svc" - namespace: *ns - sources: - - repoURL: - targetRevision: - chart: *app - helm: - valueFiles: - - $values/kubernetes/registry/helm//values.yaml - - repoURL: https://github.com/mrpbennett/home-ops.git - targetRevision: HEAD - ref: values + namespace: coder syncPolicy: automated: prune: true selfHeal: true - syncOptions: - - CreateNamespace=true diff --git a/kubernetes/registry/helm/coder/coder-psql-helm.yaml b/kubernetes/registry/helm/coder/coder-psql-helm.yaml deleted file mode 100644 index bf21a953..00000000 --- a/kubernetes/registry/helm/coder/coder-psql-helm.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: coder-db - namespace: argocd -spec: - project: default - source: - chart: postgresql - repoURL: https://charts.bitnami.com/bitnami - targetRevision: 15.5.17 - helm: - valuesObject: - auth: - username: coder - password: coder - database: coder - persistence: - size: 10Gi - destination: - server: "https://kubernetes.default.svc" - namespace: coder - syncPolicy: - automated: - prune: true - selfHeal: true diff --git a/kubernetes/registry/helm/coder/postgres/config-map.yaml b/kubernetes/registry/helm/coder/postgres/config-map.yaml new file mode 100644 index 00000000..77973fc4 --- /dev/null +++ b/kubernetes/registry/helm/coder/postgres/config-map.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: coder-db-configmap + labels: + app: coder-db +data: + POSTGRES_DB: coder + POSTGRES_USER: coder + POSTGRES_PASSWORD: coder diff --git a/kubernetes/registry/helm/coder/postgres/deployment.yaml b/kubernetes/registry/helm/coder/postgres/deployment.yaml new file mode 100644 index 00000000..7e2bf6a4 --- /dev/null +++ b/kubernetes/registry/helm/coder/postgres/deployment.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: coder-db-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: coder-db + template: + metadata: + labels: + app: coder-db + spec: + containers: + - name: postgres + image: "postgres:16" + imagePullPolicy: IfNotPresent + ports: + - containerPort: 5432 + envFrom: + - configMapRef: + name: coder-db-configmap + env: + - name: PGDATA + value: /var/lib/postgresql/data/pgdata + volumeMounts: + - mountPath: /var/lib/postgresql/data + name: coder-db-data + volumes: + - name: coder-db-data + persistentVolumeClaim: + claimName: coder-db-pvc diff --git a/kubernetes/registry/helm/coder/postgres/pv.yaml b/kubernetes/registry/helm/coder/postgres/pv.yaml new file mode 100644 index 00000000..3fd2440d --- /dev/null +++ b/kubernetes/registry/helm/coder/postgres/pv.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: coder-db-pv + labels: + type: local + app: coder +spec: + capacity: + storage: 10Gi + accessModes: + - ReadWriteMany + hostPath: + path: /mnt/storage/coder-db diff --git a/kubernetes/registry/helm/coder/postgres/pvc.yaml b/kubernetes/registry/helm/coder/postgres/pvc.yaml new file mode 100644 index 00000000..e1d909a0 --- /dev/null +++ b/kubernetes/registry/helm/coder/postgres/pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: coder-db-pvc + labels: + app: coder +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 10Gi diff --git a/kubernetes/registry/helm/coder/postgres/service.yaml b/kubernetes/registry/helm/coder/postgres/service.yaml new file mode 100644 index 00000000..3dfd0e33 --- /dev/null +++ b/kubernetes/registry/helm/coder/postgres/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: coder-db-svc + labels: + app: coder +spec: + type: LoadBalancer + ports: + - port: 5432 + selector: + app: coder