Orange-OpenSource / galera-operator

Galera Operator automates tasks for managing a Galera cluster in Kubernetes
Apache License 2.0
34 stars 18 forks source link

Deployment stuck at "Desired 3" - "Current 0" #13

Closed God-Zalo closed 4 years ago

God-Zalo commented 4 years ago

Followed the instructions at the examples-manifests, using "Three member cluster" example, galera-operator is deployed using the kustomize found in #12

Then manually running kubectl create -f <galera-cluster>.yaml deployment get stuck at Desired 3 - Current 0

This is what I could get my hands on:

galera-operator check:

kubectl get deployments.apps --namespace galera
NAME              READY   UP-TO-DATE   AVAILABLE   AGE
galera-operator   1/1     1            1           62m

crd's check:

$ kubectl get crd
NAME                           CREATED AT
addons.k3s.cattle.io           2020-09-30T00:37:13Z
helmcharts.helm.cattle.io      2020-09-30T00:37:13Z
galeras.sql.databases          2020-09-30T00:38:01Z
galerabackups.sql.databases    2020-09-30T00:39:26Z
upgradeconfigs.sql.databases   2020-09-30T00:39:27Z
upgraderules.sql.databases     2020-09-30T00:40:01Z

Config map is embebed with yaml below, using the default provided in the spec example, nothing changed,

Full yaml (skipping configmap data):

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: galeraconf
  namespace: galera
data:
...

---
apiVersion: sql.databases/v1beta2
kind: Galera
metadata:
  name: zalo1
  namespace: galera
  ## Adding this annotation make this cluster managed by clusterwide operators
  ## namespaced operators ignore it
  #annotations:
  #  sql.databases/scope: clusterwide
  labels:
    stage: dev
    owner: sebs42
spec:
  replicas: 3
  pod:
    credentialsSecret:
      name: galera-secret
    image: sebs42/mariadb:10.4.2-bionic
    mycnfConfigMap:
      name: galeraconf
    env:
      - name: MYSQL_ROOT_PASSWORD
        value: $ROOTPASSWORD
  persistentVolumeClaimSpec:
    accessModes: [ "ReadWriteOnce" ]
    storageClassName: $STORAGECLASS
    resources:
      requests:
        storage: 5Gi

Outputs:

NAMESPACE   NAME    DESIRED   CURRENT   AGE   PHASE   IMAGE                          METRICIMAGE   SPECIAL
galera      zalo1   3                   23m           sebs42/mariadb:10.4.2-bionic                 

Description of cluster deployment:

$ kubectl describe galeras.sql.databases/zalo1 --namespace galera
Name:         zalo1
Namespace:    galera
Labels:       owner=sebs42
              stage=dev
Annotations:  <none>
API Version:  sql.databases/v1beta2
Kind:         Galera
Metadata:
  Creation Timestamp:  2020-09-30T00:48:21Z
  Generation:          1
  Managed Fields:
    API Version:  sql.databases/v1beta2
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:labels:
          .:
          f:owner:
          f:stage:
      f:spec:
        .:
        f:persistentVolumeClaimSpec:
          .:
          f:accessModes:
          f:resources:
            .:
            f:requests:
              .:
              f:storage:
          f:storageClassName:
        f:pod:
          .:
          f:credentialsSecret:
            .:
            f:name:
          f:env:
          f:image:
          f:mycnfConfigMap:
            .:
            f:name:
        f:replicas:
    Manager:      kubectl-create
    Operation:    Update
    Time:         2020-09-30T00:48:21Z
    API Version:  sql.databases/v1beta2
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:kubectl.kubernetes.io/last-applied-configuration:
    Manager:         kubectl-client-side-apply
    Operation:       Update
    Time:            2020-09-30T00:57:57Z
  Resource Version:  1794
  Self Link:         /apis/sql.databases/v1beta2/namespaces/galera/galeras/zalo1
  UID:               84b75575-9646-41b6-81c5-6ffdcfd7098f
