Closed God-Zalo closed 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.
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
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.
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.
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
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
:
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
Update:
Dumb me forgot to add galerabackup-crd.yaml
and upgradeconfig.yaml
on kustomization.yaml, after that, crds look like this:
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
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
Followed the instructions at the
examples-manifests
, using "Three member cluster" example, galera-operator is deployed using the kustomize found in #12Then manually running
kubectl create -f <galera-cluster>.yaml
deployment get stuck atDesired 3 - Current 0
This is what I could get my hands on:
galera-operator check:
crd's check:
Config map is embebed with yaml below, using the default provided in the spec example, nothing changed,
Full yaml (skipping configmap data):
Outputs:
Description of cluster deployment:
The only error message found was with: