Skip to content

Commit

Permalink
feat(pgadmin): deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jfroy committed Nov 26, 2024
1 parent 7ae544f commit eb2fbea
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 0 deletions.
1 change: 1 addition & 0 deletions kubernetes/apps/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ resources:
- ./gluetun/ks.yaml
- ./homepage/ks.yaml
- ./media-smb/ks.yaml
- ./pgadmin/ks.yaml
- ./plex/ks.yaml
- ./pocket-id/ks.yaml
- ./prowlarr/ks.yaml
Expand Down
21 changes: 21 additions & 0 deletions kubernetes/apps/default/pgadmin/app/externalsecret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: pgadmin
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword
target:
name: pgadmin-secret
data:
- secretKey: PGADMIN_DEFAULT_EMAIL
remoteRef:
key: pgadmin
property: username
- secretKey: PGADMIN_DEFAULT_PASSWORD
remoteRef:
key: pgadmin
property: password
87 changes: 87 additions & 0 deletions kubernetes/apps/default/pgadmin/app/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
# 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: pgadmin
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 3.5.1
sourceRef:
kind: HelmRepository
name: bjw-s
namespace: flux-system
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
strategy: rollback
retries: 3
values:
defaultPodOptions:
securityContext:
runAsNonRoot: true
runAsUser: 5050
runAsGroup: 5050
fsGroup: 5050
fsGroupChangePolicy: OnRootMismatch
seccompProfile: { type: RuntimeDefault }
controllers:
pgadmin:
annotations:
reloader.stakater.com/auto: "true"
containers:
pgadmin:
image:
repository: docker.io/dpage/pgadmin4
tag: "8.13@sha256:561c1f8f99f2fe24bc63814db9e30292cf4360331de9182da21e3554ce61bdaa"
env:
PGADMIN_DISABLE_POSTFIX: "true"
envFrom:
- secretRef:
name: pgadmin-secret
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
add:
- NET_BIND_SERVICE
service:
pgadmin:
controller: pgadmin
ports:
http:
port: 80
ingress:
pgadmin:
className: internal
annotations:
nginx.ingress.kubernetes.io/auth-url: https://oauth2-proxy.${PUBLIC_DOMAIN0}/oauth2/auth
nginx.ingress.kubernetes.io/auth-signin: https://oauth2-proxy.${PUBLIC_DOMAIN0}/oauth2/start?rd=$scheme://$best_http_host$request_uri
nginx.ingress.kubernetes.io/auth-response-headers: "x-auth-request-email"
hosts:
- host: "${APP_SUBDOMAIN:-${APP}}.${PUBLIC_DOMAIN0}"
paths:
- path: /
service:
identifier: pgadmin
port: http
persistence:
config:
existingClaim: ${APP}
globalMounts:
- path: /var/lib/pgadmin
empty:
type: emptyDir
sizeLimit: 100Mi
globalMounts:
- path: /tmp
subPath: tmp
- path: /var/log
subPath: log
9 changes: 9 additions & 0 deletions kubernetes/apps/default/pgadmin/app/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./externalsecret.yaml
- ./helmrelease.yaml
- ../../../../templates/gatus/guarded
- ../../../../templates/volsync
26 changes: 26 additions & 0 deletions kubernetes/apps/default/pgadmin/ks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app pgadmin
namespace: flux-system
spec:
targetNamespace: default
commonMetadata:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: external-secrets-stores
- name: volsync
path: ./kubernetes/apps/default/pgadmin/app
prune: true
sourceRef:
kind: GitRepository
name: home-kubernetes
wait: false
interval: 30m
postBuild:
substitute:
APP: *app
VOLSYNC_CAPACITY: 100Mi

0 comments on commit eb2fbea

Please sign in to comment.