Spec:
  Persistent Volume Claim Spec:
    Access Modes:
      ReadWriteOnce
    Resources:
      Requests:
        Storage:         5Gi
    Storage Class Name:  $STORAGECLASS
  Pod:
    Credentials Secret:
      Name:  galera-secret
    Env:
      Name:   MYSQL_ROOT_PASSWORD
      Value:  $ROOTPASSWORD
    Image:    sebs42/mariadb:10.4.2-bionic
    Mycnf Config Map:
      Name:  galeraconf
  Replicas:  3
Events:      <none>

The only error message found was with:

$ kubectl logs galeras.sql.databases/zalo1 --namespace galera
error: no kind "Galera" is registered for version "sql.databases/v1beta2" in scheme "k8s.io/kubectl/pkg/scheme/scheme.go:28"
sebs42 commented 4 years ago

Hello,

can you let us know which K8S version is running ?

Can you give us all informations about the Galera CRD : kubectl get crd galeras.sql.databases -o yaml to see if there is something wrong with the CRD deployment.

God-Zalo commented 4 years ago

Thanks for your reply

$ kubectl version                          
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.1", GitCommit:"206bcadf021e76c27513500ca24182692aabd17e", GitTreeState:"archive", BuildDate:"1980-01-01T00:00:00Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.6+k3s1", GitCommit:"6f56fa1d68a5a48b8b6fdefa8eb7ead2015a4b3a", GitTreeState:"clean", BuildDate:"2020-07-16T20:46:15Z", GoVersion:"go1.13.11", Compiler:"gc", Platform:"linux/amd64"}
$ kubectl get crd galeras.sql.databases -o yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"apiextensions.k8s.io/v1beta1","kind":"CustomResourceDefinition","metadata":{"annotations":{},"labels":{"app":"galera-operator","app.kubernetes.io/managed-by":"skaffold","skaffold.dev/run-id":"c05f7898-c34c-46fa-98c4-1bb98ce98cb6"},"name":"galeras.sql.databases"},"spec":{"additionalPrinterColumns":[{"JSONPath":".spec.replicas","description":"The number of desired Replicas","name":"Desired","priority":0,"type":"integer"},{"JSONPath":".status.replicas","description":"The number of current Replicas","name":"Current","priority":0,"type":"integer"},{"JSONPath":".metadata.creationTimestamp","name":"Age","priority":0,"type":"date"},{"JSONPath":".status.phase","name":"Phase","type":"string"},{"JSONPath":".spec.pod.image","description":"Desired image","name":"Image","type":"string"},{"JSONPath":".spec.pod.metric.image","description":"Desired metric image","name":"MetricImage","type":"string"},{"JSONPath":".status.members.special","description":"Special pod","name":"Special","type":"string"}],"group":"sql.databases","names":{"categories":["all"],"kind":"Galera","listKind":"GaleraList","plural":"galeras","shortNames":["gl"],"singular":"galera"},"scope":"Namespaced","subresources":{"scale":{"specReplicasPath":".spec.replicas","statusReplicasPath":".status.replicas"},"status":{}},"validation":{"openAPIV3Schema":{"properties":{"spec":{"properties":{"persistentVolumeClaimSpec":{"type":"object"},"pod":{"properties":{"image":{"type":"string"},"metric":{"type":"object"},"priorityClassName":{"type":"string"},"securityContext":{"type":"object"},"sidecarImage":{"type":"string"}},"required":["image"],"type":"object"},"replicas":{"enum":[3,5,6,7,9],"format":"int32","type":"integer"},"revisionHistoryLimit":{"format":"int32","type":"integer"},"special":{"type":"object"}},"required":["replicas","pod","persistentVolumeClaimSpec"],"type":"object"},"status":{"properties":{"collisionCount":{"format":"int32","type":"integer"},"currentReplicas":{"format":"int32","type":"integer"},"currentRevision":{"type":"string"},"headlessService":{"type":"string"},"nextReplicas":{"format":"int32","type":"integer"},"nextRevision":{"type":"string"},"observedGeneration":{"format":"int64","type":"integer"},"phase":{"type":"string"},"podDisruptionBudgetName":{"type":"string"},"replics":{"format":"int32","type":"integer"},"serviceMonitor":{"type":"string"},"serviceReader":{"type":"string"},"serviceSpecial":{"type":"string"},"serviceWriter":{"type":"string"},"serviceWriterBackup":{"type":"string"}},"type":"object"}},"required":["spec"],"type":"object"}},"versions":[{"name":"v1beta2","served":true,"storage":true}]}}
  creationTimestamp: "2020-09-30T16:29:37Z"
  generation: 1
  labels:
    app: galera-operator
    app.kubernetes.io/managed-by: skaffold
    skaffold.dev/run-id: c05f7898-c34c-46fa-98c4-1bb98ce98cb6
  managedFields:
  - apiVersion: apiextensions.k8s.io/v1
    fieldsType: FieldsV1
    fieldsV1:
      f:status:
        f:acceptedNames:
          f:categories: {}
          f:kind: {}
          f:listKind: {}
          f:plural: {}
          f:shortNames: {}
          f:singular: {}
        f:conditions: {}
    manager: k3s
    operation: Update
    time: "2020-09-30T16:29:37Z"
  - apiVersion: apiextensions.k8s.io/v1beta1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .: {}
          f:kubectl.kubernetes.io/last-applied-configuration: {}
        f:labels:
          .: {}
          f:app: {}
          f:app.kubernetes.io/managed-by: {}
          f:skaffold.dev/run-id: {}
      f:spec:
        f:additionalPrinterColumns: {}
        f:conversion:
          .: {}
          f:strategy: {}
        f:group: {}
        f:names:
          f:categories: {}
          f:kind: {}
          f:listKind: {}
          f:plural: {}
          f:shortNames: {}
          f:singular: {}
        f:preserveUnknownFields: {}
        f:scope: {}
        f:subresources:
          .: {}
          f:scale:
            .: {}
            f:specReplicasPath: {}
            f:statusReplicasPath: {}
          f:status: {}
        f:validation:
          .: {}
          f:openAPIV3Schema:
            .: {}
            f:properties:
              .: {}
              f:spec:
                .: {}
                f:properties:
                  .: {}
                  f:persistentVolumeClaimSpec:
                    .: {}
                    f:type: {}
                  f:pod:
                    .: {}
                    f:properties:
                      .: {}
                      f:image:
                        .: {}
                        f:type: {}
                      f:metric:
                        .: {}
                        f:type: {}
                      f:priorityClassName:
                        .: {}
                        f:type: {}
                      f:securityContext:
                        .: {}
                        f:type: {}
                      f:sidecarImage:
                        .: {}
                        f:type: {}
                    f:required: {}
                    f:type: {}
                  f:replicas:
                    .: {}
                    f:enum: {}
                    f:format: {}
                    f:type: {}
                  f:revisionHistoryLimit:
                    .: {}
                    f:format: {}
                    f:type: {}
                  f:special:
                    .: {}
                    f:type: {}
                f:required: {}
                f:type: {}
              f:status:
                .: {}
                f:properties:
                  .: {}
                  f:collisionCount:
                    .: {}
                    f:format: {}
                    f:type: {}
                  f:currentReplicas:
                    .: {}
                    f:format: {}
                    f:type: {}
                  f:currentRevision:
                    .: {}
                    f:type: {}
                  f:headlessService:
                    .: {}
                    f:type: {}
                  f:nextReplicas:
                    .: {}
                    f:format: {}
                    f:type: {}
                  f:nextRevision:
                    .: {}
                    f:type: {}
                  f:observedGeneration:
                    .: {}
                    f:format: {}
                    f:type: {}
                  f:phase:
                    .: {}
                    f:type: {}
                  f:podDisruptionBudgetName:
                    .: {}
                    f:type: {}
                  f:replics:
                    .: {}
                    f:format: {}
                    f:type: {}
                  f:serviceMonitor:
                    .: {}
                    f:type: {}
                  f:serviceReader:
                    .: {}
                    f:type: {}
                  f:serviceSpecial:
                    .: {}
                    f:type: {}
                  f:serviceWriter:
                    .: {}
                    f:type: {}
                  f:serviceWriterBackup:
                    .: {}
                    f:type: {}
                f:type: {}
            f:required: {}
            f:type: {}
        f:version: {}
        f:versions: {}
      f:status:
        f:storedVersions: {}
    manager: kubectl-client-side-apply
    operation: Update
    time: "2020-09-30T16:29:37Z"
  name: galeras.sql.databases
  resourceVersion: "4762"
  selfLink: /apis/apiextensions.k8s.io/v1/customresourcedefinitions/galeras.sql.databases
  uid: d3681a18-5349-4f21-877a-aa270ce2701e
