Postgresus Helm Chart #376

Closed
opened 2026-04-05 16:16:19 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @akalitenya on 12/4/2025

It is a good practice to create a separate github repo for helm charts (named postgresus-helm-charts with a directory "postgresus" inside).

Code example to publish helm release to ghcr:

helm package postgresus

export CHART_VERSION=$(grep 'version:' ./postgresus/Chart.yaml | tail -n1 | awk '{ print $2 }') \
  && helm push postgresus-${CHART_VERSION}.tgz oci://ghcr.io/RostislavDugin/postgresus-helm-charts

Here is a result of default configuration. Service of type LoadBalancer is auto created without the ability to disable it. Which in most cases does provision a real cloud load balancer (AWS ELB, GCP Cloud Load Balancer, Azure Load Balancer, DigitalOcean Load Balancer, etc.). That costs $.

Consider to disable LoadBalancer creation from values.yaml or remove it from chart completely.

helm template postgresus ./deploy/helm -n postgresus

---
# Source: postgresus/templates/namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: postgresus
  labels:
    helm.sh/chart: postgresus-1.0.0
    app.kubernetes.io/name: postgresus
    app.kubernetes.io/instance: postgresus
    app: postgresus
    app.kubernetes.io/version: "v1.45.3"
    app.kubernetes.io/managed-by: Helm
---
# Source: postgresus/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: postgresus-service
  namespace: postgresus
  labels:
    helm.sh/chart: postgresus-1.0.0
    app.kubernetes.io/name: postgresus
    app.kubernetes.io/instance: postgresus
    app: postgresus
    app.kubernetes.io/version: "v1.45.3"
    app.kubernetes.io/managed-by: Helm
spec:
  type: LoadBalancer
  ports:
    - port: 80
      targetPort: 4005
      protocol: TCP
      name: http
  selector:
    app.kubernetes.io/name: postgresus
    app.kubernetes.io/instance: postgresus
    app: postgresus
---
# Source: postgresus/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: postgresus-headless
  namespace: postgresus
  labels:
    helm.sh/chart: postgresus-1.0.0
    app.kubernetes.io/name: postgresus
    app.kubernetes.io/instance: postgresus
    app: postgresus
    app.kubernetes.io/version: "v1.45.3"
    app.kubernetes.io/managed-by: Helm
spec:
  type: ClusterIP
  clusterIP: None
  ports:
    - port: 80
      targetPort: 4005
      protocol: TCP
      name: http
  selector:
    app.kubernetes.io/name: postgresus
    app.kubernetes.io/instance: postgresus
    app: postgresus
---
# Source: postgresus/templates/statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: postgresus
  namespace: postgresus
  labels:
    helm.sh/chart: postgresus-1.0.0
    app.kubernetes.io/name: postgresus
    app.kubernetes.io/instance: postgresus
    app: postgresus
    app.kubernetes.io/version: "v1.45.3"
    app.kubernetes.io/managed-by: Helm
spec:
  serviceName: postgresus-headless
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: postgresus
      app.kubernetes.io/instance: postgresus
      app: postgresus
  template:
    metadata:
      annotations:
      labels:
        app.kubernetes.io/name: postgresus
        app.kubernetes.io/instance: postgresus
        app: postgresus
    spec:
      containers:
        - name: postgresus
          image: "rostislavdugin/postgresus:latest"
          imagePullPolicy: Always
          ports:
            - name: http
              containerPort: 4005
              protocol: TCP
          volumeMounts:
            - name: postgresus-storage
              mountPath: /postgresus-data
          resources:
            limits:
              cpu: 500m
              memory: 1Gi
            requests:
              cpu: 500m
              memory: 1Gi
          livenessProbe:
            httpGet:
              path: /api/v1/system/health
              port: 4005
            initialDelaySeconds: 30
            periodSeconds: 10
            timeoutSeconds: 5
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /api/v1/system/health
              port: 4005
            initialDelaySeconds: 10
            periodSeconds: 5
            timeoutSeconds: 3
            failureThreshold: 3
  volumeClaimTemplates:
    - metadata:
        name: postgresus-storage
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 10Gi
  updateStrategy:
    rollingUpdate:
      partition: 0
    type: RollingUpdate
