Giriş
Normalde bu dosyayı değiştirmek gerekmiyor.
PlanetScale Vitess Operator bilgilerini görmek için şöyle yaparız. Burada hata şöyle
"Failed to determine status of the condition."
Prune Keyspaces: true Prune Shard Cells: true Prune Shards: true Prune Srv Keyspaces: true Prune Tablets: true Register Cells: true Register Cells Aliases: true Turndown Policy: Immediate Update Strategy: Type: Immediate Zone Map: az1: Status: Conditions: Last Transition Time: 2022-09-06T08:08:22Z Message: Some tablet Pods for the serving partitioning are not Ready. Reason: TabletsNotReady Status: False Type: Ready Last Transition Time: 2022-09-06T08:08:24Z Message: Failed to determine status of the condition. Reason: ReconcileFailed Status: Unknown Type: ReshardingInSync Last Transition Time: 2022-09-06T08:08:24Z Message: Failed to determine status of the condition. Reason: ReconcileFailed Status: Unknown Type: ReshardingActive Idle: False Observed Generation: 1 Partitionings: Desired Shards: 1 Desired Tablets: 3 Serving Writes: True Shard Names: - Tablets: 3 Shards: -: Cells: az1 Desired Tablets: 3 Has Master: False Serving Writes: True Tablets: 3 Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Created 36m vitesskeyspace-controller created VitessShard adv-vitess-cluster-adv-x-x-6510f0e0 Normal Updated 36m vitesskeyspace-controller updated VitessShard adv-vitess-cluster-adv-x-x-6510f0e0 Warning TopoConnectFailed 35m (x23 over 36m) vitesskeyspace-controller failed to connect to global lockserver: context deadline exceeded Warning ListAllWorkflowsFailed 67s (x428 over 35m) vitesskeyspace-controller failed to list all workflows: no primary found for shard ADV/-
Örnek
Şöyle yaparız. Burada hata şöyle.
"No active resharding workflow found"
$ kubectl describe vtk -n rlwy-04
Name: adv-vitess-cluster-adv-c55923a7
Namespace: rlwy-04
Labels: planetscale.com/cluster=adv-vitess-cluster
planetscale.com/keyspace=ADV
Annotations: <none>
API Version: planetscale.com/v2
Kind: VitessKeyspace
Metadata:
Creation Timestamp: 2022-08-26T08:13:04Z
Generation: 1
Managed Fields:
API Version: planetscale.com/v2
Fields Type: FieldsV1
fieldsV1:
...
Manager: vitess-operator
Operation: Update
Time: 2022-08-26T08:13:04Z
API Version: planetscale.com/v2
Fields Type: FieldsV1
fieldsV1:
...
Manager: vitess-operator
Operation: Update
Subresource: status
Time: 2022-09-25T23:41:04Z
Owner References:
API Version: planetscale.com/v2
Block Owner Deletion: true
Controller: true
Kind: VitessCluster
Name: adv-vitess-cluster
UID: 9fc67fc7-aad0-4f11-98eb-c1e0c3e2f986
Resource Version: 9504323
UID: 95073cf0-5164-419f-90f9-e8799f0d1807
Spec:
Global Lockserver:
Address: adv-vitess-cluster-etcd-07a83994-client.rlwy-04.svc:2379
Implementation: etcd2
Root Path: /vitess/adv-vitess-cluster/global
Image Pull Policies:
Images:
Mysqld:
mysql80Compatible: gcr.io/product-spanner/oce/vitess/lite:v12.0.3-mysql80
Mysqld Exporter: gcr.io/product-spanner/oce/prom/mysqld-exporter:v0.11.0
Vtbackup: gcr.io/product-spanner/oce/vitess/lite:v12.0.3-mysql80
Vtorc: vitess/lite:v12.0.0
Vttablet: gcr.io/product-spanner/oce/vitess/lite:v12.0.3-mysql80
Name: ADV
Partitionings:
Equal:
Parts: 1
Shard Template:
Database Init Script Secret:
Key: init_db.sql
Name: adv-vitess-cluster-config
Replication:
Initialize Backup: true
Initialize Master: true
Recover Restarted Master: true
Tablet Pools:
Cell: az1
Mysqld:
Config Overrides: [mysqld]
lower_case_table_names = 1
Resources:
Limits:
Memory: 1256Mi
Requests:
Cpu: 200m
Memory: 256Mi
Replicas: 2
Type: replica
Vttablet:
Extra Flags:
db_charset: utf8mb4
Lifecycle:
Resources:
Limits:
Memory: 256Mi
Requests:
Cpu: 200m
Memory: 256Mi
Cell: az1
Data Volume Claim Template:
Access Modes:
ReadWriteOnce
Resources:
Requests:
Storage: 1Gi
Storage Class Name: standard
Mysqld:
Config Overrides: [mysqld]
lower_case_table_names = 1
Resources:
Limits:
Memory: 1256Mi
Requests:
Cpu: 200m
Memory: 256Mi
Replicas: 1
Type: rdonly
Vttablet:
Extra Flags:
db_charset: utf8mb4
Lifecycle:
Resources:
Limits:
Memory: 256Mi
Requests:
Cpu: 200m
Memory: 256Mi
Topology Reconciliation:
Prune Cells: true
Prune Keyspaces: true
Prune Shard Cells: true
Prune Shards: true
Prune Srv Keyspaces: true
Prune Tablets: true
Register Cells: true
Register Cells Aliases: true
Turndown Policy: Immediate
Update Strategy:
External:
Type: External
Zone Map:
az1:
Status:
Conditions:
Last Transition Time: 2022-09-07T01:38:10Z
Message: Some tablet Pods for the serving partitioning are not Ready.
Reason: TabletsNotReady
Status: False
Type: Ready
Last Transition Time: 2022-09-25T23:41:03Z
Message: No active resharding workflow found.
Reason: NoActiveReshardingWorkflow
Status: False
Type: ReshardingActive
Last Transition Time: 2022-09-25T23:41:03Z
Message: No active resharding workflow found.
Reason: NoActiveReshardingWorkflow
Status: False
Type: ReshardingInSync
Idle: False
Observed Generation: 1
Partitionings:
Desired Shards: 1
Desired Tablets: 3
Ready Tablets: 1
Serving Writes: True
Shard Names:
-
Tablets: 3
Shards:
-:
Cells:
az1
Desired Tablets: 3
Has Master: True
Ready Tablets: 1
Serving Writes: True
Tablets: 3
Events: <none>Resource Tipleri
Bu dosyada 3 tane önemli Resource var. Bunlar şöyle
Resource Types
Custom Resource İsimleri
operator.yaml dosyası oldukça büyük. Yaratılan Custom Resource isimleri şöyle
etcdlockservers.planetscale.comvitessbackups.planetscale.comvitessbackupstorages.planetscale.comvitesscells.planetscale.comvitessclusters.planetscale.comvitesskeyspaces.planetscale.comvitessshards.planetscale.com
Deployment
En sondaki deployment kısmı önemli. Burası şöyle. Kullanılan image ismi planetscale/vitess-operator:v2.6.0
apiVersion: apps/v1kind: Deploymentmetadata: {name: vitess-operator}spec:replicas: 1selector:matchLabels: {app: vitess-operator}template:metadata:labels: {app: vitess-operator}spec:containers:- args: [--logtostderr, -v=4]command: [vitess-operator]env:- {name: WATCH_NAMESPACE, value: ''}- name: POD_NAMEvalueFrom:fieldRef: {fieldPath: metadata.name}- name: PS_OPERATOR_POD_NAMESPACEvalueFrom:fieldRef: {fieldPath: metadata.namespace}- name: PS_OPERATOR_POD_NAMEvalueFrom:fieldRef: {fieldPath: metadata.name}- {name: OPERATOR_NAME, value: vitess-operator}image: planetscale/vitess-operator:v2.6.0name: vitess-operatorresources:limits: {memory: 128Mi}requests: {cpu: 100m, memory: 128Mi}priorityClassName: vitess-operator-control-planeserviceAccountName: vitess-operator