spec:
  conversion:
    strategy: None
  group: sql.databases
  names:
    categories:
    - all
    kind: Galera
    listKind: GaleraList
    plural: galeras
    shortNames:
    - gl
    singular: galera
  preserveUnknownFields: true
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - description: The number of desired Replicas
      jsonPath: .spec.replicas
      name: Desired
      type: integer
    - description: The number of current Replicas
      jsonPath: .status.replicas
      name: Current
      type: integer
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    - jsonPath: .status.phase
      name: Phase
      type: string
    - description: Desired image
      jsonPath: .spec.pod.image
      name: Image
      type: string
    - description: Desired metric image
      jsonPath: .spec.pod.metric.image
      name: MetricImage
      type: string
    - description: Special pod
      jsonPath: .status.members.special
      name: Special
      type: string
    name: v1beta2
    schema:
      openAPIV3Schema:
        properties:
          spec:
            properties:
              persistentVolumeClaimSpec:
                type: object
              pod:
                properties:
                  image:
                    type: string
                  metric:
                    type: object
                  priorityClassName:
                    type: string
                  securityContext:
                    type: object
                  sidecarImage:
                    type: string
                required:
                - image
                type: object
              replicas:
                enum:
                - 3
                - 5
                - 6
                - 7
                - 9
                format: int32
                type: integer
              revisionHistoryLimit:
                format: int32
                type: integer
              special:
                type: object
            required:
            - replicas
            - pod
            - persistentVolumeClaimSpec
            type: object
          status:
            properties:
              collisionCount:
                format: int32
                type: integer
              currentReplicas:
                format: int32
                type: integer
              currentRevision:
                type: string
              headlessService:
                type: string
              nextReplicas:
                format: int32
                type: integer
              nextRevision:
                type: string
              observedGeneration:
                format: int64
                type: integer
              phase:
                type: string
              podDisruptionBudgetName:
                type: string
              replics:
                format: int32
                type: integer
              serviceMonitor:
                type: string
              serviceReader:
                type: string
              serviceSpecial:
                type: string
              serviceWriter:
                type: string
              serviceWriterBackup:
                type: string
            type: object
        required:
        - spec
        type: object
    served: true
    storage: true
    subresources:
      scale:
        specReplicasPath: .spec.replicas
        statusReplicasPath: .status.replicas
      status: {}
