0

I'm quite new to kubernetes/terraform. Using Minikube.

These operations are quite simple, but I'm stuck.. It seems that after creating the kubeDB operator and the pg CRD object, the postgres cluster is not being deployed.

Here is what I'm doing in terraform to create the kubeDB operator:

resource "helm_release" "kubedb" {
  name       = "kubedb"
  repository = "https://charts.appscode.com/stable/"
  chart      = "kubedb"
  namespace  = "db-ha-zone1"
  version    = "v2022.02.22"
  
  set {
    name  = "global.license"
    value = "${file(".license.txt")}"
  }
}
Result is :
kubectl get pods
NAME                                            READY   STATUS    RESTARTS   AGE
kubedb-kubedb-provisioner-656c55fff5-zjgnv      1/1     Running   0          2m35s
kubedb-kubedb-webhook-server-7cb4bdd8f4-ns7j6   1/1     Running   0          2m35s

After I create the pg CRD with this yaml source :

apiVersion: kubedb.com/v1alpha2
kind: Postgres
metadata:
  name: hot-postgres
  namespace: db-ha-zone1
spec:
  version: "14.2"
  replicas: 3
  standbyMode: Hot
  authSecret:
    name: postgres-auth
  storageType: Durable
  storage:
    storageClassName: "standard"
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 2Gi
  terminationPolicy: DoNotTerminate

using a simple kubectl apply -f postgres.yaml.

Resource is created :

kubectl get pg 
NAME           VERSION   STATUS   AGE 
hot-postgres   14.2               39s

But nothing happens afterward..

Could you please help me find out what I'm missing here ?

Thanks in advance for your help

I'm expecting the cluster primary pod and replicas to be deployed by the kubedb operator

Phil
  • 57
  • 6
  • 1
    Please [edit] your question title to something other than a repetition of the tag information. Your title should explain the problem you're having or question you're asking, and should be clear and descriptive enough to have meaning to a future site user who is skimming a list of search results trying to find a solution to a problem. Your current title is useless in that sense, because it's just a regurgitation of the tags. The better your title is, the easier it is for people who can answer your question can find it. – Ken White Mar 24 '22 at 02:26

1 Answers1

1

Found the answer :-)

I just went to check the provisioner pods logs with :

kubectl logs kubedb-kubedb-provisioner-xxxx

and found it that by defaut it is restricted to a demo namespace, therefore probably it won't find the CRD descriptor in my customized namespace.

logs for info :

1 operator.go:38] Starting kubedb-provisioner...
1 client_config.go:615] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
1 controller.go:66] Initializing StatefulSet watcher.....
1 operator.go:206] Operator restricted to demo namespace

Phil
  • 57
  • 6