Closed linghan-hub closed 1 year ago
insufficient evidence, should provide PVC's age as well, as last-applied-cluster
info is recorded in PVC's annotations, do provider PVC's annotations, and should show k get cluster <cluster>
manifest before delete the cluster.
k get cluster
NAME CLUSTER-DEFINITION VERSION TERMINATION-POLICY STATUS AGE
mycluster-apecloud-mysql-cluster apecloud-mysql ac-mysql-8.0.30 Halt Running 3m3s
Warning HaltRecoveryFailed 10m (x2 over 10m) cluster-controller not equal to last applied cluster.spec.componentSpecs[mysql].classDefRef={"class":"general-0.5c0.5g"}; add 'clusters.apps.kubeblocks.io/allow-inconsistent-resource=true' annotation to void this check
k get cluster
NAME CLUSTER-DEFINITION VERSION TERMINATION-POLICY STATUS AGE
mycluster-apecloud-mysql-cluster apecloud-mysql ac-mysql-8.0.30 Halt Running 2m7s
k get cluster mycluster-apecloud-mysql-cluster -oyaml
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
creationTimestamp: "2023-06-16T06:23:17Z"
finalizers:
- cluster.kubeblocks.io/finalizer
generation: 2
labels:
app.kubernetes.io/instance: mycluster
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: apecloud-mysql-cluster
app.kubernetes.io/version: 8.0.30
clusterdefinition.kubeblocks.io/name: apecloud-mysql
clusterversion.kubeblocks.io/name: ac-mysql-8.0.30
helm.sh/chart: apecloud-mysql-cluster-0.6.0-alpha.17
name: mycluster-apecloud-mysql-cluster
namespace: default
resourceVersion: "72759"
uid: d3fb0ed9-cd6e-4ad8-ab13-590418888920
spec:
affinity:
podAntiAffinity: Preferred
tenancy: SharedNode
topologyKeys:
- kubernetes.io/hostname
clusterDefinitionRef: apecloud-mysql
clusterVersionRef: ac-mysql-8.0.30
componentSpecs:
- classDefRef:
class: custom-0.1c0.5g
componentDefRef: mysql
enabledLogs:
- slow
- error
monitor: false
name: mysql
noCreatePDB: false
replicas: 3
resources:
limits:
cpu: 100m
memory: 512Mi
requests:
cpu: 100m
memory: 512Mi
serviceAccountName: kb-mycluster-apecloud-mysql-cluster
volumeClaimTemplates:
- name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
terminationPolicy: Halt
status:
clusterDefGeneration: 2
components:
mysql:
consensusSetStatus:
followers:
- accessMode: Readonly
name: follower
pod: mycluster-apecloud-mysql-cluster-mysql-0
- accessMode: Readonly
name: follower
pod: mycluster-apecloud-mysql-cluster-mysql-2
leader:
accessMode: ReadWrite
name: leader
pod: mycluster-apecloud-mysql-cluster-mysql-1
phase: Running
podsReady: true
podsReadyTime: "2023-06-16T06:23:39Z"
conditions:
- lastTransitionTime: "2023-06-16T06:23:17Z"
message: 'The operator has started the provisioning of Cluster: mycluster-apecloud-mysql-cluster'
observedGeneration: 2
reason: PreCheckSucceed
status: "True"
type: ProvisioningStarted
- lastTransitionTime: "2023-06-16T06:23:18Z"
message: Successfully applied for resources
observedGeneration: 2
reason: ApplyResourcesSucceed
status: "True"
type: ApplyResources
- lastTransitionTime: "2023-06-16T06:23:39Z"
message: all pods of components are ready, waiting for the probe detection successful
reason: AllReplicasReady
status: "True"
type: ReplicasReady
- lastTransitionTime: "2023-06-16T06:25:08Z"
message: 'Cluster: mycluster-apecloud-mysql-cluster is ready, current phase is
Running'
reason: ClusterReady
status: "True"
type: Ready
observedGeneration: 2
phase: Running
k get cluster,pod,pvc -l app.kubernetes.io/instance=mycluster-apecloud-mysql-cluster
NAME READY STATUS RESTARTS AGE
pod/mycluster-apecloud-mysql-cluster-mysql-0 4/4 Running 0 2m
pod/mycluster-apecloud-mysql-cluster-mysql-1 4/4 Running 0 2m
pod/mycluster-apecloud-mysql-cluster-mysql-2 4/4 Running 0 2m
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/data-mycluster-apecloud-mysql-cluster-mysql-0 Bound pvc-420a8090-8546-49b6-8ad0-a3b535cc1e0c 1Gi RWO gp3 2m
persistentvolumeclaim/data-mycluster-apecloud-mysql-cluster-mysql-1 Bound pvc-db7ce6d1-fcc2-4908-a6e4-cce9ff24cfda 1Gi RWO gp3 2m
persistentvolumeclaim/data-mycluster-apecloud-mysql-cluster-mysql-2 Bound pvc-f1fcbddc-4d2a-498e-b601-f440c31b2719 1Gi RWO gp3 2m
k get cluster,pod,pvc -l app.kubernetes.io/instance=mycluster-apecloud-mysql-cluster
NAME READY STATUS RESTARTS AGE
pod/mycluster-apecloud-mysql-cluster-mysql-0 3/4 Terminating 0 4m58s
pod/mycluster-apecloud-mysql-cluster-mysql-2 3/4 Terminating 0 4m58s
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/data-mycluster-apecloud-mysql-cluster-mysql-0 Bound pvc-420a8090-8546-49b6-8ad0-a3b535cc1e0c 1Gi RWO gp3 4m58s
persistentvolumeclaim/data-mycluster-apecloud-mysql-cluster-mysql-1 Bound pvc-db7ce6d1-fcc2-4908-a6e4-cce9ff24cfda 1Gi RWO gp3 4m58s
persistentvolumeclaim/data-mycluster-apecloud-mysql-cluster-mysql-2 Bound pvc-f1fcbddc-4d2a-498e-b601-f440c31b2719 1Gi RWO gp3 4m58s
k get pvc data-mycluster-apecloud-mysql-cluster-mysql-0 -oyaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
apps.kubeblocks.io/last-applied-cluster: '{"metadata":{"name":"mycluster-apecloud-mysql-cluster","uid":"d3fb0ed9-cd6e-4ad8-ab13-590418888920","creationTimestamp":null},"spec":{"clusterDefinitionRef":"apecloud-mysql","clusterVersionRef":"ac-mysql-8.0.30","terminationPolicy":"Halt","componentSpecs":[{"name":"mysql","componentDefRef":"mysql","classDefRef":{"class":"custom-0.1c0.5g"},"enabledLogs":["slow","error"],"replicas":3,"resources":{"limits":{"cpu":"100m","memory":"512Mi"},"requests":{"cpu":"100m","memory":"512Mi"}},"volumeClaimTemplates":[{"name":"data","spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"1Gi"}}}}],"serviceAccountName":"kb-mycluster-apecloud-mysql-cluster"}],"affinity":{"podAntiAffinity":"Preferred","topologyKeys":["kubernetes.io/hostname"],"tenancy":"SharedNode"}},"status":{}}'
pv.kubernetes.io/bind-completed: "yes"
pv.kubernetes.io/bound-by-controller: "yes"
volume.beta.kubernetes.io/storage-provisioner: ebs.csi.aws.com
volume.kubernetes.io/selected-node: ip-10-0-3-55.cn-northwest-1.compute.internal
volume.kubernetes.io/storage-provisioner: ebs.csi.aws.com
creationTimestamp: "2023-06-16T06:23:17Z"
finalizers:
- kubernetes.io/pvc-protection
labels:
app.kubernetes.io/instance: mycluster-apecloud-mysql-cluster
app.kubernetes.io/managed-by: kubeblocks
app.kubernetes.io/name: apecloud-mysql
apps.kubeblocks.io/component-name: mysql
apps.kubeblocks.io/vct-name: data
kubeblocks.io/volume-type: data
name: data-mycluster-apecloud-mysql-cluster-mysql-0
namespace: default
resourceVersion: "73639"
uid: 420a8090-8546-49b6-8ad0-a3b535cc1e0c
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: gp3
volumeMode: Filesystem
volumeName: pvc-420a8090-8546-49b6-8ad0-a3b535cc1e0c
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
duplicate with https://github.com/apecloud/kubeblocks/issues/3770
k create -f 00_wesqlcluster.yaml cat 00_wesqlcluster.yaml
mongodb the same problem exists