status:
  acceptedNames:
    categories:
    - all
    kind: Galera
    listKind: GaleraList
    plural: galeras
    shortNames:
    - gl
    singular: galera
  conditions:
  - lastTransitionTime: "2020-09-30T16:29:37Z"
    message: no conflicts found
    reason: NoConflicts
    status: "True"
    type: NamesAccepted
  - lastTransitionTime: "2020-09-30T16:29:37Z"
    message: the initial names have been accepted
    reason: InitialNamesAccepted
    status: "True"
    type: Established
  storedVersions:
  - v1beta2
sebs42 commented 4 years ago

Thank for the files,

you deployed using skaffold, can you try to not use it and to deploy the crd yamls as described in the example. I do not use it and I have a quick view on it, I see some issues with CRD, so to be sure it is not coming from this product, let's try without it and let us know if threre is still a problem.

God-Zalo commented 4 years ago

Thanks for your reply, our organization main deployments are made using skaffold, could you care sharing what issues you found with the CRD's? maybe there's some patch/fix I could manage.

sebs42 commented 4 years ago

I just found thinks like that, some are fixed other seems to be open : https://github.com/GoogleContainerTools/skaffold/issues/1737#

It was just to be sure it was not a problem with this tool

God-Zalo commented 4 years ago

Hi sebs, thanks for your time, tried deploying the same yamls manually without skaffold and got same result:

