planetscale / vitess-operator

Kubernetes Operator for Vitess
Apache License 2.0
305 stars 75 forks source link

VTTablet unable to start when using `externalDatastore` #596

Closed arvindkalra08 closed 3 months ago

arvindkalra08 commented 3 months ago

When we try to create a keyspace using a tablet with external datasource by providing the externalDatastore property in YML, the vttablet pod is unable able to spawn up.

My keyspace section of YML looks the following:

- name: email_service_legacy
    turndownPolicy: Immediate
    databaseName: email_service
    partitionings:
      - equal:
          parts: 1
          shardTemplate:
            databaseInitScriptSecret:
              name: example-cluster-config
              key: init_db.sql
            tabletPools:
              - cell: zone1
                type: externalmaster
                replicas: 1
                vttablet:
                  extraFlags:
                    disable_active_reparents: "true"
                    db_charset: utf8mb4
                  resources:
                    limits:
                      memory: 256Mi
                    requests:
                      cpu: 100m
                      memory: 256Mi
                externalDatastore:
                  user: ***
                  host: ***
                  port: 3306
                  database: email_service
                  credentialsSecret:
                    name: example-cluster-config
                    key: external_users.json

And following is the error log from the vttablet pod for the same:

unknown flag: --vreplication_tablet_type

Can someone help debug this? Let me know if you need more information.

I am using these images:

images:
    vtctld: vitess/lite:latest
    vtadmin: vitess/vtadmin:latest
    vtgate: vitess/lite:latest
    vttablet: vitess/lite:latest
    vtbackup: vitess/lite:latest
    vtorc: vitess/lite:latest
    mysqld:
      mysql80Compatible: mysql:8.0.30
    mysqldExporter: prom/mysqld-exporter:v0.11.0
arvindkalra08 commented 3 months ago

I am referring these docs: https://github.com/planetscale/vitess-operator/blob/main/docs/api.md#vitessshardtabletpool

deepthi commented 3 months ago

Looks like this was broken by https://github.com/vitessio/vitess/pull/15857. The corresponding change needs to be made in operator code. Until this is fixed, are you able to run with Vitess 19.0.5 instead of latest?

arvindkalra08 commented 3 months ago

Thanks @deepthi for the quick response.

Can you give me the exact version that should be used? As when I try to use:

vttablet: vitess/lite:19.0.5

The pod is stuck at Init:ErrImagePull

deepthi commented 3 months ago

Actually, looks like this was fixed for v20 https://github.com/planetscale/vitess-operator/pull/581 So the problem is that you must be using some incompatible combination of Vitess-operator and vitess. I'd suggest following the user guide on the web and making sure you are using compatible versions.

I'm going to close this issue, because there does not seem to be a bug.

Thanks to @mattlord for pointing me in the right direction on this.

arvindkalra08 commented 3 months ago

@deepthi Those are the exact docs that I am following, but anyway, I was able to make it work with v19.0.5.

I just had to provide the image version like this:

vttablet: vitess/lite:v19.0.5