Skip to content

SGShardedCluster is not starting

Summary

I'm trying to create an SGSharded cluster

❯ kubectl get pods -n stackgres-db 
NAME                READY   STATUS                  RESTARTS       AGE
test-coord-0    0/6     Init:CrashLoopBackOff   6 (2m3s ago)   8m14s
test-shard0-0   0/6     Init:CrashLoopBackOff   6 (108s ago)   8m12s
test-shard1-0   0/6     Init:CrashLoopBackOff   6 (88s ago)    8m10s
test-shard2-0   6/6     Running                 0              8m6s

and I got this error:

❯ kubectl logs -n stackgres-db db-coord-0 -c relocate-binaries
+ set -eu
+ mkdir -p /var/lib/postgresql/extensions/16/6
mkdir: cannot create directory '/var/lib/postgresql/extensions': Permission denied

Steps to reproduce

1- Create a minikube cluster with 4 nodes 2- Create the sgshardingcluster basic configuration 3- deploy the SGShardedCluster:

apiVersion: stackgres.io/v1alpha1
kind: SGShardedCluster
metadata:
  name: test
  namespace: stackgres-db
spec:
  configurations:
  postgres:
    version: '16.0'
  type: citus
  database: 'test'
  profile: production
  coordinator:
    instances: 2
    sgInstanceProfile: coordinator
    configurations:
      sgPostgresConfig: 'pgconfig-coordinator'
    pods:
      persistentVolume:
        size: '10Gi'
  shards:
    clusters: 3
    instancesPerCluster: 1
    sgInstanceProfile: shards
    configurations:
      sgPostgresConfig: 'pgconfig-shards'
    pods:
      persistentVolume:
        size: '10Gi'
  prometheusAutobind: true
  nonProductionOptions:
    disableClusterPodAntiAffinity: true

Expected Behaviour

  • The SGShardedCluster start successfully

Environment

  • StackGres version: 1.10.0
  • Kubernetes version: 1.28.3
  • Cloud provider or hardware configuration: minikube

Relevant logs and/or screenshots

pod_sg_failed.yaml