Snippet for $ kubectl get crd galeras.sql.databases -o yaml:

Output ``` apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: "2020-10-01T23:20:10Z" generation: 1 managedFields: - apiVersion: apiextensions.k8s.io/v1 fieldsType: FieldsV1 fieldsV1: f:status: f:acceptedNames: f:categories: {} f:kind: {} f:listKind: {} f:plural: {} f:shortNames: {} f:singular: {} f:conditions: {} manager: k3s operation: Update time: "2020-10-01T23:20:10Z" - apiVersion: apiextensions.k8s.io/v1beta1 fieldsType: FieldsV1 fieldsV1: f:spec: f:additionalPrinterColumns: {} f:conversion: .: {} f:strategy: {} f:group: {} f:names: f:categories: {} f:kind: {} f:listKind: {} f:plural: {} f:shortNames: {} f:singular: {} f:preserveUnknownFields: {} f:scope: {} f:subresources: .: {} f:scale: .: {} f:specReplicasPath: {} f:statusReplicasPath: {} f:status: {} f:validation: .: {} f:openAPIV3Schema: .: {} f:properties: .: {} f:spec: .: {} f:properties: .: {} f:persistentVolumeClaimSpec: .: {} f:type: {} f:pod: .: {} f:properties: .: {} f:image: .: {} f:type: {} f:metric: .: {} f:type: {} f:priorityClassName: .: {} f:type: {} f:securityContext: .: {} f:type: {} f:sidecarImage: .: {} f:type: {} f:required: {} f:type: {} f:replicas: .: {} f:enum: {} f:format: {} f:type: {} f:revisionHistoryLimit: .: {} f:format: {} f:type: {} f:special: .: {} f:type: {} f:required: {} f:type: {} f:status: .: {} f:properties: .: {} f:collisionCount: .: {} f:format: {} f:type: {} f:currentReplicas: .: {} f:format: {} f:type: {} f:currentRevision: .: {} f:type: {} f:headlessService: .: {} f:type: {} f:nextReplicas: .: {} f:format: {} f:type: {} f:nextRevision: .: {} f:type: {} f:observedGeneration: .: {} f:format: {} f:type: {} f:phase: .: {} f:type: {} f:podDisruptionBudgetName: .: {} f:type: {} f:replics: .: {} f:format: {} f:type: {} f:serviceMonitor: .: {} f:type: {} f:serviceReader: .: {} f:type: {} f:serviceSpecial: .: {} f:type: {} f:serviceWriter: .: {} f:type: {} f:serviceWriterBackup: .: {} f:type: {} f:type: {} f:required: {} f:type: {} f:version: {} f:versions: {} f:status: f:storedVersions: {} manager: kubectl-create operation: Update time: "2020-10-01T23:20:10Z" name: galeras.sql.databases resourceVersion: "937" selfLink: /apis/apiextensions.k8s.io/v1/customresourcedefinitions/galeras.sql.databases uid: a134df36-615b-49cb-ad47-2b3270a160a7 spec: conversion: strategy: None group: sql.databases names: categories: - all kind: Galera listKind: GaleraList plural: galeras shortNames: - gl singular: galera preserveUnknownFields: true scope: Namespaced versions: - additionalPrinterColumns: - description: The number of desired Replicas jsonPath: .spec.replicas name: Desired type: integer - description: The number of current Replicas jsonPath: .status.replicas name: Current type: integer - jsonPath: .metadata.creationTimestamp name: Age type: date - jsonPath: .status.phase name: Phase type: string - description: Desired image jsonPath: .spec.pod.image name: Image type: string - description: Desired metric image jsonPath: .spec.pod.metric.image name: MetricImage type: string - description: Special pod jsonPath: .status.members.special name: Special type: string name: v1beta2 schema: openAPIV3Schema: properties: spec: properties: persistentVolumeClaimSpec: type: object pod: properties: image: type: string metric: type: object priorityClassName: type: string securityContext: type: object sidecarImage: type: string required: - image type: object replicas: enum: - 3 - 5 - 6 - 7 - 9 format: int32 type: integer revisionHistoryLimit: format: int32 type: integer special: type: object required: - replicas - pod - persistentVolumeClaimSpec type: object status: properties: collisionCount: format: int32 type: integer currentReplicas: format: int32 type: integer currentRevision: type: string headlessService: type: string nextReplicas: format: int32 type: integer nextRevision: type: string observedGeneration: format: int64 type: integer phase: type: string podDisruptionBudgetName: type: string replics: format: int32 type: integer serviceMonitor: type: string serviceReader: type: string serviceSpecial: type: string serviceWriter: type: string serviceWriterBackup: type: string type: object required: - spec type: object served: true storage: true subresources: scale: specReplicasPath: .spec.replicas statusReplicasPath: .status.replicas status: {} status: acceptedNames: categories: - all kind: Galera listKind: GaleraList plural: galeras shortNames: - gl singular: galera conditions: - lastTransitionTime: "2020-10-01T23:20:10Z" message: no conflicts found reason: NoConflicts status: "True" type: NamesAccepted - lastTransitionTime: "2020-10-01T23:20:10Z" message: the initial names have been accepted reason: InitialNamesAccepted status: "True" type: Established storedVersions: - v1beta2 ```

