diff --git a/pgweb/argocd.yaml b/pgweb/argocd.yaml index f794f2c..81e6e47 100644 --- a/pgweb/argocd.yaml +++ b/pgweb/argocd.yaml @@ -8,6 +8,15 @@ metadata: spec: project: default sources: + - repoURL: https://bjw-s.github.io/helm-charts + chart: app-template + targetRevision: 3.6.1 + helm: + valueFiles: + - $values/pgweb/helm-values.yaml + - repoURL: https://github.com/K3S-HOME/storage.git + targetRevision: main + ref: values - repoURL: https://github.com/K3S-HOME/storage.git targetRevision: main path: pgweb diff --git a/pgweb/deployment.yaml b/pgweb/deployment.yaml deleted file mode 100644 index 894042e..0000000 --- a/pgweb/deployment.yaml +++ /dev/null @@ -1,62 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: pgweb - namespace: pgweb - labels: - app: pgweb - annotations: - reloader.stakater.com/auto: "true" -spec: - replicas: 1 - selector: - matchLabels: - app: pgweb - template: - metadata: - labels: - app: pgweb - spec: - containers: - - name: pgweb - image: sosedoff/pgweb:0.17.0 - ports: - - containerPort: 8081 - name: http - env: - - name: DATABASE_URL - valueFrom: - secretKeyRef: - name: pgweb-password - key: database-url - args: - - "--bind=0.0.0.0" - - "--listen=8081" - resources: - requests: - memory: "64Mi" - cpu: "5m" # Reduced from 50m based on actual usage (1m) - livenessProbe: - tcpSocket: - port: 8081 - initialDelaySeconds: 10 - periodSeconds: 10 - readinessProbe: - tcpSocket: - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 5 ---- -apiVersion: v1 -kind: Service -metadata: - name: pgweb - namespace: pgweb -spec: - type: ClusterIP - ports: - - name: http - port: 80 - targetPort: 8081 - selector: - app: pgweb diff --git a/pgweb/helm-values.yaml b/pgweb/helm-values.yaml new file mode 100644 index 0000000..3f0db9f --- /dev/null +++ b/pgweb/helm-values.yaml @@ -0,0 +1,76 @@ +# pgweb - bjw-s/app-template values +# PostgreSQL Web UI + +controllers: + main: + annotations: + reloader.stakater.com/auto: "true" + containers: + main: + image: + repository: sosedoff/pgweb + tag: "0.17.0" + args: + - "--bind=0.0.0.0" + - "--listen=8081" + env: + DATABASE_URL: + valueFrom: + secretKeyRef: + name: pgweb-password + key: database-url + resources: + requests: + cpu: 5m + memory: 64Mi + probes: + liveness: + enabled: true + custom: true + spec: + tcpSocket: + port: 8081 + initialDelaySeconds: 10 + periodSeconds: 10 + readiness: + enabled: true + custom: true + spec: + tcpSocket: + port: 8081 + initialDelaySeconds: 5 + periodSeconds: 5 + +service: + main: + controller: main + ports: + http: + port: 80 + targetPort: 8081 + +ingress: + main: + enabled: true + className: traefik + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod + traefik.ingress.kubernetes.io/router.middlewares: authelia-authelia-auth@kubernetescrd + hosts: + - host: pgweb0213.kro.kr + paths: + - path: / + service: + identifier: main + port: http + - host: www.pgweb0213.kro.kr + paths: + - path: / + service: + identifier: main + port: http + tls: + - secretName: pgweb-tls + hosts: + - pgweb0213.kro.kr + - www.pgweb0213.kro.kr diff --git a/pgweb/ingress.yaml b/pgweb/ingress.yaml deleted file mode 100644 index 8e486ad..0000000 --- a/pgweb/ingress.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: pgweb-ingress - namespace: pgweb - annotations: - cert-manager.io/cluster-issuer: "letsencrypt-prod" - traefik.ingress.kubernetes.io/router.middlewares: authelia-authelia-auth@kubernetescrd -spec: - ingressClassName: traefik - tls: - - hosts: - - pgweb0213.kro.kr - - www.pgweb0213.kro.kr - secretName: pgweb-tls - rules: - - host: pgweb0213.kro.kr - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: pgweb - port: - number: 80 - - host: www.pgweb0213.kro.kr - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: pgweb - port: - number: 80 diff --git a/pgweb/kustomization.yaml b/pgweb/kustomization.yaml index 7a8d974..1bb4df4 100644 --- a/pgweb/kustomization.yaml +++ b/pgweb/kustomization.yaml @@ -1,6 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- deployment.yaml - vault/pgweb-secret.yaml -- ingress.yaml