*Originally created by @akalitenya on 12/4/2025* It is a good practice to create a separate github repo for helm charts (named postgresus-helm-charts with a directory "postgresus" inside). Code example to publish helm release to ghcr: ``` helm package postgresus export CHART_VERSION=$(grep 'version:' ./postgresus/Chart.yaml | tail -n1 | awk '{ print $2 }') \ && helm push postgresus-${CHART_VERSION}.tgz oci://ghcr.io/RostislavDugin/postgresus-helm-charts ``` Here is a result of default configuration. Service of type LoadBalancer is auto created without the ability to disable it. Which in most cases does provision a real cloud load balancer (AWS ELB, GCP Cloud Load Balancer, Azure Load Balancer, DigitalOcean Load Balancer, etc.). That costs $. Consider to disable LoadBalancer creation from values.yaml or remove it from chart completely. helm template postgresus ./deploy/helm -n postgresus ``` --- # Source: postgresus/templates/namespace.yaml apiVersion: v1 kind: Namespace metadata: name: postgresus labels: helm.sh/chart: postgresus-1.0.0 app.kubernetes.io/name: postgresus app.kubernetes.io/instance: postgresus app: postgresus app.kubernetes.io/version: "v1.45.3" app.kubernetes.io/managed-by: Helm --- # Source: postgresus/templates/service.yaml apiVersion: v1 kind: Service metadata: name: postgresus-service namespace: postgresus labels: helm.sh/chart: postgresus-1.0.0 app.kubernetes.io/name: postgresus app.kubernetes.io/instance: postgresus app: postgresus app.kubernetes.io/version: "v1.45.3" app.kubernetes.io/managed-by: Helm spec: type: LoadBalancer ports: - port: 80 targetPort: 4005 protocol: TCP name: http selector: app.kubernetes.io/name: postgresus app.kubernetes.io/instance: postgresus app: postgresus --- # Source: postgresus/templates/service.yaml apiVersion: v1 kind: Service metadata: name: postgresus-headless namespace: postgresus labels: helm.sh/chart: postgresus-1.0.0 app.kubernetes.io/name: postgresus app.kubernetes.io/instance: postgresus app: postgresus app.kubernetes.io/version: "v1.45.3" app.kubernetes.io/managed-by: Helm spec: type: ClusterIP clusterIP: None ports: - port: 80 targetPort: 4005 protocol: TCP name: http selector: app.kubernetes.io/name: postgresus app.kubernetes.io/instance: postgresus app: postgresus --- # Source: postgresus/templates/statefulset.yaml apiVersion: apps/v1 kind: StatefulSet metadata: name: postgresus namespace: postgresus labels: helm.sh/chart: postgresus-1.0.0 app.kubernetes.io/name: postgresus app.kubernetes.io/instance: postgresus app: postgresus app.kubernetes.io/version: "v1.45.3" app.kubernetes.io/managed-by: Helm spec: serviceName: postgresus-headless replicas: 1 selector: matchLabels: app.kubernetes.io/name: postgresus app.kubernetes.io/instance: postgresus app: postgresus template: metadata: annotations: labels: app.kubernetes.io/name: postgresus app.kubernetes.io/instance: postgresus app: postgresus spec: containers: - name: postgresus image: "rostislavdugin/postgresus:latest" imagePullPolicy: Always ports: - name: http containerPort: 4005 protocol: TCP volumeMounts: - name: postgresus-storage mountPath: /postgresus-data resources: limits: cpu: 500m memory: 1Gi requests: cpu: 500m memory: 1Gi livenessProbe: httpGet: path: /api/v1/system/health port: 4005 initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: httpGet: path: /api/v1/system/health port: 4005 initialDelaySeconds: 10 periodSeconds: 5 timeoutSeconds: 3 failureThreshold: 3 volumeClaimTemplates: - metadata: name: postgresus-storage spec: accessModes: - ReadWriteOnce resources: requests: storage: 10Gi updateStrategy: rollingUpdate: partition: 0 type: RollingUpdate ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/databasus#376