And same output for $ kubectl logs galeras.sql.databases/zalo1 --namespace galera

error: no kind "Galera" is registered for version "sql.databases/v1beta2" in scheme "k8s.io/kubectl/pkg/scheme/scheme.go:28"

How should the output for the crd's look like? I'm somewhat new to operators and kubernetes in general

God-Zalo commented 4 years ago

Update:

Dumb me forgot to add galerabackup-crd.yaml and upgradeconfig.yaml on kustomization.yaml, after that, crds look like this:

expand `$ kubectl get crd galeras.sql.databases -o yaml` ``` apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"apiextensions.k8s.io/v1beta1","kind":"CustomResourceDefinition","metadata":{"annotations":{},"labels":{"app":"galera-operator","app.kubernetes.io/managed-by":"skaffold","component":"operator","name":"galera-operator","skaffold.dev/run-id":"3ad0808d-0837-4618-be06-92c04d665fe9"},"name":"galeras.sql.databases"},"spec":{"additionalPrinterColumns":[{"JSONPath":".spec.replicas","description":"The number of desired Replicas","name":"Desired","priority":0,"type":"integer"},{"JSONPath":".status.replicas","description":"The number of current Replicas","name":"Current","priority":0,"type":"integer"},{"JSONPath":".metadata.creationTimestamp","name":"Age","priority":0,"type":"date"},{"JSONPath":".status.phase","name":"Phase","type":"string"},{"JSONPath":".spec.pod.image","description":"Desired image","name":"Image","type":"string"},{"JSONPath":".spec.pod.metric.image","description":"Desired metric image","name":"MetricImage","type":"string"},{"JSONPath":".status.members.special","description":"Special pod","name":"Special","type":"string"}],"group":"sql.databases","names":{"categories":["all"],"kind":"Galera","listKind":"GaleraList","plural":"galeras","shortNames":["gl"],"singular":"galera"},"scope":"Namespaced","subresources":{"scale":{"specReplicasPath":".spec.replicas","statusReplicasPath":".status.replicas"},"status":{}},"validation":{"openAPIV3Schema":{"properties":{"spec":{"properties":{"persistentVolumeClaimSpec":{"type":"object"},"pod":{"properties":{"image":{"type":"string"},"metric":{"type":"object"},"priorityClassName":{"type":"string"},"securityContext":{"type":"object"},"sidecarImage":{"type":"string"}},"required":["image"],"type":"object"},"replicas":{"enum":[3,5,6,7,9],"format":"int32","type":"integer"},"revisionHistoryLimit":{"format":"int32","type":"integer"},"special":{"type":"object"}},"required":["replicas","pod","persistentVolumeClaimSpec"],"type":"object"},"status":{"properties":{"collisionCount":{"format":"int32","type":"integer"},"currentReplicas":{"format":"int32","type":"integer"},"currentRevision":{"type":"string"},"headlessService":{"type":"string"},"nextReplicas":{"format":"int32","type":"integer"},"nextRevision":{"type":"string"},"observedGeneration":{"format":"int64","type":"integer"},"phase":{"type":"string"},"podDisruptionBudgetName":{"type":"string"},"replics":{"format":"int32","type":"integer"},"serviceMonitor":{"type":"string"},"serviceReader":{"type":"string"},"serviceSpecial":{"type":"string"},"serviceWriter":{"type":"string"},"serviceWriterBackup":{"type":"string"}},"type":"object"}},"required":["spec"],"type":"object"}},"versions":[{"name":"v1beta2","served":true,"storage":true}]}} creationTimestamp: "2020-10-06T04:44:43Z" generation: 1 labels: app: galera-operator app.kubernetes.io/managed-by: skaffold component: operator name: galera-operator skaffold.dev/run-id: 3ad0808d-0837-4618-be06-92c04d665fe9 managedFields: - apiVersion: apiextensions.k8s.io/v1 fieldsType: FieldsV1 fieldsV1: f:status: f:acceptedNames: f:categories: {} f:kind: {} f:listKind: {} f:plural: {} f:shortNames: {} f:singular: {} f:conditions: {} manager: k3s operation: Update time: "2020-10-06T04:44:43Z" - apiVersion: apiextensions.k8s.io/v1beta1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} f:labels: .: {} f:app: {} f:app.kubernetes.io/managed-by: {} f:component: {} f:name: {} f:skaffold.dev/run-id: {} f:spec: f:additionalPrinterColumns: {} f:conversion: .: {} f:strategy: {} f:group: {} f:names: f:categories: {} f:kind: {} f:listKind: {} f:plural: {} f:shortNames: {} f:singular: {} f:preserveUnknownFields: {} f:scope: {} f:subresources: .: {} f:scale: .: {} f:specReplicasPath: {} f:statusReplicasPath: {} f:status: {} f:validation: .: {} f:openAPIV3Schema: .: {} f:properties: .: {} f:spec: .: {} f:properties: .: {} f:persistentVolumeClaimSpec: .: {} f:type: {} f:pod: .: {} f:properties: .: {} f:image: .: {} f:type: {} f:metric: .: {} f:type: {} f:priorityClassName: .: {} f:type: {} f:securityContext: .: {} f:type: {} f:sidecarImage: .: {} f:type: {} f:required: {} f:type: {} f:replicas: .: {} f:enum: {} f:format: {} f:type: {} f:revisionHistoryLimit: .: {} f:format: {} f:type: {} f:special: .: {} f:type: {} f:required: {} f:type: {} f:status: .: {} f:properties: .: {} f:collisionCount: .: {} f:format: {} f:type: {} f:currentReplicas: .: {} f:format: {} f:type: {} f:currentRevision: .: {} f:type: {} f:headlessService: .: {} f:type: {} f:nextReplicas: .: {} f:format: {} f:type: {} f:nextRevision: .: {} f:type: {} f:observedGeneration: .: {} f:format: {} f:type: {} f:phase: .: {} f:type: {} f:podDisruptionBudgetName: .: {} f:type: {} f:replics: .: {} f:format: {} f:type: {} f:serviceMonitor: .: {} f:type: {} f:serviceReader: .: {} f:type: {} f:serviceSpecial: .: {} f:type: {} f:serviceWriter: .: {} f:type: {} f:serviceWriterBackup: .: {} f:type: {} f:type: {} f:required: {} f:type: {} f:version: {} f:versions: {} f:status: f:storedVersions: {} manager: kubectl-client-side-apply operation: Update time: "2020-10-06T05:35:25Z" name: galeras.sql.databases resourceVersion: "5404" selfLink: /apis/apiextensions.k8s.io/v1/customresourcedefinitions/galeras.sql.databases uid: ca31f69e-9e76-45e3-b897-264ae1b5175b spec: conversion: strategy: None group: sql.databases names: categories: - all kind: Galera listKind: GaleraList plural: galeras shortNames: - gl singular: galera preserveUnknownFields: true scope: Namespaced versions: - additionalPrinterColumns: - description: The number of desired Replicas jsonPath: .spec.replicas name: Desired type: integer - description: The number of current Replicas jsonPath: .status.replicas name: Current type: integer - jsonPath: .metadata.creationTimestamp name: Age type: date - jsonPath: .status.phase name: Phase type: string - description: Desired image jsonPath: .spec.pod.image name: Image type: string - description: Desired metric image jsonPath: .spec.pod.metric.image name: MetricImage type: string - description: Special pod jsonPath: .status.members.special name: Special type: string name: v1beta2 schema: openAPIV3Schema: properties: spec: properties: persistentVolumeClaimSpec: type: object pod: properties: image: type: string metric: type: object priorityClassName: type: string securityContext: type: object sidecarImage: type: string required: - image type: object replicas: enum: - 3 - 5 - 6 - 7 - 9 format: int32 type: integer revisionHistoryLimit: format: int32 type: integer special: type: object required: - replicas - pod - persistentVolumeClaimSpec type: object status: properties: collisionCount: format: int32 type: integer currentReplicas: format: int32 type: integer currentRevision: type: string headlessService: type: string nextReplicas: format: int32 type: integer nextRevision: type: string observedGeneration: format: int64 type: integer phase: type: string podDisruptionBudgetName: type: string replics: format: int32 type: integer serviceMonitor: type: string serviceReader: type: string serviceSpecial: type: string serviceWriter: type: string serviceWriterBackup: type: string type: object required: - spec type: object served: true storage: true subresources: scale: specReplicasPath: .spec.replicas statusReplicasPath: .status.replicas status: {} status: acceptedNames: categories: - all kind: Galera listKind: GaleraList plural: galeras shortNames: - gl singular: galera conditions: - lastTransitionTime: "2020-10-06T04:44:43Z" message: no conflicts found reason: NoConflicts status: "True" type: NamesAccepted - lastTransitionTime: "2020-10-06T04:44:43Z" message: the initial names have been accepted reason: InitialNamesAccepted status: "True" type: Established storedVersions: - v1beta2 ```

But I got 2 errors:

│ time="2020-10-05T06:53:03Z" level=info msg="Error when syncing Galera galera-operator/zalo1" pkg=controller                                                                                                                                 │
│ time="2020-10-05T06:53:03Z" level=info msg="Finished syncing Galera \"galera-operator/zalo1\" (2.293919ms)" pkg=controller                                                                                                                  │
│ E1005 06:53:03.839559       1 galera_controller.go:340] galera-operator/zalo1 failed with : error syncing 'galera-operator/zalo1': cluter galera-operator/zalo1 is failed, credentials are incorrect 
$ kubectl logs galeras.sql.databases/zalo1 --namespace galera
Error from server (NotFound): galeras.sql.databases "zalo1" not found

Don't really get what is not found

sebs42 commented 4 years ago

There is no galera cluster called "zalo1" found because the operator did not create it.

The operator indicate that provided credentials did not permit to connect to cluster and do what it have to do. You have to follow step by step the example and to read the documentation to understand how the operator works before changing things.

To provide credentials : kubectl apply -f ./example-manifests/galera-cluster/30-galera-secret.yaml