Skip to content

Commit

Permalink
trying postgres normally for coder-db
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpbennett committed Jul 17, 2024
1 parent 3869038 commit f59b583
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 41 deletions.
30 changes: 15 additions & 15 deletions boilerplates/kubernetes/argo-helm.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: &app <chart name>
namespace: &ns <namespace>
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: <chart repo url>
targetRevision: <chart version>
chart: *app
helm:
valueFiles:
- $values/kubernetes/registry/helm/<directory storing helm app>/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
26 changes: 0 additions & 26 deletions kubernetes/registry/helm/coder/coder-psql-helm.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions kubernetes/registry/helm/coder/postgres/config-map.yaml
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions kubernetes/registry/helm/coder/postgres/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions kubernetes/registry/helm/coder/postgres/pv.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions kubernetes/registry/helm/coder/postgres/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: coder-db-pvc
labels:
app: coder
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
12 changes: 12 additions & 0 deletions kubernetes/registry/helm/coder/postgres/service.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f59b583

Please sign in to comment.