Skip to content

Commit

Permalink
pgadmin ks
Browse files Browse the repository at this point in the history
  • Loading branch information
spiceratops committed Jan 2, 2024
1 parent 738732c commit 2d258fb
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 38 deletions.
17 changes: 7 additions & 10 deletions kubernetes/apps/databases/pgadmin/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,11 @@ spec:
memory: 100Mi
limits:
memory: 500Mi
statefulset:
volumeClaimTemplates:
- name: config
accessMode: ReadWriteOnce
size: 1Gi
storageClass: ${CLUSTER_STORAGE_BLOCK}
globalMounts:
- path: /var/lib/pgadmin
persistence:
config:
enabled: true
existingClaim: "${VOLSYNC_CLAIM}"
mountPath: /var/lib/pgadmin
service:
main:
ports:
Expand All @@ -69,12 +66,12 @@ spec:
annotations:
hajimari.io/icon: mdi:database
hosts:
- host: &host pgadmin.${PRIVATE_DOMAIN}"
- host: "${HOSTNAME}"
paths:
- path: /
service:
name: main
port: http
tls:
- hosts:
- *host
- "${HOSTNAME}"
7 changes: 1 addition & 6 deletions kubernetes/apps/databases/pgadmin/app/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: databases
resources:
- ./pvc.yaml
- ./volsync.yaml
- ./externalsecret.yaml
- ./helmrelease.yaml
- ./volsync.yaml
labels:
- pairs:
app.kubernetes.io/name: pgadmin
app.kubernetes.io/instance: pgadmin
13 changes: 0 additions & 13 deletions kubernetes/apps/databases/pgadmin/app/pvc.yaml

This file was deleted.

53 changes: 45 additions & 8 deletions kubernetes/apps/databases/pgadmin/app/volsync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: pgadmin-restic
namespace: databases
spec:
secretStoreRef:
kind: ClusterSecretStore
Expand All @@ -22,22 +21,60 @@ spec:
- extract:
key: volsync-restic-template
---
apiVersion: volsync.backube/v1alpha1
kind: ReplicationSource
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pgadmin
namespace: databases
spec:
sourcePVC: pgadmin-config
accessModes: ["ReadWriteOnce"]
dataSourceRef:
kind: ReplicationDestination
apiGroup: volsync.backube
name: pgadmin-rdst
resources:
requests:
storage: 1Gi
storageClassName: ${CLUSTER_STORAGE_BLOCK}
---
apiVersion: volsync.backube/v1alpha1
kind: ReplicationDestination
metadata:
name: pgadmin-rdst
spec:
trigger:
schedule: "0 8 * * *"
manual: restore-once
restic:
repository: pgadmin-restic-secret
copyMethod: Snapshot
accessModes: ["ReadWriteOnce"]
storageClassName: ${CLUSTER_STORAGE_BLOCK}
volumeSnapshotClassName: ${CLUSTER_SNAPSHOT_BLOCK}
cacheAccessModes: ["ReadWriteOnce"]
cacheCapacity: 8Gi
cacheStorageClassName: ${CLUSTER_STORAGE_HOSTPATH}
moverSecurityContext:
runAsUser: 568
runAsGroup: 568
fsGroup: 568
capacity: 1Gi # must match the PersistentVolumeClaim `.resources.requests.storage` size above
---
apiVersion: volsync.backube/v1alpha1
kind: ReplicationSource
metadata:
name: pgadmin-rsrc
spec:
sourcePVC: pgadmin
trigger:
schedule: "15 */8 * * *"
restic:
pruneIntervalDays: 10
repository: pgadmin-restic-secret
cacheCapacity: 8Gi
volumeSnapshotClassName: ${CLUSTER_SNAPSHOT_BLOCK}
copyMethod: Snapshot
accessModes: ["ReadWriteOnce"]
storageClassName: ${CLUSTER_STORAGE_BLOCK}
volumeSnapshotClassName: ${CLUSTER_SNAPSHOT_BLOCK}
cacheAccessModes: ["ReadWriteOnce"]
cacheCapacity: 8Gi
cacheStorageClassName: ${CLUSTER_STORAGE_HOSTPATH}
moverSecurityContext:
runAsUser: 568
Expand Down
13 changes: 12 additions & 1 deletion kubernetes/apps/databases/pgadmin/ks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: cluster-apps-pgadmin
name: &appname pgadmin
namespace: flux-system
spec:
targetNamespace: databases
commonMetadata:
labels:
app.kubernetes.io/name: *appname
dependsOn:
- name: cluster-apps-volsync
- name: cluster-apps-rook-ceph-cluster
Expand All @@ -19,3 +23,10 @@ spec:
interval: 30m
retryInterval: 1m
timeout: 5m
postBuild:
substitute:
APP: *appname
HOSTNAME: pgadmin.${PRIVATE_DOMAIN}
APP_UID: "568"
APP_GID: "568"
VOLSYNC_CLAIM: *appname

0 comments on commit 2d258fb

Please sign in to comment.