Skip to content

Instantly share code, notes, and snippets.

@journeytosilius
Created November 16, 2020 12:36
Show Gist options
  • Save journeytosilius/3ba8d5cfad68f68938e219e86c8592f8 to your computer and use it in GitHub Desktop.
Save journeytosilius/3ba8d5cfad68f68938e219e86c8592f8 to your computer and use it in GitHub Desktop.
# Version: 20200423: 99eb9b939b4166caa38276874ce96cf289da8317
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: etcdlockservers.planetscale.com
spec:
group: planetscale.com
names:
kind: EtcdLockserver
listKind: EtcdLockserverList
plural: etcdlockservers
shortNames:
- etcdls
singular: etcdlockserver
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
advertisePeerURLs:
description: 'AdvertisePeerURLs can optionally be used to override the
URLs that etcd members use to find each other for peer-to-peer connections. If
specified, the list must contain exactly 3 entries, one for each etcd
member index (1,2,3) respectively. Default: Build peer URLs automatically
based on Kubernetes built-in DNS.'
items:
type: string
maxItems: 3
minItems: 3
type: array
affinity:
description: 'Affinity allows you to set rules that constrain the scheduling
of your Etcd pods. WARNING: These affinity rules will override all
default affinities that we set; in turn, we can''t guarantee optimal
scheduling of your pods if you choose to set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used to attach custom annotations
to Pods created for this component.
type: object
createClientService:
description: 'CreateClientService sets whether to create a Service for
the client port of etcd member Pods. Note: Disabling this will NOT
delete a Service that was previously created. Default: true'
type: boolean
createPDB:
description: 'CreatePDB sets whether to create a PodDisruptionBudget
(PDB) for etcd member Pods. Note: Disabling this will NOT delete
a PDB that was previously created. Default: true'
type: boolean
createPeerService:
description: 'CreatePeerService sets whether to create a Service for
the peer port of etcd member Pods. Note: Disabling this will NOT
delete a Service that was previously created. Default: true'
type: boolean
dataVolumeClaimTemplate:
description: 'DataVolumeClaimTemplate configures the PersistentVolumeClaims
that will be created for each etcd instance to store its data files.
This field is required. IMPORTANT: For a cell-local lockserver, you
must set a storageClassName here for a StorageClass that''s configured
to only provision volumes in the Availability Zone that corresponds
to the Vitess cell. Default: Let the operator choose.'
type: object
extraEnv:
description: ExtraEnv can optionally be used to override default environment
variables set by the operator, or pass additional environment variables.
items:
type: object
type: array
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally be used to override default
flags set by the operator, or pass additional flags to etcd. All entries
must be key-value string pairs of the form "flag": "value". The flag
name should not have any prefix (just "flag", not "-flag"). To set
a boolean flag, set the string value to either "true" or "false".'
type: object
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally be used to attach custom labels
to Pods created for this component.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally be used to override default
Pod volumeMounts defined by the operator, or specify additional mounts.
Typically, these are used to mount volumes defined through extraVolumes.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally be used to override default
Pod volumes defined by the operator, or provide additional volumes
to the Pod. Note that when adding a new volume, you should usually
also add a volumeMount to specify where in each container's filesystem
the volume should be mounted.
items:
type: object
type: array
image:
description: 'Image is the etcd server image (including version tag)
to deploy. Default: Let the operator choose.'
type: string
imagePullPolicy:
description: ImagePullPolicy specifies if/when to pull a container image.
type: string
initContainers:
description: InitContainers can optionally be used to supply extra init
containers that will be run to completion one after another before
any app containers are started.
items:
type: object
type: array
localMemberIndex:
description: 'LocalMemberIndex can optionally be used to specify that
only one etcd member should actually be deployed. This can be used
to spread members across multiple Kubernetes clusters by configuring
the EtcdLockserver CRD in each cluster to deploy a different member
index. If specified, the index must be 1, 2, or 3. Default: Deploy
all etcd members locally.'
format: int32
maximum: 3
minimum: 1
type: integer
resources:
description: 'Resources specify the compute resources to allocate for
each etcd member. Default: Let the operator choose.'
type: object
sidecarContainers:
description: SidecarContainers can optionally be used to supply extra
containers that run alongside the main containers.
items:
type: object
type: array
zone:
description: Zone is the name of the Availability Zone that this lockserver
should run in. This value should match the value of the "failure-domain.beta.kubernetes.io/zone"
label on the Kubernetes Nodes in that AZ. If the Kubernetes Nodes
don't have such a label, leave this empty.
type: string
type: object
status:
properties:
available:
description: Available is a condition that indicates whether the cluster
is able to serve queries.
type: string
clientServiceName:
description: ClientServiceName is the name of the Service for etcd client
connections.
type: string
observedGeneration:
description: The generation observed by the controller.
format: int64
type: integer
type: object
version: v2
versions:
- name: v2
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: vitessbackups.planetscale.com
spec:
group: planetscale.com
names:
kind: VitessBackup
listKind: VitessBackupList
plural: vitessbackups
shortNames:
- vtb
singular: vitessbackup
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
type: object
status:
properties:
complete:
description: Complete indicates whether the backup ever completed.
type: boolean
engine:
description: Engine is the Vitess backup engine implementation that
was used.
type: string
finishedTime:
description: FinishedTime is the time when the backup finished.
format: date-time
type: string
position:
description: Position is the replication position of the snapshot that
was backed up. The position is expressed in the native, GTID-based
format of the MySQL flavor that took the backup. This is only available
after the backup is complete.
type: string
startTime:
description: StartTime is the time when the backup started.
format: date-time
type: string
storageDirectory:
description: StorageDirectory is the name of the parent directory in
storage that contains this backup.
type: string
storageName:
description: StorageName is the name of the backup in storage. This
is different from the name of the VitessBackup object created to represent
metadata about the actual backup in storage.
type: string
type: object
version: v2
versions:
- name: v2
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: vitessbackupstorages.planetscale.com
spec:
group: planetscale.com
names:
kind: VitessBackupStorage
listKind: VitessBackupStorageList
plural: vitessbackupstorages
shortNames:
- vtbs
singular: vitessbackupstorage
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
location:
description: Location specifies the Vitess parameters for connecting
to the backup storage location.
properties:
azblob:
description: Azblob specifies a backup location in Azure Blob Storage.
properties:
account:
description: Account is the name of the Azure storage account
to use.
minLength: 1
type: string
authSecret:
description: AuthSecret is a reference to the Secret to use
for Azure authentication.
properties:
key:
description: Key is the name of the item within the data
source to use as the value. For a Kubernetes Secret object
(specified with the 'name' field), this is the key within
the 'data' map. When 'volumeName' is used, this specifies
the name of the file to load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object
to use as the data source. The Secret must be in the same
namespace as the VitessCluster. The 'key' field defines
the item to pick from the Secret object's 'data' map. If
a Secret name is not specified, the data source must be
defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of a
Volume in each Pod that should be mounted. You must ensure
a Volume by that name exists in all relevant Pods, such
as by using the appropriate ExtraVolumes fields. If specified,
this takes precedence over the 'name' field. The 'key'
field defines the name of the file to load within this
Volume.
type: string
required:
- key
type: object
container:
description: Container is the name of the Azure storage account
container to use.
minLength: 1
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to all object
keys created by Vitess. This is only needed if the same container
is also used for something other than backups for VitessClusters.
Backups from different clusters, keyspaces, or shards will
automatically avoid colliding with each other within a container,
regardless of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
required:
- account
- container
- authSecret
type: object
gcs:
description: GCS specifies a backup location in Google Cloud Storage.
properties:
authSecret:
description: 'AuthSecret is a reference to the Secret to use
for GCS authentication. If set, this must point to a file
in the format expected for the GOOGLE_APPLICATION_CREDENTIALS
environment variable. Default: Use the default credentials
of the Node.'
properties:
key:
description: Key is the name of the item within the data
source to use as the value. For a Kubernetes Secret object
(specified with the 'name' field), this is the key within
the 'data' map. When 'volumeName' is used, this specifies
the name of the file to load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object
to use as the data source. The Secret must be in the same
namespace as the VitessCluster. The 'key' field defines
the item to pick from the Secret object's 'data' map. If
a Secret name is not specified, the data source must be
defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of a
Volume in each Pod that should be mounted. You must ensure
a Volume by that name exists in all relevant Pods, such
as by using the appropriate ExtraVolumes fields. If specified,
this takes precedence over the 'name' field. The 'key'
field defines the name of the file to load within this
Volume.
type: string
required:
- key
type: object
bucket:
description: Bucket is the name of the GCS bucket to use.
minLength: 1
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to all object
keys created by Vitess. This is only needed if the same bucket
is also used for something other than backups for VitessClusters.
Backups from different clusters, keyspaces, or shards will
automatically avoid colliding with each other within a bucket,
regardless of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
required:
- bucket
type: object
name:
description: Name is used to refer to this backup location from
other parts of a VitessCluster object, such as in tablet pool
definitions. This name must be unique among all backup locations
defined in a given cluster. A backup location with an empty name
defines the default location used when a tablet pool does not
specify a backup location name.
maxLength: 25
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
s3:
description: S3 specifies a backup location in Amazon S3.
properties:
authSecret:
description: 'AuthSecret is a reference to the Secret to use
for S3 authentication. If set, this must point to a file in
the format expected for the `~/.aws/credentials` file. Default:
Use the default credentials of the Node.'
properties:
key:
description: Key is the name of the item within the data
source to use as the value. For a Kubernetes Secret object
(specified with the 'name' field), this is the key within
the 'data' map. When 'volumeName' is used, this specifies
the name of the file to load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object
to use as the data source. The Secret must be in the same
namespace as the VitessCluster. The 'key' field defines
the item to pick from the Secret object's 'data' map. If
a Secret name is not specified, the data source must be
defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of a
Volume in each Pod that should be mounted. You must ensure
a Volume by that name exists in all relevant Pods, such
as by using the appropriate ExtraVolumes fields. If specified,
this takes precedence over the 'name' field. The 'key'
field defines the name of the file to load within this
Volume.
type: string
required:
- key
type: object
bucket:
description: Bucket is the name of the S3 bucket to use.
minLength: 1
type: string
endpoint:
description: 'Endpoint is the `host:port` (port is required)
for the S3 backend. Default: Use the endpoint associated with
`region` by the driver.'
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to all object
keys created by Vitess. This is only needed if the same bucket
is also used for something other than backups for VitessClusters.
Backups from different clusters, keyspaces, or shards will
automatically avoid colliding with each other within a bucket,
regardless of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
region:
description: Region is the AWS region in which the bucket is
located.
minLength: 1
type: string
required:
- region
- bucket
type: object
volume:
description: Volume specifies a backup location as a Kubernetes
Volume Source to mount. This can be used, for example, to store
backups on an NFS mount, or on a shared host path for local testing.
type: object
type: object
required:
- location
type: object
status:
properties:
observedGeneration:
description: The generation observed by the controller.
format: int64
type: integer
totalBackupCount:
description: TotalBackupCount is the total number of backups found in
this storage location, across all keyspaces and shards.
format: int32
type: integer
type: object
version: v2
versions:
- name: v2
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: vitesscells.planetscale.com
spec:
group: planetscale.com
names:
kind: VitessCell
listKind: VitessCellList
plural: vitesscells
shortNames:
- vtc
singular: vitesscell
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
allCells:
description: AllCells is a list of all cells in the Vitess cluster.
items:
type: string
type: array
extraVitessFlags:
additionalProperties:
type: string
description: ExtraVitessFlags is inherited from the parent's VitessClusterSpec.
type: object
gateway:
description: Gateway configures the Vitess Gateway deployment in this
cell.
properties:
affinity:
description: 'Affinity allows you to set rules that constrain the
scheduling of your vtgate pods. WARNING: These affinity rules
will override all default affinities that we set; in turn, we
can''t guarantee optimal scheduling of your pods if you choose
to set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used to attach custom
annotations to Pods created for this component. These will be
attached to the underlying Pods that the vtgate Deployment creates.
type: object
authentication:
description: Authentication configures how Vitess Gateway authenticates
MySQL client connections.
properties:
static:
description: Static configures vtgate to use a static file containing
usernames and passwords.
properties:
secret:
description: Secret configures vtgate to load the static
auth file from a given key in a given Secret.
properties:
key:
description: Key is the name of the item within the
data source to use as the value. For a Kubernetes
Secret object (specified with the 'name' field), this
is the key within the 'data' map. When 'volumeName'
is used, this specifies the name of the file to load
within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret
object to use as the data source. The Secret must
be in the same namespace as the VitessCluster. The
'key' field defines the item to pick from the Secret
object's 'data' map. If a Secret name is not specified,
the data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the name
of a Volume in each Pod that should be mounted. You
must ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of
the file to load within this Volume.
type: string
required:
- key
type: object
type: object
type: object
extraEnv:
description: ExtraEnv can optionally be used to override default
environment variables set by the operator, or pass additional
environment variables.
items:
type: object
type: array
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally be used to override default
flags set by the operator, or pass additional flags to vtgate.
All entries must be key-value string pairs of the form "flag":
"value". The flag name should not have any prefix (just "flag",
not "-flag"). To set a boolean flag, set the string value to either
"true" or "false".'
type: object
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally be used to attach custom
labels to Pods created for this component. These will be attached
to the underlying Pods that the vtgate Deployment creates.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally be used to override
default Pod volumeMounts defined by the operator, or specify additional
mounts. Typically, these are used to mount volumes defined through
extraVolumes.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally be used to override default
Pod volumes defined by the operator, or provide additional volumes
to the Pod. Note that when adding a new volume, you should usually
also add a volumeMount to specify where in each container's filesystem
the volume should be mounted.
items:
type: object
type: array
initContainers:
description: InitContainers can optionally be used to supply extra
init containers that will be run to completion one after another
before any app containers are started.
items:
type: object
type: array
replicas:
description: Replicas is the number of vtgate instances to deploy
in this cell.
format: int32
minimum: 0
type: integer
resources:
description: Resources determines the compute resources reserved
for each vtgate replica.
type: object
secureTransport:
description: SecureTransport configures secure transport connections
for vtgate.
properties:
required:
description: Required configures vtgate to reject non-secure
transport connections. Applies only to MySQL protocol connections.
All GRPC transport is required to be encrypted when certs
are set.
type: boolean
tls:
description: TLS configures vtgate to use TLS encrypted transport.
properties:
certSecret:
description: CertSecret configures vtgate to load the TLS
cert PEM file from a given key in a given Secret.
properties:
key:
description: Key is the name of the item within the
data source to use as the value. For a Kubernetes
Secret object (specified with the 'name' field), this
is the key within the 'data' map. When 'volumeName'
is used, this specifies the name of the file to load
within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret
object to use as the data source. The Secret must
be in the same namespace as the VitessCluster. The
'key' field defines the item to pick from the Secret
object's 'data' map. If a Secret name is not specified,
the data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the name
of a Volume in each Pod that should be mounted. You
must ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of
the file to load within this Volume.
type: string
required:
- key
type: object
clientCACertSecret:
description: ClientCACertSecret configures vtgate to load
the TLS certificate authority PEM file from a given key
in a given Secret. If specified, checks client certificates
are signed by this CA certificate. Optional.
properties:
key:
description: Key is the name of the item within the
data source to use as the value. For a Kubernetes
Secret object (specified with the 'name' field), this
is the key within the 'data' map. When 'volumeName'
is used, this specifies the name of the file to load
within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret
object to use as the data source. The Secret must
be in the same namespace as the VitessCluster. The
'key' field defines the item to pick from the Secret
object's 'data' map. If a Secret name is not specified,
the data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the name
of a Volume in each Pod that should be mounted. You
must ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of
the file to load within this Volume.
type: string
required:
- key
type: object
keySecret:
description: KeySecret configures vtgate to load the TLS
key PEM file from a given key in a given Secret.
properties:
key:
description: Key is the name of the item within the
data source to use as the value. For a Kubernetes
Secret object (specified with the 'name' field), this
is the key within the 'data' map. When 'volumeName'
is used, this specifies the name of the file to load
within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret
object to use as the data source. The Secret must
be in the same namespace as the VitessCluster. The
'key' field defines the item to pick from the Secret
object's 'data' map. If a Secret name is not specified,
the data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the name
of a Volume in each Pod that should be mounted. You
must ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of
the file to load within this Volume.
type: string
required:
- key
type: object
type: object
type: object
sidecarContainers:
description: SidecarContainers can optionally be used to supply
extra containers that run alongside the main containers.
items:
type: object
type: array
type: object
globalLockserver:
description: GlobalLockserver are the params to connect to the global
lockserver.
properties:
address:
description: Address is the host:port of the lockserver client endpoint.
type: string
implementation:
description: Implementation specifies which Vitess "topo" plugin
to use.
type: string
rootPath:
description: RootPath is a path prefix for all lockserver data belonging
to a given Vitess cluster. Multiple Vitess clusters can share
a lockserver as long as they have unique root paths.
type: string
required:
- implementation
- address
- rootPath
type: object
imagePullPolicies:
description: ImagePullPolicies are inherited from the VitessCluster
spec.
properties:
mysqld:
description: Mysqld is the container image pull policy to use for
mysqld.
type: string
mysqldExporter:
description: MysqldExporter is the container image pull policy to
use for mysqld-exporter.
type: string
vtbackup:
description: Vtbackup is the container image pull policy to use
for Vitess Backup jobs.
type: string
vtctld:
description: Vtctld is the container image pull policy to use for
Vitess Dashboard instances.
type: string
vtgate:
description: Vtgate is the container image pull policy to use for
Vitess Gateway instances.
type: string
vttablet:
description: Vttablet is the container image pull policy to use
for Vitess Tablet instances.
type: string
type: object
images:
description: Images are not customizable by users at the cell level
because version skew across the cluster is discouraged except during
rolling updates, in which case this field is automatically managed
by the VitessCluster controller that owns this VitessCell.
properties:
vtgate:
description: Vtgate is the container image (including version tag)
to use for Vitess Gateway instances.
type: string
type: object
lockserver:
description: 'Lockserver specifies either a deployed or external lockserver
to be used as the Vitess cell-local topology store. Default: Put this
cell''s topology data in the global lockserver instead of its own
lockserver.'
properties:
etcd:
description: Etcd deploys our own etcd cluster as a lockserver.
properties:
advertisePeerURLs:
description: 'AdvertisePeerURLs can optionally be used to override
the URLs that etcd members use to find each other for peer-to-peer
connections. If specified, the list must contain exactly
3 entries, one for each etcd member index (1,2,3) respectively. Default:
Build peer URLs automatically based on Kubernetes built-in
DNS.'
items:
type: string
maxItems: 3
minItems: 3
type: array
affinity:
description: 'Affinity allows you to set rules that constrain
the scheduling of your Etcd pods. WARNING: These affinity
rules will override all default affinities that we set; in
turn, we can''t guarantee optimal scheduling of your pods
if you choose to set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used to attach custom
annotations to Pods created for this component.
type: object
createClientService:
description: 'CreateClientService sets whether to create a Service
for the client port of etcd member Pods. Note: Disabling
this will NOT delete a Service that was previously created. Default:
true'
type: boolean
createPDB:
description: 'CreatePDB sets whether to create a PodDisruptionBudget
(PDB) for etcd member Pods. Note: Disabling this will NOT
delete a PDB that was previously created. Default: true'
type: boolean
createPeerService:
description: 'CreatePeerService sets whether to create a Service
for the peer port of etcd member Pods. Note: Disabling this
will NOT delete a Service that was previously created. Default:
true'
type: boolean
dataVolumeClaimTemplate:
description: 'DataVolumeClaimTemplate configures the PersistentVolumeClaims
that will be created for each etcd instance to store its data
files. This field is required. IMPORTANT: For a cell-local
lockserver, you must set a storageClassName here for a StorageClass
that''s configured to only provision volumes in the Availability
Zone that corresponds to the Vitess cell. Default: Let the
operator choose.'
type: object
extraEnv:
description: ExtraEnv can optionally be used to override default
environment variables set by the operator, or pass additional
environment variables.
items:
type: object
type: array
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally be used to override
default flags set by the operator, or pass additional flags
to etcd. All entries must be key-value string pairs of the
form "flag": "value". The flag name should not have any prefix
(just "flag", not "-flag"). To set a boolean flag, set the
string value to either "true" or "false".'
type: object
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally be used to attach custom
labels to Pods created for this component.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally be used to override
default Pod volumeMounts defined by the operator, or specify
additional mounts. Typically, these are used to mount volumes
defined through extraVolumes.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally be used to override
default Pod volumes defined by the operator, or provide additional
volumes to the Pod. Note that when adding a new volume, you
should usually also add a volumeMount to specify where in
each container's filesystem the volume should be mounted.
items:
type: object
type: array
image:
description: 'Image is the etcd server image (including version
tag) to deploy. Default: Let the operator choose.'
type: string
imagePullPolicy:
description: ImagePullPolicy specifies if/when to pull a container
image.
type: string
initContainers:
description: InitContainers can optionally be used to supply
extra init containers that will be run to completion one after
another before any app containers are started.
items:
type: object
type: array
localMemberIndex:
description: 'LocalMemberIndex can optionally be used to specify
that only one etcd member should actually be deployed. This
can be used to spread members across multiple Kubernetes clusters
by configuring the EtcdLockserver CRD in each cluster to deploy
a different member index. If specified, the index must be
1, 2, or 3. Default: Deploy all etcd members locally.'
format: int32
maximum: 3
minimum: 1
type: integer
resources:
description: 'Resources specify the compute resources to allocate
for each etcd member. Default: Let the operator choose.'
type: object
sidecarContainers:
description: SidecarContainers can optionally be used to supply
extra containers that run alongside the main containers.
items:
type: object
type: array
type: object
external:
description: External specifies that we should connect to an existing
lockserver, instead of deploying our own. If this is set, all
other Lockserver fields are ignored.
properties:
address:
description: Address is the host:port of the lockserver client
endpoint.
type: string
implementation:
description: Implementation specifies which Vitess "topo" plugin
to use.
type: string
rootPath:
description: RootPath is a path prefix for all lockserver data
belonging to a given Vitess cluster. Multiple Vitess clusters
can share a lockserver as long as they have unique root paths.
type: string
required:
- implementation
- address
- rootPath
type: object
type: object
name:
description: Name is the cell name as it should be provided to Vitess.
Note that this is different from the VitessCell object's metadata.name,
which is generated by the operator.
maxLength: 25
minLength: 1
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
topologyReconciliation:
description: TopologyReconciliation is inherited from the parent's VitessClusterSpec.
properties:
pruneCells:
description: 'PruneCells can be used to enable or disable pruning
of extraneous cells from topo records. Default: true'
type: boolean
pruneKeyspaces:
description: 'PruneKeyspaces can be used to enable or disable pruning
of extraneous keyspaces from topo records. Default: true'
type: boolean
pruneShardCells:
description: 'PruneShardCells can be used to enable or disable pruning
of extraneous shard cells from topo records. Default: true'
type: boolean
pruneShards:
description: 'PruneShards can be used to enable or disable pruning
of extraneous shards from topo records. Default: true'
type: boolean
pruneSrvKeyspaces:
description: 'PruneSrvKeyspaces can be used to enable or disable
pruning of extraneous serving keyspaces from topo records. Default:
true'
type: boolean
pruneTablets:
description: 'PruneTablets can be used to enable or disable pruning
of extraneous tablets from topo records. Default: true'
type: boolean
registerCells:
description: 'RegisterCells can be used to enable or disable registering
cells into topo records. Default: true'
type: boolean
registerCellsAliases:
description: 'RegisterCellsAliases can be used to enable or disable
registering cells aliases into topo records. Default: true'
type: boolean
type: object
zone:
description: Zone is the name of the Availability Zone that this Vitess
Cell should run in. This value should match the value of the "failure-domain.beta.kubernetes.io/zone"
label on the Kubernetes Nodes in that AZ. If the Kubernetes Nodes
don't have such a label, leave this empty.
type: string
required:
- name
- globalLockserver
- allCells
type: object
status:
properties:
gateway:
description: Gateway is a summary of the status of vtgate in this cell.
properties:
available:
description: Available indicates whether the vtgate service is fully
available.
type: string
serviceName:
description: ServiceName is the name of the Service for this cell's
vtgate.
type: string
type: object
idle:
description: Idle is a condition indicating whether the cell can be
turned down. If Idle is True, there are no keyspaces deployed in the
cell, so it should be safe to turn down the cell.
type: string
keyspaces:
additionalProperties:
type: object
description: Keyspaces is a summary of keyspaces deployed in this cell.
This summary could be empty either if there are no keyspaces, or if
the controller failed to read the current state. Use the Idle condition
to distinguish these scenarios when the difference matters.
type: object
lockserver:
description: Lockserver is a summary of the status of the cell-local
lockserver.
properties:
etcd:
description: Etcd is the status of the EtcdCluster, if we were asked
to deploy one.
properties:
available:
description: Available is a condition that indicates whether
the cluster is able to serve queries.
type: string
clientServiceName:
description: ClientServiceName is the name of the Service for
etcd client connections.
type: string
observedGeneration:
description: The generation observed by the controller.
format: int64
type: integer
type: object
type: object
observedGeneration:
description: The generation observed by the controller.
format: int64
type: integer
type: object
version: v2
versions:
- name: v2
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: vitessclusters.planetscale.com
spec:
group: planetscale.com
names:
kind: VitessCluster
listKind: VitessClusterList
plural: vitessclusters
shortNames:
- vt
singular: vitesscluster
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
backup:
description: Backup specifies how to take and store Vitess backups.
This is optional but strongly recommended. In addition to disaster
recovery, Vitess currently depends on backups to support provisioning
of a new tablet in a shard with existing data, as an implementation
detail.
properties:
engine:
description: 'Engine specifies the Vitess backup engine to use,
either "builtin" or "xtrabackup". Restores will always be done
with whichever engine created a given backup.
Default: builtin'
enum:
- builtin
- xtrabackup
type: string
locations:
description: Locations is a list of places where Vitess backup data
for the cluster can be stored. At least one storage location must
be specified. Within each storage location, there are multiple
fields for various location types (gcs, s3, etc.); exactly one
such field must be populated. Multiple storage locations may
be desired if, for example, the cluster spans multiple regions.
Each storage location is independent of the others; backups can
only be restored from the same storage location in which they
were originally taken.
items:
properties:
azblob:
description: Azblob specifies a backup location in Azure Blob
Storage.
properties:
account:
description: Account is the name of the Azure storage
account to use.
minLength: 1
type: string
authSecret:
description: AuthSecret is a reference to the Secret to
use for Azure authentication.
properties:
key:
description: Key is the name of the item within the
data source to use as the value. For a Kubernetes
Secret object (specified with the 'name' field),
this is the key within the 'data' map. When 'volumeName'
is used, this specifies the name of the file to
load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret
object to use as the data source. The Secret must
be in the same namespace as the VitessCluster. The
'key' field defines the item to pick from the Secret
object's 'data' map. If a Secret name is not specified,
the data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the name
of a Volume in each Pod that should be mounted.
You must ensure a Volume by that name exists in
all relevant Pods, such as by using the appropriate
ExtraVolumes fields. If specified, this takes precedence
over the 'name' field. The 'key' field defines
the name of the file to load within this Volume.
type: string
required:
- key
type: object
container:
description: Container is the name of the Azure storage
account container to use.
minLength: 1
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to
all object keys created by Vitess. This is only needed
if the same container is also used for something other
than backups for VitessClusters. Backups from different
clusters, keyspaces, or shards will automatically avoid
colliding with each other within a container, regardless
of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
required:
- account
- container
- authSecret
type: object
gcs:
description: GCS specifies a backup location in Google Cloud
Storage.
properties:
authSecret:
description: 'AuthSecret is a reference to the Secret
to use for GCS authentication. If set, this must point
to a file in the format expected for the GOOGLE_APPLICATION_CREDENTIALS
environment variable. Default: Use the default credentials
of the Node.'
properties:
key:
description: Key is the name of the item within the
data source to use as the value. For a Kubernetes
Secret object (specified with the 'name' field),
this is the key within the 'data' map. When 'volumeName'
is used, this specifies the name of the file to
load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret
object to use as the data source. The Secret must
be in the same namespace as the VitessCluster. The
'key' field defines the item to pick from the Secret
object's 'data' map. If a Secret name is not specified,
the data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the name
of a Volume in each Pod that should be mounted.
You must ensure a Volume by that name exists in
all relevant Pods, such as by using the appropriate
ExtraVolumes fields. If specified, this takes precedence
over the 'name' field. The 'key' field defines
the name of the file to load within this Volume.
type: string
required:
- key
type: object
bucket:
description: Bucket is the name of the GCS bucket to use.
minLength: 1
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to
all object keys created by Vitess. This is only needed
if the same bucket is also used for something other
than backups for VitessClusters. Backups from different
clusters, keyspaces, or shards will automatically avoid
colliding with each other within a bucket, regardless
of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
required:
- bucket
type: object
name:
description: Name is used to refer to this backup location
from other parts of a VitessCluster object, such as in tablet
pool definitions. This name must be unique among all backup
locations defined in a given cluster. A backup location
with an empty name defines the default location used when
a tablet pool does not specify a backup location name.
maxLength: 25
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
s3:
description: S3 specifies a backup location in Amazon S3.
properties:
authSecret:
description: 'AuthSecret is a reference to the Secret
to use for S3 authentication. If set, this must point
to a file in the format expected for the `~/.aws/credentials`
file. Default: Use the default credentials of the Node.'
properties:
key:
description: Key is the name of the item within the
data source to use as the value. For a Kubernetes
Secret object (specified with the 'name' field),
this is the key within the 'data' map. When 'volumeName'
is used, this specifies the name of the file to
load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret
object to use as the data source. The Secret must
be in the same namespace as the VitessCluster. The
'key' field defines the item to pick from the Secret
object's 'data' map. If a Secret name is not specified,
the data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the name
of a Volume in each Pod that should be mounted.
You must ensure a Volume by that name exists in
all relevant Pods, such as by using the appropriate
ExtraVolumes fields. If specified, this takes precedence
over the 'name' field. The 'key' field defines
the name of the file to load within this Volume.
type: string
required:
- key
type: object
bucket:
description: Bucket is the name of the S3 bucket to use.
minLength: 1
type: string
endpoint:
description: 'Endpoint is the `host:port` (port is required)
for the S3 backend. Default: Use the endpoint associated
with `region` by the driver.'
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to
all object keys created by Vitess. This is only needed
if the same bucket is also used for something other
than backups for VitessClusters. Backups from different
clusters, keyspaces, or shards will automatically avoid
colliding with each other within a bucket, regardless
of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
region:
description: Region is the AWS region in which the bucket
is located.
minLength: 1
type: string
required:
- region
- bucket
type: object
volume:
description: Volume specifies a backup location as a Kubernetes
Volume Source to mount. This can be used, for example, to
store backups on an NFS mount, or on a shared host path
for local testing.
type: object
type: object
minItems: 1
type: array
required:
- locations
type: object
cells:
description: 'Cells is a list of templates for VitessCells to create
for this cluster. Each VitessCell represents a set of Nodes in a
given failure domain, to which VitessKeyspaces can be deployed. The
VitessCell also deploys cell-local services that any keyspaces deployed
there will need. This field is required, but it may be set to an
empty list: []. Before removing any cell from this list, you should
first ensure that no keyspaces are set to deploy to this cell. +patchMergeKey=name
+patchStrategy=merge'
items:
properties:
gateway:
description: Gateway configures the Vitess Gateway deployment
in this cell.
properties:
affinity:
description: 'Affinity allows you to set rules that constrain
the scheduling of your vtgate pods. WARNING: These affinity
rules will override all default affinities that we set;
in turn, we can''t guarantee optimal scheduling of your
pods if you choose to set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used to attach
custom annotations to Pods created for this component. These
will be attached to the underlying Pods that the vtgate
Deployment creates.
type: object
authentication:
description: Authentication configures how Vitess Gateway
authenticates MySQL client connections.
properties:
static:
description: Static configures vtgate to use a static
file containing usernames and passwords.
properties:
secret:
description: Secret configures vtgate to load the
static auth file from a given key in a given Secret.
properties:
key:
description: Key is the name of the item within
the data source to use as the value. For a
Kubernetes Secret object (specified with the
'name' field), this is the key within the 'data'
map. When 'volumeName' is used, this specifies
the name of the file to load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes
Secret object to use as the data source. The
Secret must be in the same namespace as the
VitessCluster. The 'key' field defines the
item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the
data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the
name of a Volume in each Pod that should be
mounted. You must ensure a Volume by that name
exists in all relevant Pods, such as by using
the appropriate ExtraVolumes fields. If specified,
this takes precedence over the 'name' field. The
'key' field defines the name of the file to
load within this Volume.
type: string
required:
- key
type: object
type: object
type: object
extraEnv:
description: ExtraEnv can optionally be used to override default
environment variables set by the operator, or pass additional
environment variables.
items:
type: object
type: array
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally be used to override
default flags set by the operator, or pass additional flags
to vtgate. All entries must be key-value string pairs of
the form "flag": "value". The flag name should not have
any prefix (just "flag", not "-flag"). To set a boolean
flag, set the string value to either "true" or "false".'
type: object
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally be used to attach
custom labels to Pods created for this component. These
will be attached to the underlying Pods that the vtgate
Deployment creates.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally be used to override
default Pod volumeMounts defined by the operator, or specify
additional mounts. Typically, these are used to mount volumes
defined through extraVolumes.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally be used to override
default Pod volumes defined by the operator, or provide
additional volumes to the Pod. Note that when adding a new
volume, you should usually also add a volumeMount to specify
where in each container's filesystem the volume should be
mounted.
items:
type: object
type: array
initContainers:
description: InitContainers can optionally be used to supply
extra init containers that will be run to completion one
after another before any app containers are started.
items:
type: object
type: array
replicas:
description: Replicas is the number of vtgate instances to
deploy in this cell.
format: int32
minimum: 0
type: integer
resources:
description: Resources determines the compute resources reserved
for each vtgate replica.
type: object
secureTransport:
description: SecureTransport configures secure transport connections
for vtgate.
properties:
required:
description: Required configures vtgate to reject non-secure
transport connections. Applies only to MySQL protocol
connections. All GRPC transport is required to be encrypted
when certs are set.
type: boolean
tls:
description: TLS configures vtgate to use TLS encrypted
transport.
properties:
certSecret:
description: CertSecret configures vtgate to load
the TLS cert PEM file from a given key in a given
Secret.
properties:
key:
description: Key is the name of the item within
the data source to use as the value. For a
Kubernetes Secret object (specified with the
'name' field), this is the key within the 'data'
map. When 'volumeName' is used, this specifies
the name of the file to load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes
Secret object to use as the data source. The
Secret must be in the same namespace as the
VitessCluster. The 'key' field defines the
item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the
data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the
name of a Volume in each Pod that should be
mounted. You must ensure a Volume by that name
exists in all relevant Pods, such as by using
the appropriate ExtraVolumes fields. If specified,
this takes precedence over the 'name' field. The
'key' field defines the name of the file to
load within this Volume.
type: string
required:
- key
type: object
clientCACertSecret:
description: ClientCACertSecret configures vtgate
to load the TLS certificate authority PEM file from
a given key in a given Secret. If specified, checks
client certificates are signed by this CA certificate.
Optional.
properties:
key:
description: Key is the name of the item within
the data source to use as the value. For a
Kubernetes Secret object (specified with the
'name' field), this is the key within the 'data'
map. When 'volumeName' is used, this specifies
the name of the file to load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes
Secret object to use as the data source. The
Secret must be in the same namespace as the
VitessCluster. The 'key' field defines the
item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the
data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the
name of a Volume in each Pod that should be
mounted. You must ensure a Volume by that name
exists in all relevant Pods, such as by using
the appropriate ExtraVolumes fields. If specified,
this takes precedence over the 'name' field. The
'key' field defines the name of the file to
load within this Volume.
type: string
required:
- key
type: object
keySecret:
description: KeySecret configures vtgate to load the
TLS key PEM file from a given key in a given Secret.
properties:
key:
description: Key is the name of the item within
the data source to use as the value. For a
Kubernetes Secret object (specified with the
'name' field), this is the key within the 'data'
map. When 'volumeName' is used, this specifies
the name of the file to load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes
Secret object to use as the data source. The
Secret must be in the same namespace as the
VitessCluster. The 'key' field defines the
item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the
data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the
name of a Volume in each Pod that should be
mounted. You must ensure a Volume by that name
exists in all relevant Pods, such as by using
the appropriate ExtraVolumes fields. If specified,
this takes precedence over the 'name' field. The
'key' field defines the name of the file to
load within this Volume.
type: string
required:
- key
type: object
type: object
type: object
sidecarContainers:
description: SidecarContainers can optionally be used to supply
extra containers that run alongside the main containers.
items:
type: object
type: array
type: object
lockserver:
description: 'Lockserver specifies either a deployed or external
lockserver to be used as the Vitess cell-local topology store.
Default: Put this cell''s topology data in the global lockserver
instead of its own lockserver.'
properties:
etcd:
description: Etcd deploys our own etcd cluster as a lockserver.
properties:
advertisePeerURLs:
description: 'AdvertisePeerURLs can optionally be used
to override the URLs that etcd members use to find each
other for peer-to-peer connections. If specified, the
list must contain exactly 3 entries, one for each etcd
member index (1,2,3) respectively. Default: Build peer
URLs automatically based on Kubernetes built-in DNS.'
items:
type: string
maxItems: 3
minItems: 3
type: array
affinity:
description: 'Affinity allows you to set rules that constrain
the scheduling of your Etcd pods. WARNING: These affinity
rules will override all default affinities that we set;
in turn, we can''t guarantee optimal scheduling of your
pods if you choose to set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used to attach
custom annotations to Pods created for this component.
type: object
createClientService:
description: 'CreateClientService sets whether to create
a Service for the client port of etcd member Pods. Note:
Disabling this will NOT delete a Service that was previously
created. Default: true'
type: boolean
createPDB:
description: 'CreatePDB sets whether to create a PodDisruptionBudget
(PDB) for etcd member Pods. Note: Disabling this will
NOT delete a PDB that was previously created. Default:
true'
type: boolean
createPeerService:
description: 'CreatePeerService sets whether to create
a Service for the peer port of etcd member Pods. Note:
Disabling this will NOT delete a Service that was previously
created. Default: true'
type: boolean
dataVolumeClaimTemplate:
description: 'DataVolumeClaimTemplate configures the PersistentVolumeClaims
that will be created for each etcd instance to store
its data files. This field is required. IMPORTANT:
For a cell-local lockserver, you must set a storageClassName
here for a StorageClass that''s configured to only provision
volumes in the Availability Zone that corresponds to
the Vitess cell. Default: Let the operator choose.'
type: object
extraEnv:
description: ExtraEnv can optionally be used to override
default environment variables set by the operator, or
pass additional environment variables.
items:
type: object
type: array
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally be used to override
default flags set by the operator, or pass additional
flags to etcd. All entries must be key-value string
pairs of the form "flag": "value". The flag name should
not have any prefix (just "flag", not "-flag"). To set
a boolean flag, set the string value to either "true"
or "false".'
type: object
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally be used to attach
custom labels to Pods created for this component.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally be used
to override default Pod volumeMounts defined by the
operator, or specify additional mounts. Typically, these
are used to mount volumes defined through extraVolumes.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally be used to override
default Pod volumes defined by the operator, or provide
additional volumes to the Pod. Note that when adding
a new volume, you should usually also add a volumeMount
to specify where in each container's filesystem the
volume should be mounted.
items:
type: object
type: array
image:
description: 'Image is the etcd server image (including
version tag) to deploy. Default: Let the operator choose.'
type: string
imagePullPolicy:
description: ImagePullPolicy specifies if/when to pull
a container image.
type: string
initContainers:
description: InitContainers can optionally be used to
supply extra init containers that will be run to completion
one after another before any app containers are started.
items:
type: object
type: array
localMemberIndex:
description: 'LocalMemberIndex can optionally be used
to specify that only one etcd member should actually
be deployed. This can be used to spread members across
multiple Kubernetes clusters by configuring the EtcdLockserver
CRD in each cluster to deploy a different member index.
If specified, the index must be 1, 2, or 3. Default:
Deploy all etcd members locally.'
format: int32
maximum: 3
minimum: 1
type: integer
resources:
description: 'Resources specify the compute resources
to allocate for each etcd member. Default: Let the operator
choose.'
type: object
sidecarContainers:
description: SidecarContainers can optionally be used
to supply extra containers that run alongside the main
containers.
items:
type: object
type: array
type: object
external:
description: External specifies that we should connect to
an existing lockserver, instead of deploying our own. If
this is set, all other Lockserver fields are ignored.
properties:
address:
description: Address is the host:port of the lockserver
client endpoint.
type: string
implementation:
description: Implementation specifies which Vitess "topo"
plugin to use.
type: string
rootPath:
description: RootPath is a path prefix for all lockserver
data belonging to a given Vitess cluster. Multiple Vitess
clusters can share a lockserver as long as they have
unique root paths.
type: string
required:
- implementation
- address
- rootPath
type: object
type: object
name:
description: Name is the cell name as it should be provided to
Vitess. Note that this is different from the VitessCell object's
metadata.name, which is generated by the operator.
maxLength: 25
minLength: 1
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
zone:
description: Zone is the name of the Availability Zone that this
Vitess Cell should run in. This value should match the value
of the "failure-domain.beta.kubernetes.io/zone" label on the
Kubernetes Nodes in that AZ. If the Kubernetes Nodes don't have
such a label, leave this empty.
type: string
required:
- name
type: object
type: array
extraVitessFlags:
additionalProperties:
type: string
description: 'ExtraVitessFlags can optionally be used to pass flags
to all Vitess components. WARNING: Any flags passed here must be flags
that can be accepted by vtgate, vtctld and vttablet. An example use-case
would be topo flags. All entries must be key-value string pairs of
the form "flag": "value". The flag name should not have any prefix
(just "flag", not "-flag"). To set a boolean flag, set the string
value to either "true" or "false".'
type: object
globalLockserver:
description: 'GlobalLockserver specifies either a deployed or external
lockserver to be used as the Vitess global topology store. Default:
Deploy an etcd cluster as the global lockserver.'
properties:
etcd:
description: Etcd deploys our own etcd cluster as a lockserver.
properties:
advertisePeerURLs:
description: 'AdvertisePeerURLs can optionally be used to override
the URLs that etcd members use to find each other for peer-to-peer
connections. If specified, the list must contain exactly
3 entries, one for each etcd member index (1,2,3) respectively. Default:
Build peer URLs automatically based on Kubernetes built-in
DNS.'
items:
type: string
maxItems: 3
minItems: 3
type: array
affinity:
description: 'Affinity allows you to set rules that constrain
the scheduling of your Etcd pods. WARNING: These affinity
rules will override all default affinities that we set; in
turn, we can''t guarantee optimal scheduling of your pods
if you choose to set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used to attach custom
annotations to Pods created for this component.
type: object
createClientService:
description: 'CreateClientService sets whether to create a Service
for the client port of etcd member Pods. Note: Disabling
this will NOT delete a Service that was previously created. Default:
true'
type: boolean
createPDB:
description: 'CreatePDB sets whether to create a PodDisruptionBudget
(PDB) for etcd member Pods. Note: Disabling this will NOT
delete a PDB that was previously created. Default: true'
type: boolean
createPeerService:
description: 'CreatePeerService sets whether to create a Service
for the peer port of etcd member Pods. Note: Disabling this
will NOT delete a Service that was previously created. Default:
true'
type: boolean
dataVolumeClaimTemplate:
description: 'DataVolumeClaimTemplate configures the PersistentVolumeClaims
that will be created for each etcd instance to store its data
files. This field is required. IMPORTANT: For a cell-local
lockserver, you must set a storageClassName here for a StorageClass
that''s configured to only provision volumes in the Availability
Zone that corresponds to the Vitess cell. Default: Let the
operator choose.'
type: object
extraEnv:
description: ExtraEnv can optionally be used to override default
environment variables set by the operator, or pass additional
environment variables.
items:
type: object
type: array
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally be used to override
default flags set by the operator, or pass additional flags
to etcd. All entries must be key-value string pairs of the
form "flag": "value". The flag name should not have any prefix
(just "flag", not "-flag"). To set a boolean flag, set the
string value to either "true" or "false".'
type: object
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally be used to attach custom
labels to Pods created for this component.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally be used to override
default Pod volumeMounts defined by the operator, or specify
additional mounts. Typically, these are used to mount volumes
defined through extraVolumes.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally be used to override
default Pod volumes defined by the operator, or provide additional
volumes to the Pod. Note that when adding a new volume, you
should usually also add a volumeMount to specify where in
each container's filesystem the volume should be mounted.
items:
type: object
type: array
image:
description: 'Image is the etcd server image (including version
tag) to deploy. Default: Let the operator choose.'
type: string
imagePullPolicy:
description: ImagePullPolicy specifies if/when to pull a container
image.
type: string
initContainers:
description: InitContainers can optionally be used to supply
extra init containers that will be run to completion one after
another before any app containers are started.
items:
type: object
type: array
localMemberIndex:
description: 'LocalMemberIndex can optionally be used to specify
that only one etcd member should actually be deployed. This
can be used to spread members across multiple Kubernetes clusters
by configuring the EtcdLockserver CRD in each cluster to deploy
a different member index. If specified, the index must be
1, 2, or 3. Default: Deploy all etcd members locally.'
format: int32
maximum: 3
minimum: 1
type: integer
resources:
description: 'Resources specify the compute resources to allocate
for each etcd member. Default: Let the operator choose.'
type: object
sidecarContainers:
description: SidecarContainers can optionally be used to supply
extra containers that run alongside the main containers.
items:
type: object
type: array
type: object
external:
description: External specifies that we should connect to an existing
lockserver, instead of deploying our own. If this is set, all
other Lockserver fields are ignored.
properties:
address:
description: Address is the host:port of the lockserver client
endpoint.
type: string
implementation:
description: Implementation specifies which Vitess "topo" plugin
to use.
type: string
rootPath:
description: RootPath is a path prefix for all lockserver data
belonging to a given Vitess cluster. Multiple Vitess clusters
can share a lockserver as long as they have unique root paths.
type: string
required:
- implementation
- address
- rootPath
type: object
type: object
imagePullPolicies:
description: ImagePullPolicies specifies the container image pull policies
to use for images defined in the 'images' field.
properties:
mysqld:
description: Mysqld is the container image pull policy to use for
mysqld.
type: string
mysqldExporter:
description: MysqldExporter is the container image pull policy to
use for mysqld-exporter.
type: string
vtbackup:
description: Vtbackup is the container image pull policy to use
for Vitess Backup jobs.
type: string
vtctld:
description: Vtctld is the container image pull policy to use for
Vitess Dashboard instances.
type: string
vtgate:
description: Vtgate is the container image pull policy to use for
Vitess Gateway instances.
type: string
vttablet:
description: Vttablet is the container image pull policy to use
for Vitess Tablet instances.
type: string
type: object
images:
description: 'Images specifies the container images (including version
tag) to use in the cluster. Default: Let the operator choose.'
properties:
mysqld:
description: Mysqld specifies the container image to use for mysqld,
as well as declaring which MySQL flavor setting in Vitess the
image is compatible with. Only one flavor image may be provided
at a time. mysqld running alongside each tablet.
properties:
mariadb103Compatible:
description: Mariadb103Compatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MariaDB103" flavor setting.
type: string
mariadbCompatible:
description: MariadbCompatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MariaDB" flavor setting.
type: string
mysql56Compatible:
description: Mysql56Compatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MySQL56" flavor setting.
type: string
mysql80Compatible:
description: Mysql80Compatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MySQL80" flavor setting.
type: string
type: object
mysqldExporter:
description: MysqldExporter specifies the container image to use
for mysqld-exporter.
type: string
vtbackup:
description: Vtbackup is the container image (including version
tag) to use for Vitess Backup jobs.
type: string
vtctld:
description: Vtctld is the container image (including version tag)
to use for Vitess Dashboard instances.
type: string
vtgate:
description: Vtgate is the container image (including version tag)
to use for Vitess Gateway instances.
type: string
vttablet:
description: Vttablet is the container image (including version
tag) to use for Vitess Tablet instances.
type: string
type: object
keyspaces:
description: 'Keyspaces defines the logical databases to deploy. A
VitessKeyspace can deploy to multiple VitessCells. This field is
required, but it may be set to an empty list: []. Before removing
any keyspace from this list, you should first ensure that it is undeployed
from all cells by clearing the keyspace''s list of target cells. +patchMergeKey=name
+patchStrategy=merge'
items:
properties:
name:
description: 'Name is the keyspace name as it should be provided
to Vitess. Note that this is different from the VitessKeyspace
object''s metadata.name, which is generated by the operator. WARNING:
DO NOT change the name of a keyspace that was already deployed.
Keyspaces cannot be renamed, so this will be interpreted as
an instruction to delete the old keyspace and create a new one.'
maxLength: 25
minLength: 1
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
partitionings:
description: Partitionings specify how to divide the keyspace
up into shards by defining the range of keyspace IDs that each
shard contains. For example, you might divide the keyspace into
N equal-sized key ranges. Note that this is distinct from defining
how each row maps to a keyspace ID, which is done in the VSchema.
Partitioning is purely an operational concern (scaling the infrastructure),
while VSchema is an application-level concern (modeling relationships
between data). This separation of concerns allows resharding
to occur generically at the infrastructure level without any
knowledge of the data model. Each partitioning must define
a set of shards that fully covers the space of all possible
keyspace IDs; there can be no gaps between ranges. There's usually
only one partitioning present at a time, but during resharding,
it's necessary to launch the destination shards alongside the
source shards. When the resharding is complete, the old partitioning
can be removed, which will turn down (undeploy) any unneeded
shards. If only some shards are being split or joined during
resharding, the shards that aren't changing must be specified
in both partitionings, although the common shards will be shared
(only deployed once). If the per-shard configuration differs,
the configuration in the latter partitioning (in the order listed
in this field) will be used. For this reason, it's recommended
to add new partitionings at the end, and only remove partitionings
from the beginning. This field is required. An unsharded keyspace
may be specified as a partitioning into 1 part.
items:
properties:
custom:
description: Custom partitioning lets you explicitly specify
the key range of every shard, in case you don't want them
to be divided equally.
properties:
shards:
description: Shards is a list of explicit shard specifications.
+patchMergeKey=keyRange +patchStrategy=merge
items:
properties:
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used
to attach custom annotations to the VitessShard
object.
type: object
databaseInitScriptSecret:
description: DatabaseInitScriptSecret specifies
the init_db.sql script file to use for this
shard. This SQL script file is executed immediately
after bootstrapping an empty database to set
up initial tables and other MySQL-level entities
needed by Vitess.
properties:
key:
description: Key is the name of the item within
the data source to use as the value. For
a Kubernetes Secret object (specified with
the 'name' field), this is the key within
the 'data' map. When 'volumeName' is used,
this specifies the name of the file to load
within that Volume.
type: string
name:
description: Name is the name of a Kubernetes
Secret object to use as the data source.
The Secret must be in the same namespace
as the VitessCluster. The 'key' field defines
the item to pick from the Secret object's
'data' map. If a Secret name is not specified,
the data source must be defined with the
'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies
the name of a Volume in each Pod that should
be mounted. You must ensure a Volume by
that name exists in all relevant Pods, such
as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence
over the 'name' field. The 'key' field
defines the name of the file to load within
this Volume.
type: string
required:
- key
type: object
keyRange:
description: 'KeyRange is the range of keys that
this shard serves. WARNING: DO NOT change the
key range of a shard after deploying. That''s
effectively deleting the old shard and adding
a new one, which can lead to downtime
or data loss. Instead, add an additional partitioning
with the desired set of shards, perform a resharding migration,
and then remove the old partitioning.'
properties:
end:
description: End is a lowercase hexadecimal
string representation of an arbitrary-length
sequence of bytes. If End is the empty string,
the key range is unbounded at the top. If
End is not empty, the bytes of a keyspace
ID must compare strictly less than End in
lexicographical order to be in the range.
pattern: ^([0-9a-f][0-9a-f])*$
type: string
start:
description: Start is a lowercase hexadecimal
string representation of an arbitrary-length
sequence of bytes. If Start is the empty
string, the key range is unbounded at the
bottom. If Start is not empty, the bytes
of a keyspace ID must compare greater than
or equal to Start in lexicographical order
to be in the range.
pattern: ^([0-9a-f][0-9a-f])*$
type: string
type: object
replication:
description: Replication configures Vitess replication
settings for the shard.
properties:
enforceSemiSync:
description: 'EnforceSemiSync means Vitess
will configure MySQL to require semi-sync
acknowledgement of all transactions while
forbidding fallback to asynchronous replication
under any circumstance. Note that this
is different from merely *enabling* semi-sync,
which in its default configuration allows
fallback to asynchronous replication if
no replicas are connected or if they don''t
respond after a few seconds. Enforced semi-sync
is a mode that prefers master unavailability
when durability cannot be ensured, rather
than risking the loss of data that was already
reported to clients as committed. WARNING:
Do not enable this if the shard has fewer
than 3 master-eligible replicas, as that
may lead to master unavailability during
routine maintenance. Default: Semi-sync
is not enforced.'
type: boolean
initializeBackup:
description: 'InitializeBackup specifies whether
to take an initial placeholder backup as
part of preparing tablets to begin replication.
This only takes effect if a backup location
is defined in the VitessCluster. Default:
true.'
type: boolean
initializeMaster:
description: 'InitializeMaster specifies whether
to choose an initial master for a new or
restored shard that has no master yet. Default:
true.'
type: boolean
type: object
tabletPools:
description: TabletPools specify groups of tablets
in a given cell with a certain tablet type and
a shared configuration template. There must
be at most one pool in this list for each (cell,type)
pair. Each shard must have at least one "replica"
pool (in at least one cell) in order to be able
to serve. +patchMergeKey=type +patchStrategy=merge
+listType=map +listMapKey=type +listMapKey=cell
items:
properties:
affinity:
description: 'Affinity allows you to set
rules that constrain the scheduling of
your vttablet pods. Affinity rules will
affect all underlying tablets in the specified
tablet pool the same way. WARNING: These
affinity rules will override all default
affinities that we set; in turn, we can''t
guarantee optimal scheduling of your pods
if you choose to set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally
be used to attach custom annotations to
Pods created for this component.
type: object
backupLocationName:
description: 'BackupLocationName is the
name of the backup location to use for
this tablet pool. It must match the name
of one of the backup locations defined
in the VitessCluster. Default: Use the
backup location whose name is empty.'
type: string
cell:
description: Cell is the name of the Vitess
cell in which to deploy this pool.
minLength: 1
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
dataVolumeClaimTemplate:
description: 'DataVolumeClaimTemplate configures
the PersistentVolumeClaims that will be
created for each tablet to store its database
files. This field is required for local
MySQL, but should be omitted in the case
of externally managed MySQL. IMPORTANT:
If your Kubernetes cluster is multi-zone,
you must set a storageClassName here for
a StorageClass that''s configured to only
provision volumes in the same zone as
this tablet pool.'
type: object
externalDatastore:
description: ExternalDatastore provides
information for an externally managed
MySQL. You must specify either Mysqld
or ExternalDatastore, but not both.
properties:
credentialsSecret:
description: 'CredentialsSecret should
link to a JSON credentials file used
to connect to the externally managed
MySQL endpoint. The credentials file
is understood and parsed by Vitess
and must be in the format: { "username":
[ "password" ] } Vitess always
uses the first password in the password
array.'
properties:
key:
description: Key is the name of
the item within the data source
to use as the value. For a Kubernetes
Secret object (specified with
the 'name' field), this is the
key within the 'data' map. When
'volumeName' is used, this specifies
the name of the file to load within
that Volume.
type: string
name:
description: Name is the name of
a Kubernetes Secret object to
use as the data source. The Secret
must be in the same namespace
as the VitessCluster. The 'key'
field defines the item to pick
from the Secret object's 'data'
map. If a Secret name is not
specified, the data source must
be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly
specifies the name of a Volume
in each Pod that should be mounted.
You must ensure a Volume by that
name exists in all relevant Pods,
such as by using the appropriate
ExtraVolumes fields. If specified,
this takes precedence over the
'name' field. The 'key' field
defines the name of the file to
load within this Volume.
type: string
required:
- key
type: object
database:
description: Database is the name of
the database.
type: string
host:
description: Host is the endpoint string
to an externally managed MySQL, without
any port.
type: string
port:
description: Port specifies the port
for the externally managed MySQL endpoint.
format: int32
maximum: 65535
minimum: 1
type: integer
serverCACertSecret:
description: ServerCACertSecret should
link to a certificate authority file
if one is required by your externally
managed MySQL endpoint.
properties:
key:
description: Key is the name of
the item within the data source
to use as the value. For a Kubernetes
Secret object (specified with
the 'name' field), this is the
key within the 'data' map. When
'volumeName' is used, this specifies
the name of the file to load within
that Volume.
type: string
name:
description: Name is the name of
a Kubernetes Secret object to
use as the data source. The Secret
must be in the same namespace
as the VitessCluster. The 'key'
field defines the item to pick
from the Secret object's 'data'
map. If a Secret name is not
specified, the data source must
be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly
specifies the name of a Volume
in each Pod that should be mounted.
You must ensure a Volume by that
name exists in all relevant Pods,
such as by using the appropriate
ExtraVolumes fields. If specified,
this takes precedence over the
'name' field. The 'key' field
defines the name of the file to
load within this Volume.
type: string
required:
- key
type: object
user:
description: User is a provided database
user from an externally managed MySQL
that Vitess can use to carry out necessary
actions. Password for this user must
be supplied in the CredentialsSecret.
type: string
required:
- user
- host
- port
- database
- credentialsSecret
type: object
extraEnv:
description: ExtraEnv can optionally be
used to override default environment variables
set by the operator, or pass additional
environment variables. These values are
applied to both the vttablet and mysqld
containers.
items:
type: object
type: array
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally
be used to attach custom labels to Pods
created for this component.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally
be used to override default Pod volumeMounts
defined by the operator, or specify additional
mounts. Typically, these are used to mount
volumes defined through extraVolumes.
These values are applied to both the vttablet
and mysqld containers.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally
be used to override default Pod volumes
defined by the operator, or provide additional
volumes to the Pod. Note that when adding
a new volume, you should usually also
add a volumeMount to specify where in
each container's filesystem the volume
should be mounted. These volumes are available
to be mounted by both vttablet and mysqld.
items:
type: object
type: array
initContainers:
description: InitContainers can optionally
be used to supply extra init containers
that will be run to completion one after
another before any app containers are
started.
items:
type: object
type: array
mysqld:
description: Mysqld configures a local MySQL
running inside each tablet Pod. You must
specify either Mysqld or ExternalDatastore,
but not both.
properties:
configOverrides:
description: ConfigOverrides can optionally
be used to provide a my.cnf snippet
to override default my.cnf values
(included with Vitess) for this particular
MySQL instance.
type: string
resources:
description: Resources specify the compute
resources to allocate for just the
MySQL process (the underlying local
datastore). This field is required.
type: object
required:
- resources
type: object
replicas:
description: Replicas is the number of tablets
to deploy in this pool. This field is
required, although it may be set to 0,
which will scale the pool down to 0 tablets.
format: int32
minimum: 0
type: integer
sidecarContainers:
description: SidecarContainers can optionally
be used to supply extra containers that
run alongside the main containers.
items:
type: object
type: array
type:
description: Type is the type of tablet
contained in this tablet pool. The allowed
types are "replica" for master-eligible
replicas that serve transactional (OLTP)
workloads; and "rdonly" for master-ineligible
replicas (can never be promoted to master)
that serve batch/analytical (OLAP) workloads.
enum:
- replica
- rdonly
- externalmaster
- externalreplica
- externalrdonly
type: string
vttablet:
description: Vttablet configures the vttablet
server within each tablet.
properties:
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally
be used to override default flags
set by the operator, or pass additional
flags to vttablet. All entries must
be key-value string pairs of the form
"flag": "value". The flag name should
not have any prefix (just "flag",
not "-flag"). To set a boolean flag,
set the string value to either "true"
or "false".'
type: object
resources:
description: Resources specify the compute
resources to allocate for just the
vttablet process (the Vitess query
server that sits in front of MySQL).
This field is required.
type: object
required:
- resources
type: object
required:
- cell
- type
- replicas
- vttablet
type: object
type: array
required:
- keyRange
- databaseInitScriptSecret
type: object
type: array
required:
- shards
type: object
equal:
description: Equal partitioning splits the keyspace into
some number of equal parts, assuming that the keyspace
IDs are uniformly distributed, for example because they're
generated by a hash vindex.
properties:
parts:
description: 'Parts is the number of equal parts to
split the keyspace into. If you need shards that are
not equal-sized, use custom partitioning instead. Note
that if the number of parts is not a power of 2, the
key ranges will only be roughly equal in size. WARNING:
DO NOT change the number of parts in a partitioning
after deploying. That''s effectively deleting
the old partitioning and adding a new one, which
can lead to downtime or data loss. Instead, add an
additional partitioning with the desired
number of parts, perform a resharding migration,
and then remove the old partitioning.'
format: int32
minimum: 1
type: integer
shardTemplate:
description: ShardTemplate is the configuration used
for each equal-sized shard. If you need shards that
don't all share the same configuration, use custom
partitioning instead.
properties:
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used
to attach custom annotations to the VitessShard
object.
type: object
databaseInitScriptSecret:
description: DatabaseInitScriptSecret specifies
the init_db.sql script file to use for this shard.
This SQL script file is executed immediately after
bootstrapping an empty database to set up initial
tables and other MySQL-level entities needed by
Vitess.
properties:
key:
description: Key is the name of the item within
the data source to use as the value. For
a Kubernetes Secret object (specified with
the 'name' field), this is the key within
the 'data' map. When 'volumeName' is used,
this specifies the name of the file to load
within that Volume.
type: string
name:
description: Name is the name of a Kubernetes
Secret object to use as the data source. The
Secret must be in the same namespace as the
VitessCluster. The 'key' field defines the
item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the
data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the
name of a Volume in each Pod that should be
mounted. You must ensure a Volume by that
name exists in all relevant Pods, such as
by using the appropriate ExtraVolumes fields.
If specified, this takes precedence over the
'name' field. The 'key' field defines the
name of the file to load within this Volume.
type: string
required:
- key
type: object
replication:
description: Replication configures Vitess replication
settings for the shard.
properties:
enforceSemiSync:
description: 'EnforceSemiSync means Vitess will
configure MySQL to require semi-sync acknowledgement
of all transactions while forbidding fallback
to asynchronous replication under any circumstance. Note
that this is different from merely *enabling*
semi-sync, which in its default configuration
allows fallback to asynchronous replication
if no replicas are connected or if they don''t
respond after a few seconds. Enforced semi-sync
is a mode that prefers master unavailability
when durability cannot be ensured, rather
than risking the loss of data that was already
reported to clients as committed. WARNING:
Do not enable this if the shard has fewer
than 3 master-eligible replicas, as that may
lead to master unavailability during routine
maintenance. Default: Semi-sync is not enforced.'
type: boolean
initializeBackup:
description: 'InitializeBackup specifies whether
to take an initial placeholder backup as part
of preparing tablets to begin replication.
This only takes effect if a backup location
is defined in the VitessCluster. Default:
true.'
type: boolean
initializeMaster:
description: 'InitializeMaster specifies whether
to choose an initial master for a new or restored
shard that has no master yet. Default: true.'
type: boolean
type: object
tabletPools:
description: TabletPools specify groups of tablets
in a given cell with a certain tablet type and
a shared configuration template. There must be
at most one pool in this list for each (cell,type)
pair. Each shard must have at least one "replica"
pool (in at least one cell) in order to be able
to serve. +patchMergeKey=type +patchStrategy=merge
+listType=map +listMapKey=type +listMapKey=cell
items:
properties:
affinity:
description: 'Affinity allows you to set rules
that constrain the scheduling of your vttablet
pods. Affinity rules will affect all underlying
tablets in the specified tablet pool the
same way. WARNING: These affinity rules
will override all default affinities that
we set; in turn, we can''t guarantee optimal
scheduling of your pods if you choose to
set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally be
used to attach custom annotations to Pods
created for this component.
type: object
backupLocationName:
description: 'BackupLocationName is the name
of the backup location to use for this tablet
pool. It must match the name of one of the
backup locations defined in the VitessCluster.
Default: Use the backup location whose name
is empty.'
type: string
cell:
description: Cell is the name of the Vitess
cell in which to deploy this pool.
minLength: 1
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
dataVolumeClaimTemplate:
description: 'DataVolumeClaimTemplate configures
the PersistentVolumeClaims that will be
created for each tablet to store its database
files. This field is required for local
MySQL, but should be omitted in the case
of externally managed MySQL. IMPORTANT:
If your Kubernetes cluster is multi-zone,
you must set a storageClassName here for
a StorageClass that''s configured to only
provision volumes in the same zone as this
tablet pool.'
type: object
externalDatastore:
description: ExternalDatastore provides information
for an externally managed MySQL. You must
specify either Mysqld or ExternalDatastore,
but not both.
properties:
credentialsSecret:
description: 'CredentialsSecret should
link to a JSON credentials file used
to connect to the externally managed
MySQL endpoint. The credentials file
is understood and parsed by Vitess and
must be in the format: { "username":
[ "password" ] } Vitess always
uses the first password in the password
array.'
properties:
key:
description: Key is the name of the
item within the data source to use
as the value. For a Kubernetes
Secret object (specified with the
'name' field), this is the key within
the 'data' map. When 'volumeName'
is used, this specifies the name
of the file to load within that
Volume.
type: string
name:
description: Name is the name of a
Kubernetes Secret object to use
as the data source. The Secret must
be in the same namespace as the
VitessCluster. The 'key' field
defines the item to pick from the
Secret object's 'data' map. If
a Secret name is not specified,
the data source must be defined
with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies
the name of a Volume in each Pod
that should be mounted. You must
ensure a Volume by that name exists
in all relevant Pods, such as by
using the appropriate ExtraVolumes
fields. If specified, this takes
precedence over the 'name' field. The
'key' field defines the name of
the file to load within this Volume.
type: string
required:
- key
type: object
database:
description: Database is the name of the
database.
type: string
host:
description: Host is the endpoint string
to an externally managed MySQL, without
any port.
type: string
port:
description: Port specifies the port for
the externally managed MySQL endpoint.
format: int32
maximum: 65535
minimum: 1
type: integer
serverCACertSecret:
description: ServerCACertSecret should
link to a certificate authority file
if one is required by your externally
managed MySQL endpoint.
properties:
key:
description: Key is the name of the
item within the data source to use
as the value. For a Kubernetes
Secret object (specified with the
'name' field), this is the key within
the 'data' map. When 'volumeName'
is used, this specifies the name
of the file to load within that
Volume.
type: string
name:
description: Name is the name of a
Kubernetes Secret object to use
as the data source. The Secret must
be in the same namespace as the
VitessCluster. The 'key' field
defines the item to pick from the
Secret object's 'data' map. If
a Secret name is not specified,
the data source must be defined
with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies
the name of a Volume in each Pod
that should be mounted. You must
ensure a Volume by that name exists
in all relevant Pods, such as by
using the appropriate ExtraVolumes
fields. If specified, this takes
precedence over the 'name' field. The
'key' field defines the name of
the file to load within this Volume.
type: string
required:
- key
type: object
user:
description: User is a provided database
user from an externally managed MySQL
that Vitess can use to carry out necessary
actions. Password for this user must
be supplied in the CredentialsSecret.
type: string
required:
- user
- host
- port
- database
- credentialsSecret
type: object
extraEnv:
description: ExtraEnv can optionally be used
to override default environment variables
set by the operator, or pass additional
environment variables. These values are
applied to both the vttablet and mysqld
containers.
items:
type: object
type: array
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally be
used to attach custom labels to Pods created
for this component.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally
be used to override default Pod volumeMounts
defined by the operator, or specify additional
mounts. Typically, these are used to mount
volumes defined through extraVolumes. These
values are applied to both the vttablet
and mysqld containers.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally be
used to override default Pod volumes defined
by the operator, or provide additional volumes
to the Pod. Note that when adding a new
volume, you should usually also add a volumeMount
to specify where in each container's filesystem
the volume should be mounted. These volumes
are available to be mounted by both vttablet
and mysqld.
items:
type: object
type: array
initContainers:
description: InitContainers can optionally
be used to supply extra init containers
that will be run to completion one after
another before any app containers are started.
items:
type: object
type: array
mysqld:
description: Mysqld configures a local MySQL
running inside each tablet Pod. You must
specify either Mysqld or ExternalDatastore,
but not both.
properties:
configOverrides:
description: ConfigOverrides can optionally
be used to provide a my.cnf snippet
to override default my.cnf values (included
with Vitess) for this particular MySQL
instance.
type: string
resources:
description: Resources specify the compute
resources to allocate for just the MySQL
process (the underlying local datastore).
This field is required.
type: object
required:
- resources
type: object
replicas:
description: Replicas is the number of tablets
to deploy in this pool. This field is required,
although it may be set to 0, which will
scale the pool down to 0 tablets.
format: int32
minimum: 0
type: integer
sidecarContainers:
description: SidecarContainers can optionally
be used to supply extra containers that
run alongside the main containers.
items:
type: object
type: array
type:
description: Type is the type of tablet contained
in this tablet pool. The allowed types are
"replica" for master-eligible replicas that
serve transactional (OLTP) workloads; and
"rdonly" for master-ineligible replicas
(can never be promoted to master) that serve
batch/analytical (OLAP) workloads.
enum:
- replica
- rdonly
- externalmaster
- externalreplica
- externalrdonly
type: string
vttablet:
description: Vttablet configures the vttablet
server within each tablet.
properties:
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally
be used to override default flags set
by the operator, or pass additional
flags to vttablet. All entries must
be key-value string pairs of the form
"flag": "value". The flag name should
not have any prefix (just "flag", not
"-flag"). To set a boolean flag, set
the string value to either "true" or
"false".'
type: object
resources:
description: Resources specify the compute
resources to allocate for just the vttablet
process (the Vitess query server that
sits in front of MySQL). This field
is required.
type: object
required:
- resources
type: object
required:
- cell
- type
- replicas
- vttablet
type: object
type: array
required:
- databaseInitScriptSecret
type: object
required:
- parts
type: object
type: object
maxItems: 2
minItems: 1
type: array
turndownPolicy:
description: 'TurndownPolicy specifies what should happen if this
keyspace is ever removed from the VitessCluster spec. By default,
removing a keyspace entry from the VitessCluster spec will NOT
actually turn down the deployed resources, unless it can be
verified that the keyspace was previously set to have 0 total
desired tablets across all shards. With this default policy
(RequireIdle), before removing the keyspace entry from the spec,
you must first edit the keyspace entry to remove all tablet
pools from all shards, and wait for that change to roll out.
If a keyspace entry is removed too soon, the keyspace resources
will remain deployed indefinitely, and the keyspace will be
listed in the orphanedKeyspaces field of VitessCluster status. This
is a safety mechanism to prevent accidental edits to the cluster
object from having immediate, destructive consequences. If the
cluster spec is only ever edited by automation whose edits you
trust to be safe, you can set the policy to Immediate to skip
these checks. Default: RequireIdle'
enum:
- RequireIdle
- Immediate
type: string
required:
- name
- partitionings
type: object
type: array
topologyReconciliation:
description: TopologyReconciliation can be used to enable or disable
registration or pruning of various vitess components to and from topo
records.
properties:
pruneCells:
description: 'PruneCells can be used to enable or disable pruning
of extraneous cells from topo records. Default: true'
type: boolean
pruneKeyspaces:
description: 'PruneKeyspaces can be used to enable or disable pruning
of extraneous keyspaces from topo records. Default: true'
type: boolean
pruneShardCells:
description: 'PruneShardCells can be used to enable or disable pruning
of extraneous shard cells from topo records. Default: true'
type: boolean
pruneShards:
description: 'PruneShards can be used to enable or disable pruning
of extraneous shards from topo records. Default: true'
type: boolean
pruneSrvKeyspaces:
description: 'PruneSrvKeyspaces can be used to enable or disable
pruning of extraneous serving keyspaces from topo records. Default:
true'
type: boolean
pruneTablets:
description: 'PruneTablets can be used to enable or disable pruning
of extraneous tablets from topo records. Default: true'
type: boolean
registerCells:
description: 'RegisterCells can be used to enable or disable registering
cells into topo records. Default: true'
type: boolean
registerCellsAliases:
description: 'RegisterCellsAliases can be used to enable or disable
registering cells aliases into topo records. Default: true'
type: boolean
type: object
vitessDashboard:
description: Dashboard deploys a set of Vitess Dashboard servers (vtctld)
for the Vitess cluster.
properties:
affinity:
description: 'Affinity allows you to set rules that constrain the
scheduling of your vtctld pods. WARNING: These affinity rules
will override all default affinities that we set; in turn, we
can''t guarantee optimal scheduling of your pods if you choose
to set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used to attach custom
annotations to Pods created for this component. These will be
attached to the underlying Pods that the vtctld Deployment creates.
type: object
cells:
description: 'Cells is a list of cell names (as defined in the Cells
list) in which to deploy vtctld. Default: Deploy to all defined
cells.'
items:
type: string
type: array
extraEnv:
description: ExtraEnv can optionally be used to override default
environment variables set by the operator, or pass additional
environment variables.
items:
type: object
type: array
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally be used to override default
flags set by the operator, or pass additional flags to vtctld.
All entries must be key-value string pairs of the form "flag":
"value". The flag name should not have any prefix (just "flag",
not "-flag"). To set a boolean flag, set the string value to either
"true" or "false".'
type: object
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally be used to attach custom
labels to Pods created for this component. These will be attached
to the underlying Pods that the vtctld Deployment creates.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally be used to override
default Pod volumeMounts defined by the operator, or specify additional
mounts. Typically, these are used to mount volumes defined through
extraVolumes.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally be used to override default
Pod volumes defined by the operator, or provide additional volumes
to the Pod. Note that when adding a new volume, you should usually
also add a volumeMount to specify where in each container's filesystem
the volume should be mounted.
items:
type: object
type: array
initContainers:
description: InitContainers can optionally be used to supply extra
init containers that will be run to completion one after another
before any app containers are started.
items:
type: object
type: array
replicas:
description: Replicas is the number of vtctld instances to deploy
in each cell.
format: int32
type: integer
resources:
description: Resources determines the compute resources reserved
for each vtctld replica.
type: object
sidecarContainers:
description: SidecarContainers can optionally be used to supply
extra containers that run alongside the main containers.
items:
type: object
type: array
type: object
required:
- cells
type: object
status:
properties:
cells:
additionalProperties:
properties:
gatewayAvailable:
description: GatewayAvailable indicates whether the vtgate service
is fully available.
type: string
pendingChanges:
description: PendingChanges describes changes to the cell that
will be applied the next time a rolling update allows.
type: string
type: object
description: Cells is a summary of the status of desired cells.
type: object
gatewayServiceName:
description: GatewayServiceName is the name of the cluster-wide vtgate
Service.
type: string
globalLockserver:
description: GlobalLockserver is the status of the global lockserver.
properties:
etcd:
description: Etcd is the status of the EtcdCluster, if we were asked
to deploy one.
properties:
available:
description: Available is a condition that indicates whether
the cluster is able to serve queries.
type: string
clientServiceName:
description: ClientServiceName is the name of the Service for
etcd client connections.
type: string
observedGeneration:
description: The generation observed by the controller.
format: int64
type: integer
type: object
type: object
keyspaces:
additionalProperties:
properties:
cells:
description: Cells is a list of cells in which any observed tablets
for this keyspace are deployed.
items:
type: string
type: array
desiredShards:
description: DesiredShards is the number of desired shards. This
is computed from information that's already available in the
spec, but clients should use this value instead of trying to
compute shard partitionings on their own.
format: int32
type: integer
desiredTablets:
description: DesiredTablets is the total number of desired tablets
across all shards. This is computed from information that's
already available in the spec, but clients should use this value
instead of trying to compute shard partitionings on their own.
format: int32
type: integer
pendingChanges:
description: PendingChanges describes changes to the keyspace
that will be applied the next time a rolling update allows.
type: string
readyShards:
description: ReadyShards is the number of desired shards that
are Ready.
format: int32
type: integer
readyTablets:
description: ReadyTablets is the number of desired tablets that
are Ready.
format: int32
type: integer
shards:
description: Shards is the number of observed shards. This could
be higher or lower than desiredShards if the state has not yet
converged.
format: int32
type: integer
tablets:
description: Tablets is the total number of observed tablets across
all shards. This could be higher or lower than desiredTablets
if the state has not yet converged.
format: int32
type: integer
updatedShards:
description: UpdatedShards is the number of desired shards that
are up-to-date (have no pending changes).
format: int32
type: integer
updatedTablets:
description: UpdatedTablets is the number of desired tablets that
are up-to-date (have no pending changes).
format: int32
type: integer
type: object
description: Keyspaces is a summary of the status of desired keyspaces.
type: object
observedGeneration:
description: The generation observed by the controller.
format: int64
type: integer
orphanedCells:
additionalProperties:
properties:
message:
description: Message is a human-readable explanation for why the
object is orphaned.
type: string
reason:
description: Reason is a CamelCase token for programmatic reasoning
about why the object is orphaned.
type: string
required:
- reason
- message
type: object
description: OrphanedCells is a list of unwanted cells that could not
be turned down.
type: object
orphanedKeyspaces:
additionalProperties:
properties:
message:
description: Message is a human-readable explanation for why the
object is orphaned.
type: string
reason:
description: Reason is a CamelCase token for programmatic reasoning
about why the object is orphaned.
type: string
required:
- reason
- message
type: object
description: OrphanedKeyspaces is a list of unwanted keyspaces that
could not be turned down.
type: object
vitessDashboard:
description: VitessDashboard is a summary of the status of the vtctld
deployment.
properties:
available:
description: Available indicates whether the vtctld service has
available endpoints.
type: string
serviceName:
description: ServiceName is the name of the Service for this cluster's
vtctld.
type: string
type: object
type: object
version: v2
versions:
- name: v2
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: vitesskeyspaces.planetscale.com
spec:
group: planetscale.com
names:
kind: VitessKeyspace
listKind: VitessKeyspaceList
plural: vitesskeyspaces
shortNames:
- vtk
singular: vitesskeyspace
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
backupEngine:
description: BackupEngine specifies the Vitess backup engine to use,
either "builtin" or "xtrabackup".
type: string
backupLocations:
description: BackupLocations are the backup locations defined in the
VitessCluster.
items:
properties:
azblob:
description: Azblob specifies a backup location in Azure Blob
Storage.
properties:
account:
description: Account is the name of the Azure storage account
to use.
minLength: 1
type: string
authSecret:
description: AuthSecret is a reference to the Secret to use
for Azure authentication.
properties:
key:
description: Key is the name of the item within the data
source to use as the value. For a Kubernetes Secret
object (specified with the 'name' field), this is the
key within the 'data' map. When 'volumeName' is used,
this specifies the name of the file to load within that
Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object
to use as the data source. The Secret must be in the
same namespace as the VitessCluster. The 'key' field
defines the item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the data source
must be defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of
a Volume in each Pod that should be mounted. You must
ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of the
file to load within this Volume.
type: string
required:
- key
type: object
container:
description: Container is the name of the Azure storage account
container to use.
minLength: 1
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to all
object keys created by Vitess. This is only needed if the
same container is also used for something other than backups
for VitessClusters. Backups from different clusters, keyspaces,
or shards will automatically avoid colliding with each other
within a container, regardless of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
required:
- account
- container
- authSecret
type: object
gcs:
description: GCS specifies a backup location in Google Cloud Storage.
properties:
authSecret:
description: 'AuthSecret is a reference to the Secret to use
for GCS authentication. If set, this must point to a file
in the format expected for the GOOGLE_APPLICATION_CREDENTIALS
environment variable. Default: Use the default credentials
of the Node.'
properties:
key:
description: Key is the name of the item within the data
source to use as the value. For a Kubernetes Secret
object (specified with the 'name' field), this is the
key within the 'data' map. When 'volumeName' is used,
this specifies the name of the file to load within that
Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object
to use as the data source. The Secret must be in the
same namespace as the VitessCluster. The 'key' field
defines the item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the data source
must be defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of
a Volume in each Pod that should be mounted. You must
ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of the
file to load within this Volume.
type: string
required:
- key
type: object
bucket:
description: Bucket is the name of the GCS bucket to use.
minLength: 1
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to all
object keys created by Vitess. This is only needed if the
same bucket is also used for something other than backups
for VitessClusters. Backups from different clusters, keyspaces,
or shards will automatically avoid colliding with each other
within a bucket, regardless of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
required:
- bucket
type: object
name:
description: Name is used to refer to this backup location from
other parts of a VitessCluster object, such as in tablet pool
definitions. This name must be unique among all backup locations
defined in a given cluster. A backup location with an empty
name defines the default location used when a tablet pool does
not specify a backup location name.
maxLength: 25
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
s3:
description: S3 specifies a backup location in Amazon S3.
properties:
authSecret:
description: 'AuthSecret is a reference to the Secret to use
for S3 authentication. If set, this must point to a file
in the format expected for the `~/.aws/credentials` file.
Default: Use the default credentials of the Node.'
properties:
key:
description: Key is the name of the item within the data
source to use as the value. For a Kubernetes Secret
object (specified with the 'name' field), this is the
key within the 'data' map. When 'volumeName' is used,
this specifies the name of the file to load within that
Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object
to use as the data source. The Secret must be in the
same namespace as the VitessCluster. The 'key' field
defines the item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the data source
must be defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of
a Volume in each Pod that should be mounted. You must
ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of the
file to load within this Volume.
type: string
required:
- key
type: object
bucket:
description: Bucket is the name of the S3 bucket to use.
minLength: 1
type: string
endpoint:
description: 'Endpoint is the `host:port` (port is required)
for the S3 backend. Default: Use the endpoint associated
with `region` by the driver.'
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to all
object keys created by Vitess. This is only needed if the
same bucket is also used for something other than backups
for VitessClusters. Backups from different clusters, keyspaces,
or shards will automatically avoid colliding with each other
within a bucket, regardless of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
region:
description: Region is the AWS region in which the bucket
is located.
minLength: 1
type: string
required:
- region
- bucket
type: object
volume:
description: Volume specifies a backup location as a Kubernetes
Volume Source to mount. This can be used, for example, to store
backups on an NFS mount, or on a shared host path for local
testing.
type: object
type: object
type: array
extraVitessFlags:
additionalProperties:
type: string
description: ExtraVitessFlags is inherited from the parent's VitessClusterSpec.
type: object
globalLockserver:
description: GlobalLockserver are the params to connect to the global
lockserver.
properties:
address:
description: Address is the host:port of the lockserver client endpoint.
type: string
implementation:
description: Implementation specifies which Vitess "topo" plugin
to use.
type: string
rootPath:
description: RootPath is a path prefix for all lockserver data belonging
to a given Vitess cluster. Multiple Vitess clusters can share
a lockserver as long as they have unique root paths.
type: string
required:
- implementation
- address
- rootPath
type: object
imagePullPolicies:
description: ImagePullPolicies are inherited from the VitessCluster
spec.
properties:
mysqld:
description: Mysqld is the container image pull policy to use for
mysqld.
type: string
mysqldExporter:
description: MysqldExporter is the container image pull policy to
use for mysqld-exporter.
type: string
vtbackup:
description: Vtbackup is the container image pull policy to use
for Vitess Backup jobs.
type: string
vtctld:
description: Vtctld is the container image pull policy to use for
Vitess Dashboard instances.
type: string
vtgate:
description: Vtgate is the container image pull policy to use for
Vitess Gateway instances.
type: string
vttablet:
description: Vttablet is the container image pull policy to use
for Vitess Tablet instances.
type: string
type: object
images:
description: Images are not customizable by users at the keyspace level
because version skew across the cluster is discouraged except during
rolling updates, in which case this field is automatically managed
by the VitessCluster controller that owns this VitessKeyspace.
properties:
mysqld:
description: Mysqld specifies the container image to use for mysqld,
as well as declaring which MySQL flavor setting in Vitess the
image is compatible with. Only one flavor image may be provided
at a time. mysqld running alongside each tablet.
properties:
mariadb103Compatible:
description: Mariadb103Compatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MariaDB103" flavor setting.
type: string
mariadbCompatible:
description: MariadbCompatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MariaDB" flavor setting.
type: string
mysql56Compatible:
description: Mysql56Compatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MySQL56" flavor setting.
type: string
mysql80Compatible:
description: Mysql80Compatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MySQL80" flavor setting.
type: string
type: object
mysqldExporter:
description: MysqldExporter specifies the container image for mysqld-exporter.
type: string
vtbackup:
description: Vtbackup is the container image (including version
tag) to use for Vitess Backup jobs.
type: string
vttablet:
description: Vttablet is the container image (including version
tag) to use for Vitess Tablet instances.
type: string
type: object
name:
description: 'Name is the keyspace name as it should be provided to
Vitess. Note that this is different from the VitessKeyspace object''s
metadata.name, which is generated by the operator. WARNING: DO NOT
change the name of a keyspace that was already deployed. Keyspaces
cannot be renamed, so this will be interpreted as an instruction to
delete the old keyspace and create a new one.'
maxLength: 25
minLength: 1
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
partitionings:
description: Partitionings specify how to divide the keyspace up into
shards by defining the range of keyspace IDs that each shard contains.
For example, you might divide the keyspace into N equal-sized key
ranges. Note that this is distinct from defining how each row maps
to a keyspace ID, which is done in the VSchema. Partitioning is purely
an operational concern (scaling the infrastructure), while VSchema
is an application-level concern (modeling relationships between data).
This separation of concerns allows resharding to occur generically
at the infrastructure level without any knowledge of the data model. Each
partitioning must define a set of shards that fully covers the space
of all possible keyspace IDs; there can be no gaps between ranges.
There's usually only one partitioning present at a time, but during
resharding, it's necessary to launch the destination shards alongside
the source shards. When the resharding is complete, the old partitioning
can be removed, which will turn down (undeploy) any unneeded shards. If
only some shards are being split or joined during resharding, the
shards that aren't changing must be specified in both partitionings,
although the common shards will be shared (only deployed once). If
the per-shard configuration differs, the configuration in the latter
partitioning (in the order listed in this field) will be used. For
this reason, it's recommended to add new partitionings at the end,
and only remove partitionings from the beginning. This field is required.
An unsharded keyspace may be specified as a partitioning into 1 part.
items:
properties:
custom:
description: Custom partitioning lets you explicitly specify the
key range of every shard, in case you don't want them to be
divided equally.
properties:
shards:
description: Shards is a list of explicit shard specifications.
+patchMergeKey=keyRange +patchStrategy=merge
items:
properties:
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used to attach
custom annotations to the VitessShard object.
type: object
databaseInitScriptSecret:
description: DatabaseInitScriptSecret specifies the
init_db.sql script file to use for this shard. This
SQL script file is executed immediately after bootstrapping
an empty database to set up initial tables and other
MySQL-level entities needed by Vitess.
properties:
key:
description: Key is the name of the item within
the data source to use as the value. For a Kubernetes
Secret object (specified with the 'name' field),
this is the key within the 'data' map. When 'volumeName'
is used, this specifies the name of the file to
load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret
object to use as the data source. The Secret must
be in the same namespace as the VitessCluster. The
'key' field defines the item to pick from the
Secret object's 'data' map. If a Secret name
is not specified, the data source must be defined
with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name
of a Volume in each Pod that should be mounted.
You must ensure a Volume by that name exists in
all relevant Pods, such as by using the appropriate
ExtraVolumes fields. If specified, this takes
precedence over the 'name' field. The 'key' field
defines the name of the file to load within this
Volume.
type: string
required:
- key
type: object
keyRange:
description: 'KeyRange is the range of keys that this
shard serves. WARNING: DO NOT change the key range
of a shard after deploying. That''s effectively
deleting the old shard and adding a new one, which
can lead to downtime or data loss. Instead, add an
additional partitioning with the desired
set of shards, perform a resharding migration,
and then remove the old partitioning.'
properties:
end:
description: End is a lowercase hexadecimal string
representation of an arbitrary-length sequence
of bytes. If End is the empty string, the key
range is unbounded at the top. If End is not empty,
the bytes of a keyspace ID must compare strictly
less than End in lexicographical order to be in
the range.
pattern: ^([0-9a-f][0-9a-f])*$
type: string
start:
description: Start is a lowercase hexadecimal string
representation of an arbitrary-length sequence
of bytes. If Start is the empty string, the key
range is unbounded at the bottom. If Start is
not empty, the bytes of a keyspace ID must compare
greater than or equal to Start in lexicographical
order to be in the range.
pattern: ^([0-9a-f][0-9a-f])*$
type: string
type: object
replication:
description: Replication configures Vitess replication
settings for the shard.
properties:
enforceSemiSync:
description: 'EnforceSemiSync means Vitess will
configure MySQL to require semi-sync acknowledgement
of all transactions while forbidding fallback
to asynchronous replication under any circumstance. Note
that this is different from merely *enabling*
semi-sync, which in its default configuration
allows fallback to asynchronous replication if
no replicas are connected or if they don''t respond
after a few seconds. Enforced semi-sync is a mode
that prefers master unavailability when durability
cannot be ensured, rather than risking the loss
of data that was already reported to clients as
committed. WARNING: Do not enable this if the
shard has fewer than 3 master-eligible replicas,
as that may lead to master unavailability during
routine maintenance. Default: Semi-sync is not
enforced.'
type: boolean
initializeBackup:
description: 'InitializeBackup specifies whether
to take an initial placeholder backup as part
of preparing tablets to begin replication. This
only takes effect if a backup location is defined
in the VitessCluster. Default: true.'
type: boolean
initializeMaster:
description: 'InitializeMaster specifies whether
to choose an initial master for a new or restored
shard that has no master yet. Default: true.'
type: boolean
type: object
tabletPools:
description: TabletPools specify groups of tablets in
a given cell with a certain tablet type and a shared
configuration template. There must be at most one
pool in this list for each (cell,type) pair. Each
shard must have at least one "replica" pool (in at
least one cell) in order to be able to serve. +patchMergeKey=type
+patchStrategy=merge +listType=map +listMapKey=type
+listMapKey=cell
items:
properties:
affinity:
description: 'Affinity allows you to set rules
that constrain the scheduling of your vttablet
pods. Affinity rules will affect all underlying
tablets in the specified tablet pool the same
way. WARNING: These affinity rules will override
all default affinities that we set; in turn,
we can''t guarantee optimal scheduling of your
pods if you choose to set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used
to attach custom annotations to Pods created
for this component.
type: object
backupLocationName:
description: 'BackupLocationName is the name of
the backup location to use for this tablet pool.
It must match the name of one of the backup
locations defined in the VitessCluster. Default:
Use the backup location whose name is empty.'
type: string
cell:
description: Cell is the name of the Vitess cell
in which to deploy this pool.
minLength: 1
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
dataVolumeClaimTemplate:
description: 'DataVolumeClaimTemplate configures
the PersistentVolumeClaims that will be created
for each tablet to store its database files.
This field is required for local MySQL, but
should be omitted in the case of externally
managed MySQL. IMPORTANT: If your Kubernetes
cluster is multi-zone, you must set a storageClassName
here for a StorageClass that''s configured to
only provision volumes in the same zone as this
tablet pool.'
type: object
externalDatastore:
description: ExternalDatastore provides information
for an externally managed MySQL. You must specify
either Mysqld or ExternalDatastore, but not
both.
properties:
credentialsSecret:
description: 'CredentialsSecret should link
to a JSON credentials file used to connect
to the externally managed MySQL endpoint.
The credentials file is understood and parsed
by Vitess and must be in the format: { "username":
[ "password" ] } Vitess always uses
the first password in the password array.'
properties:
key:
description: Key is the name of the item
within the data source to use as the
value. For a Kubernetes Secret object
(specified with the 'name' field), this
is the key within the 'data' map. When
'volumeName' is used, this specifies
the name of the file to load within
that Volume.
type: string
name:
description: Name is the name of a Kubernetes
Secret object to use as the data source.
The Secret must be in the same namespace
as the VitessCluster. The 'key' field
defines the item to pick from the Secret
object's 'data' map. If a Secret name
is not specified, the data source must
be defined with the 'volumeName' field
instead.
type: string
volumeName:
description: VolumeName directly specifies
the name of a Volume in each Pod that
should be mounted. You must ensure a
Volume by that name exists in all relevant
Pods, such as by using the appropriate
ExtraVolumes fields. If specified, this
takes precedence over the 'name' field. The
'key' field defines the name of the
file to load within this Volume.
type: string
required:
- key
type: object
database:
description: Database is the name of the database.
type: string
host:
description: Host is the endpoint string to
an externally managed MySQL, without any
port.
type: string
port:
description: Port specifies the port for the
externally managed MySQL endpoint.
format: int32
maximum: 65535
minimum: 1
type: integer
serverCACertSecret:
description: ServerCACertSecret should link
to a certificate authority file if one is
required by your externally managed MySQL
endpoint.
properties:
key:
description: Key is the name of the item
within the data source to use as the
value. For a Kubernetes Secret object
(specified with the 'name' field), this
is the key within the 'data' map. When
'volumeName' is used, this specifies
the name of the file to load within
that Volume.
type: string
name:
description: Name is the name of a Kubernetes
Secret object to use as the data source.
The Secret must be in the same namespace
as the VitessCluster. The 'key' field
defines the item to pick from the Secret
object's 'data' map. If a Secret name
is not specified, the data source must
be defined with the 'volumeName' field
instead.
type: string
volumeName:
description: VolumeName directly specifies
the name of a Volume in each Pod that
should be mounted. You must ensure a
Volume by that name exists in all relevant
Pods, such as by using the appropriate
ExtraVolumes fields. If specified, this
takes precedence over the 'name' field. The
'key' field defines the name of the
file to load within this Volume.
type: string
required:
- key
type: object
user:
description: User is a provided database user
from an externally managed MySQL that Vitess
can use to carry out necessary actions. Password
for this user must be supplied in the CredentialsSecret.
type: string
required:
- user
- host
- port
- database
- credentialsSecret
type: object
extraEnv:
description: ExtraEnv can optionally be used to
override default environment variables set by
the operator, or pass additional environment
variables. These values are applied to both
the vttablet and mysqld containers.
items:
type: object
type: array
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally be used
to attach custom labels to Pods created for
this component.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally
be used to override default Pod volumeMounts
defined by the operator, or specify additional
mounts. Typically, these are used to mount volumes
defined through extraVolumes. These values are
applied to both the vttablet and mysqld containers.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally be used
to override default Pod volumes defined by the
operator, or provide additional volumes to the
Pod. Note that when adding a new volume, you
should usually also add a volumeMount to specify
where in each container's filesystem the volume
should be mounted. These volumes are available
to be mounted by both vttablet and mysqld.
items:
type: object
type: array
initContainers:
description: InitContainers can optionally be
used to supply extra init containers that will
be run to completion one after another before
any app containers are started.
items:
type: object
type: array
mysqld:
description: Mysqld configures a local MySQL running
inside each tablet Pod. You must specify either
Mysqld or ExternalDatastore, but not both.
properties:
configOverrides:
description: ConfigOverrides can optionally
be used to provide a my.cnf snippet to override
default my.cnf values (included with Vitess)
for this particular MySQL instance.
type: string
resources:
description: Resources specify the compute
resources to allocate for just the MySQL
process (the underlying local datastore).
This field is required.
type: object
required:
- resources
type: object
replicas:
description: Replicas is the number of tablets
to deploy in this pool. This field is required,
although it may be set to 0, which will scale
the pool down to 0 tablets.
format: int32
minimum: 0
type: integer
sidecarContainers:
description: SidecarContainers can optionally
be used to supply extra containers that run
alongside the main containers.
items:
type: object
type: array
type:
description: Type is the type of tablet contained
in this tablet pool. The allowed types are "replica"
for master-eligible replicas that serve transactional
(OLTP) workloads; and "rdonly" for master-ineligible
replicas (can never be promoted to master) that
serve batch/analytical (OLAP) workloads.
enum:
- replica
- rdonly
- externalmaster
- externalreplica
- externalrdonly
type: string
vttablet:
description: Vttablet configures the vttablet
server within each tablet.
properties:
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally be
used to override default flags set by the
operator, or pass additional flags to vttablet.
All entries must be key-value string pairs
of the form "flag": "value". The flag name
should not have any prefix (just "flag",
not "-flag"). To set a boolean flag, set
the string value to either "true" or "false".'
type: object
resources:
description: Resources specify the compute
resources to allocate for just the vttablet
process (the Vitess query server that sits
in front of MySQL). This field is required.
type: object
required:
- resources
type: object
required:
- cell
- type
- replicas
- vttablet
type: object
type: array
required:
- keyRange
- databaseInitScriptSecret
type: object
type: array
required:
- shards
type: object
equal:
description: Equal partitioning splits the keyspace into some
number of equal parts, assuming that the keyspace IDs are uniformly
distributed, for example because they're generated by a hash
vindex.
properties:
parts:
description: 'Parts is the number of equal parts to split
the keyspace into. If you need shards that are not equal-sized,
use custom partitioning instead. Note that if the number
of parts is not a power of 2, the key ranges will only be
roughly equal in size. WARNING: DO NOT change the number
of parts in a partitioning after deploying. That''s
effectively deleting the old partitioning and adding a new
one, which can lead to downtime or data loss. Instead,
add an additional partitioning with the desired
number of parts, perform a resharding migration,
and then remove the old partitioning.'
format: int32
minimum: 1
type: integer
shardTemplate:
description: ShardTemplate is the configuration used for each
equal-sized shard. If you need shards that don't all share
the same configuration, use custom partitioning instead.
properties:
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used to attach
custom annotations to the VitessShard object.
type: object
databaseInitScriptSecret:
description: DatabaseInitScriptSecret specifies the init_db.sql
script file to use for this shard. This SQL script file
is executed immediately after bootstrapping an empty
database to set up initial tables and other MySQL-level
entities needed by Vitess.
properties:
key:
description: Key is the name of the item within the
data source to use as the value. For a Kubernetes
Secret object (specified with the 'name' field),
this is the key within the 'data' map. When 'volumeName'
is used, this specifies the name of the file to
load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret
object to use as the data source. The Secret must
be in the same namespace as the VitessCluster. The
'key' field defines the item to pick from the Secret
object's 'data' map. If a Secret name is not specified,
the data source must be defined with the 'volumeName'
field instead.
type: string
volumeName:
description: VolumeName directly specifies the name
of a Volume in each Pod that should be mounted.
You must ensure a Volume by that name exists in
all relevant Pods, such as by using the appropriate
ExtraVolumes fields. If specified, this takes precedence
over the 'name' field. The 'key' field defines
the name of the file to load within this Volume.
type: string
required:
- key
type: object
replication:
description: Replication configures Vitess replication
settings for the shard.
properties:
enforceSemiSync:
description: 'EnforceSemiSync means Vitess will configure
MySQL to require semi-sync acknowledgement of all
transactions while forbidding fallback to asynchronous
replication under any circumstance. Note that this
is different from merely *enabling* semi-sync, which
in its default configuration allows fallback to
asynchronous replication if no replicas are connected
or if they don''t respond after a few seconds. Enforced
semi-sync is a mode that prefers master unavailability
when durability cannot be ensured, rather than risking
the loss of data that was already reported to clients
as committed. WARNING: Do not enable this if the
shard has fewer than 3 master-eligible replicas,
as that may lead to master unavailability during
routine maintenance. Default: Semi-sync is not
enforced.'
type: boolean
initializeBackup:
description: 'InitializeBackup specifies whether to
take an initial placeholder backup as part of preparing
tablets to begin replication. This only takes effect
if a backup location is defined in the VitessCluster. Default:
true.'
type: boolean
initializeMaster:
description: 'InitializeMaster specifies whether to
choose an initial master for a new or restored shard
that has no master yet. Default: true.'
type: boolean
type: object
tabletPools:
description: TabletPools specify groups of tablets in
a given cell with a certain tablet type and a shared
configuration template. There must be at most one pool
in this list for each (cell,type) pair. Each shard must
have at least one "replica" pool (in at least one cell)
in order to be able to serve. +patchMergeKey=type +patchStrategy=merge
+listType=map +listMapKey=type +listMapKey=cell
items:
properties:
affinity:
description: 'Affinity allows you to set rules that
constrain the scheduling of your vttablet pods.
Affinity rules will affect all underlying tablets
in the specified tablet pool the same way. WARNING:
These affinity rules will override all default
affinities that we set; in turn, we can''t guarantee
optimal scheduling of your pods if you choose
to set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used
to attach custom annotations to Pods created for
this component.
type: object
backupLocationName:
description: 'BackupLocationName is the name of
the backup location to use for this tablet pool.
It must match the name of one of the backup locations
defined in the VitessCluster. Default: Use the
backup location whose name is empty.'
type: string
cell:
description: Cell is the name of the Vitess cell
in which to deploy this pool.
minLength: 1
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
dataVolumeClaimTemplate:
description: 'DataVolumeClaimTemplate configures
the PersistentVolumeClaims that will be created
for each tablet to store its database files. This
field is required for local MySQL, but should
be omitted in the case of externally managed MySQL. IMPORTANT:
If your Kubernetes cluster is multi-zone, you
must set a storageClassName here for a StorageClass
that''s configured to only provision volumes in
the same zone as this tablet pool.'
type: object
externalDatastore:
description: ExternalDatastore provides information
for an externally managed MySQL. You must specify
either Mysqld or ExternalDatastore, but not both.
properties:
credentialsSecret:
description: 'CredentialsSecret should link
to a JSON credentials file used to connect
to the externally managed MySQL endpoint.
The credentials file is understood and parsed
by Vitess and must be in the format: { "username":
[ "password" ] } Vitess always uses
the first password in the password array.'
properties:
key:
description: Key is the name of the item
within the data source to use as the value. For
a Kubernetes Secret object (specified
with the 'name' field), this is the key
within the 'data' map. When 'volumeName'
is used, this specifies the name of the
file to load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes
Secret object to use as the data source.
The Secret must be in the same namespace
as the VitessCluster. The 'key' field
defines the item to pick from the Secret
object's 'data' map. If a Secret name
is not specified, the data source must
be defined with the 'volumeName' field
instead.
type: string
volumeName:
description: VolumeName directly specifies
the name of a Volume in each Pod that
should be mounted. You must ensure a Volume
by that name exists in all relevant Pods,
such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence
over the 'name' field. The 'key' field
defines the name of the file to load within
this Volume.
type: string
required:
- key
type: object
database:
description: Database is the name of the database.
type: string
host:
description: Host is the endpoint string to
an externally managed MySQL, without any port.
type: string
port:
description: Port specifies the port for the
externally managed MySQL endpoint.
format: int32
maximum: 65535
minimum: 1
type: integer
serverCACertSecret:
description: ServerCACertSecret should link
to a certificate authority file if one is
required by your externally managed MySQL
endpoint.
properties:
key:
description: Key is the name of the item
within the data source to use as the value. For
a Kubernetes Secret object (specified
with the 'name' field), this is the key
within the 'data' map. When 'volumeName'
is used, this specifies the name of the
file to load within that Volume.
type: string
name:
description: Name is the name of a Kubernetes
Secret object to use as the data source.
The Secret must be in the same namespace
as the VitessCluster. The 'key' field
defines the item to pick from the Secret
object's 'data' map. If a Secret name
is not specified, the data source must
be defined with the 'volumeName' field
instead.
type: string
volumeName:
description: VolumeName directly specifies
the name of a Volume in each Pod that
should be mounted. You must ensure a Volume
by that name exists in all relevant Pods,
such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence
over the 'name' field. The 'key' field
defines the name of the file to load within
this Volume.
type: string
required:
- key
type: object
user:
description: User is a provided database user
from an externally managed MySQL that Vitess
can use to carry out necessary actions. Password
for this user must be supplied in the CredentialsSecret.
type: string
required:
- user
- host
- port
- database
- credentialsSecret
type: object
extraEnv:
description: ExtraEnv can optionally be used to
override default environment variables set by
the operator, or pass additional environment variables.
These values are applied to both the vttablet
and mysqld containers.
items:
type: object
type: array
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally be used
to attach custom labels to Pods created for this
component.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally be
used to override default Pod volumeMounts defined
by the operator, or specify additional mounts.
Typically, these are used to mount volumes defined
through extraVolumes. These values are applied
to both the vttablet and mysqld containers.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally be used
to override default Pod volumes defined by the
operator, or provide additional volumes to the
Pod. Note that when adding a new volume, you should
usually also add a volumeMount to specify where
in each container's filesystem the volume should
be mounted. These volumes are available to be
mounted by both vttablet and mysqld.
items:
type: object
type: array
initContainers:
description: InitContainers can optionally be used
to supply extra init containers that will be run
to completion one after another before any app
containers are started.
items:
type: object
type: array
mysqld:
description: Mysqld configures a local MySQL running
inside each tablet Pod. You must specify either
Mysqld or ExternalDatastore, but not both.
properties:
configOverrides:
description: ConfigOverrides can optionally
be used to provide a my.cnf snippet to override
default my.cnf values (included with Vitess)
for this particular MySQL instance.
type: string
resources:
description: Resources specify the compute resources
to allocate for just the MySQL process (the
underlying local datastore). This field is
required.
type: object
required:
- resources
type: object
replicas:
description: Replicas is the number of tablets to
deploy in this pool. This field is required, although
it may be set to 0, which will scale the pool
down to 0 tablets.
format: int32
minimum: 0
type: integer
sidecarContainers:
description: SidecarContainers can optionally be
used to supply extra containers that run alongside
the main containers.
items:
type: object
type: array
type:
description: Type is the type of tablet contained
in this tablet pool. The allowed types are "replica"
for master-eligible replicas that serve transactional
(OLTP) workloads; and "rdonly" for master-ineligible
replicas (can never be promoted to master) that
serve batch/analytical (OLAP) workloads.
enum:
- replica
- rdonly
- externalmaster
- externalreplica
- externalrdonly
type: string
vttablet:
description: Vttablet configures the vttablet server
within each tablet.
properties:
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally be used
to override default flags set by the operator,
or pass additional flags to vttablet. All
entries must be key-value string pairs of
the form "flag": "value". The flag name should
not have any prefix (just "flag", not "-flag").
To set a boolean flag, set the string value
to either "true" or "false".'
type: object
resources:
description: Resources specify the compute resources
to allocate for just the vttablet process
(the Vitess query server that sits in front
of MySQL). This field is required.
type: object
required:
- resources
type: object
required:
- cell
- type
- replicas
- vttablet
type: object
type: array
required:
- databaseInitScriptSecret
type: object
required:
- parts
type: object
type: object
maxItems: 2
minItems: 1
type: array
topologyReconciliation:
description: TopologyReconciliation is inherited from the parent's VitessClusterSpec.
properties:
pruneCells:
description: 'PruneCells can be used to enable or disable pruning
of extraneous cells from topo records. Default: true'
type: boolean
pruneKeyspaces:
description: 'PruneKeyspaces can be used to enable or disable pruning
of extraneous keyspaces from topo records. Default: true'
type: boolean
pruneShardCells:
description: 'PruneShardCells can be used to enable or disable pruning
of extraneous shard cells from topo records. Default: true'
type: boolean
pruneShards:
description: 'PruneShards can be used to enable or disable pruning
of extraneous shards from topo records. Default: true'
type: boolean
pruneSrvKeyspaces:
description: 'PruneSrvKeyspaces can be used to enable or disable
pruning of extraneous serving keyspaces from topo records. Default:
true'
type: boolean
pruneTablets:
description: 'PruneTablets can be used to enable or disable pruning
of extraneous tablets from topo records. Default: true'
type: boolean
registerCells:
description: 'RegisterCells can be used to enable or disable registering
cells into topo records. Default: true'
type: boolean
registerCellsAliases:
description: 'RegisterCellsAliases can be used to enable or disable
registering cells aliases into topo records. Default: true'
type: boolean
type: object
turndownPolicy:
description: 'TurndownPolicy specifies what should happen if this keyspace
is ever removed from the VitessCluster spec. By default, removing
a keyspace entry from the VitessCluster spec will NOT actually turn
down the deployed resources, unless it can be verified that the keyspace
was previously set to have 0 total desired tablets across all shards. With
this default policy (RequireIdle), before removing the keyspace entry
from the spec, you must first edit the keyspace entry to remove all
tablet pools from all shards, and wait for that change to roll out.
If a keyspace entry is removed too soon, the keyspace resources will
remain deployed indefinitely, and the keyspace will be listed in the
orphanedKeyspaces field of VitessCluster status. This is a safety
mechanism to prevent accidental edits to the cluster object from having
immediate, destructive consequences. If the cluster spec is only ever
edited by automation whose edits you trust to be safe, you can set
the policy to Immediate to skip these checks. Default: RequireIdle'
enum:
- RequireIdle
- Immediate
type: string
zoneMap:
additionalProperties:
type: string
description: ZoneMap is a map from Vitess cell name to zone (failure
domain) name for all cells defined in the VitessCluster.
type: object
required:
- name
- partitionings
- globalLockserver
- zoneMap
type: object
status:
properties:
idle:
description: Idle is a condition indicating whether the keyspace can
be turned down. If Idle is True, the keyspace is not deployed in any
cells, so it should be safe to turn down the keyspace.
type: string
observedGeneration:
description: The generation observed by the controller.
format: int64
type: integer
orphanedShards:
additionalProperties:
properties:
message:
description: Message is a human-readable explanation for why the
object is orphaned.
type: string
reason:
description: Reason is a CamelCase token for programmatic reasoning
about why the object is orphaned.
type: string
required:
- reason
- message
type: object
description: OrphanedShards is a list of unwanted shards that could
not be turned down.
type: object
shards:
additionalProperties:
properties:
cells:
description: Cells is a list of cells in which any tablets for
this shard are deployed.
items:
type: string
type: array
desiredTablets:
description: DesiredTablets is the number of desired tablets.
This is computed from information that's already available in
the spec, but clients should use this value instead of trying
to compute shard partitionings on their own.
format: int32
type: integer
hasMaster:
description: HasMaster is a condition indicating whether the Vitess
topology reflects a master for this shard.
type: string
pendingChanges:
description: PendingChanges describes changes to the shard that
will be applied the next time a rolling update allows.
type: string
readyTablets:
description: ReadyTablets is the number of desired tablets that
are Ready.
format: int32
type: integer
tablets:
description: Tablets is the number of observed tablets. This could
be higher or lower than desiredTablets if the state has not
yet converged.
format: int32
type: integer
updatedTablets:
description: UpdatedTablets is the number of desired tablets that
are up-to-date (have no pending changes).
format: int32
type: integer
type: object
description: Shards is a summary of the status of all desired shards.
type: object
type: object
version: v2
versions:
- name: v2
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: vitessshards.planetscale.com
spec:
group: planetscale.com
names:
kind: VitessShard
listKind: VitessShardList
plural: vitessshards
shortNames:
- vts
singular: vitessshard
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used to attach custom annotations
to the VitessShard object.
type: object
backupEngine:
description: BackupEngine specifies the Vitess backup engine to use,
either "builtin" or "xtrabackup".
type: string
backupLocations:
description: BackupLocations are the backup locations defined in the
VitessCluster.
items:
properties:
azblob:
description: Azblob specifies a backup location in Azure Blob
Storage.
properties:
account:
description: Account is the name of the Azure storage account
to use.
minLength: 1
type: string
authSecret:
description: AuthSecret is a reference to the Secret to use
for Azure authentication.
properties:
key:
description: Key is the name of the item within the data
source to use as the value. For a Kubernetes Secret
object (specified with the 'name' field), this is the
key within the 'data' map. When 'volumeName' is used,
this specifies the name of the file to load within that
Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object
to use as the data source. The Secret must be in the
same namespace as the VitessCluster. The 'key' field
defines the item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the data source
must be defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of
a Volume in each Pod that should be mounted. You must
ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of the
file to load within this Volume.
type: string
required:
- key
type: object
container:
description: Container is the name of the Azure storage account
container to use.
minLength: 1
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to all
object keys created by Vitess. This is only needed if the
same container is also used for something other than backups
for VitessClusters. Backups from different clusters, keyspaces,
or shards will automatically avoid colliding with each other
within a container, regardless of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
required:
- account
- container
- authSecret
type: object
gcs:
description: GCS specifies a backup location in Google Cloud Storage.
properties:
authSecret:
description: 'AuthSecret is a reference to the Secret to use
for GCS authentication. If set, this must point to a file
in the format expected for the GOOGLE_APPLICATION_CREDENTIALS
environment variable. Default: Use the default credentials
of the Node.'
properties:
key:
description: Key is the name of the item within the data
source to use as the value. For a Kubernetes Secret
object (specified with the 'name' field), this is the
key within the 'data' map. When 'volumeName' is used,
this specifies the name of the file to load within that
Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object
to use as the data source. The Secret must be in the
same namespace as the VitessCluster. The 'key' field
defines the item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the data source
must be defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of
a Volume in each Pod that should be mounted. You must
ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of the
file to load within this Volume.
type: string
required:
- key
type: object
bucket:
description: Bucket is the name of the GCS bucket to use.
minLength: 1
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to all
object keys created by Vitess. This is only needed if the
same bucket is also used for something other than backups
for VitessClusters. Backups from different clusters, keyspaces,
or shards will automatically avoid colliding with each other
within a bucket, regardless of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
required:
- bucket
type: object
name:
description: Name is used to refer to this backup location from
other parts of a VitessCluster object, such as in tablet pool
definitions. This name must be unique among all backup locations
defined in a given cluster. A backup location with an empty
name defines the default location used when a tablet pool does
not specify a backup location name.
maxLength: 25
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
s3:
description: S3 specifies a backup location in Amazon S3.
properties:
authSecret:
description: 'AuthSecret is a reference to the Secret to use
for S3 authentication. If set, this must point to a file
in the format expected for the `~/.aws/credentials` file.
Default: Use the default credentials of the Node.'
properties:
key:
description: Key is the name of the item within the data
source to use as the value. For a Kubernetes Secret
object (specified with the 'name' field), this is the
key within the 'data' map. When 'volumeName' is used,
this specifies the name of the file to load within that
Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object
to use as the data source. The Secret must be in the
same namespace as the VitessCluster. The 'key' field
defines the item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the data source
must be defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of
a Volume in each Pod that should be mounted. You must
ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of the
file to load within this Volume.
type: string
required:
- key
type: object
bucket:
description: Bucket is the name of the S3 bucket to use.
minLength: 1
type: string
endpoint:
description: 'Endpoint is the `host:port` (port is required)
for the S3 backend. Default: Use the endpoint associated
with `region` by the driver.'
type: string
keyPrefix:
description: KeyPrefix is an optional prefix added to all
object keys created by Vitess. This is only needed if the
same bucket is also used for something other than backups
for VitessClusters. Backups from different clusters, keyspaces,
or shards will automatically avoid colliding with each other
within a bucket, regardless of this setting.
maxLength: 256
pattern: ^[^\r\n]*$
type: string
region:
description: Region is the AWS region in which the bucket
is located.
minLength: 1
type: string
required:
- region
- bucket
type: object
volume:
description: Volume specifies a backup location as a Kubernetes
Volume Source to mount. This can be used, for example, to store
backups on an NFS mount, or on a shared host path for local
testing.
type: object
type: object
type: array
databaseInitScriptSecret:
description: DatabaseInitScriptSecret specifies the init_db.sql script
file to use for this shard. This SQL script file is executed immediately
after bootstrapping an empty database to set up initial tables and
other MySQL-level entities needed by Vitess.
properties:
key:
description: Key is the name of the item within the data source
to use as the value. For a Kubernetes Secret object (specified
with the 'name' field), this is the key within the 'data' map. When
'volumeName' is used, this specifies the name of the file to load
within that Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object to use
as the data source. The Secret must be in the same namespace as
the VitessCluster. The 'key' field defines the item to pick from
the Secret object's 'data' map. If a Secret name is not specified,
the data source must be defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of a Volume
in each Pod that should be mounted. You must ensure a Volume by
that name exists in all relevant Pods, such as by using the appropriate
ExtraVolumes fields. If specified, this takes precedence over
the 'name' field. The 'key' field defines the name of the file
to load within this Volume.
type: string
required:
- key
type: object
extraVitessFlags:
additionalProperties:
type: string
description: ExtraVitessFlags is inherited from the parent's VitessClusterSpec.
type: object
globalLockserver:
description: GlobalLockserver are the params to connect to the global
lockserver.
properties:
address:
description: Address is the host:port of the lockserver client endpoint.
type: string
implementation:
description: Implementation specifies which Vitess "topo" plugin
to use.
type: string
rootPath:
description: RootPath is a path prefix for all lockserver data belonging
to a given Vitess cluster. Multiple Vitess clusters can share
a lockserver as long as they have unique root paths.
type: string
required:
- implementation
- address
- rootPath
type: object
imagePullPolicies:
description: ImagePullPolicies are inherited from the VitessCluster
spec.
properties:
mysqld:
description: Mysqld is the container image pull policy to use for
mysqld.
type: string
mysqldExporter:
description: MysqldExporter is the container image pull policy to
use for mysqld-exporter.
type: string
vtbackup:
description: Vtbackup is the container image pull policy to use
for Vitess Backup jobs.
type: string
vtctld:
description: Vtctld is the container image pull policy to use for
Vitess Dashboard instances.
type: string
vtgate:
description: Vtgate is the container image pull policy to use for
Vitess Gateway instances.
type: string
vttablet:
description: Vttablet is the container image pull policy to use
for Vitess Tablet instances.
type: string
type: object
images:
description: Images are not customizable by users at the shard level
because version skew across the shard is discouraged except during
rolling updates, in which case this field is automatically managed
by the VitessKeyspace controller that owns this VitessShard.
properties:
mysqld:
description: Mysqld specifies the container image to use for mysqld,
as well as declaring which MySQL flavor setting in Vitess the
image is compatible with. Only one flavor image may be provided
at a time. mysqld running alongside each tablet.
properties:
mariadb103Compatible:
description: Mariadb103Compatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MariaDB103" flavor setting.
type: string
mariadbCompatible:
description: MariadbCompatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MariaDB" flavor setting.
type: string
mysql56Compatible:
description: Mysql56Compatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MySQL56" flavor setting.
type: string
mysql80Compatible:
description: Mysql80Compatible is a container image (including
version tag) for mysqld that's compatible with the Vitess
"MySQL80" flavor setting.
type: string
type: object
mysqldExporter:
description: MysqldExporter specifies the container image for mysqld-exporter.
type: string
vtbackup:
description: Vtbackup is the container image (including version
tag) to use for Vitess Backup jobs.
type: string
vttablet:
description: Vttablet is the container image (including version
tag) to use for Vitess Tablet instances.
type: string
type: object
keyRange:
description: KeyRange is the range of keyspace IDs served by this shard.
properties:
end:
description: End is a lowercase hexadecimal string representation
of an arbitrary-length sequence of bytes. If End is the empty
string, the key range is unbounded at the top. If End is not empty,
the bytes of a keyspace ID must compare strictly less than End
in lexicographical order to be in the range.
pattern: ^([0-9a-f][0-9a-f])*$
type: string
start:
description: Start is a lowercase hexadecimal string representation
of an arbitrary-length sequence of bytes. If Start is the empty
string, the key range is unbounded at the bottom. If Start is
not empty, the bytes of a keyspace ID must compare greater than
or equal to Start in lexicographical order to be in the range.
pattern: ^([0-9a-f][0-9a-f])*$
type: string
type: object
name:
description: Name is the shard name as its known to Vitess.
type: string
replication:
description: Replication configures Vitess replication settings for
the shard.
properties:
enforceSemiSync:
description: 'EnforceSemiSync means Vitess will configure MySQL
to require semi-sync acknowledgement of all transactions while
forbidding fallback to asynchronous replication under any circumstance. Note
that this is different from merely *enabling* semi-sync, which
in its default configuration allows fallback to asynchronous replication
if no replicas are connected or if they don''t respond after a
few seconds. Enforced semi-sync is a mode that prefers master
unavailability when durability cannot be ensured, rather than
risking the loss of data that was already reported to clients
as committed. WARNING: Do not enable this if the shard has fewer
than 3 master-eligible replicas, as that may lead to master unavailability
during routine maintenance. Default: Semi-sync is not enforced.'
type: boolean
initializeBackup:
description: 'InitializeBackup specifies whether to take an initial
placeholder backup as part of preparing tablets to begin replication.
This only takes effect if a backup location is defined in the
VitessCluster. Default: true.'
type: boolean
initializeMaster:
description: 'InitializeMaster specifies whether to choose an initial
master for a new or restored shard that has no master yet. Default:
true.'
type: boolean
type: object
tabletPools:
description: TabletPools specify groups of tablets in a given cell with
a certain tablet type and a shared configuration template. There
must be at most one pool in this list for each (cell,type) pair. Each
shard must have at least one "replica" pool (in at least one cell)
in order to be able to serve. +patchMergeKey=type +patchStrategy=merge
+listType=map +listMapKey=type +listMapKey=cell
items:
properties:
affinity:
description: 'Affinity allows you to set rules that constrain
the scheduling of your vttablet pods. Affinity rules will affect
all underlying tablets in the specified tablet pool the same
way. WARNING: These affinity rules will override all default
affinities that we set; in turn, we can''t guarantee optimal
scheduling of your pods if you choose to set this field.'
type: object
annotations:
additionalProperties:
type: string
description: Annotations can optionally be used to attach custom
annotations to Pods created for this component.
type: object
backupLocationName:
description: 'BackupLocationName is the name of the backup location
to use for this tablet pool. It must match the name of one of
the backup locations defined in the VitessCluster. Default:
Use the backup location whose name is empty.'
type: string
cell:
description: Cell is the name of the Vitess cell in which to deploy
this pool.
minLength: 1
pattern: ^[a-z0-9]([a-z0-9]*[a-z0-9])?$
type: string
dataVolumeClaimTemplate:
description: 'DataVolumeClaimTemplate configures the PersistentVolumeClaims
that will be created for each tablet to store its database files.
This field is required for local MySQL, but should be omitted
in the case of externally managed MySQL. IMPORTANT: If your
Kubernetes cluster is multi-zone, you must set a storageClassName
here for a StorageClass that''s configured to only provision
volumes in the same zone as this tablet pool.'
type: object
externalDatastore:
description: ExternalDatastore provides information for an externally
managed MySQL. You must specify either Mysqld or ExternalDatastore,
but not both.
properties:
credentialsSecret:
description: 'CredentialsSecret should link to a JSON credentials
file used to connect to the externally managed MySQL endpoint.
The credentials file is understood and parsed by Vitess
and must be in the format: { "username": [ "password" ]
} Vitess always uses the first password in the password
array.'
properties:
key:
description: Key is the name of the item within the data
source to use as the value. For a Kubernetes Secret
object (specified with the 'name' field), this is the
key within the 'data' map. When 'volumeName' is used,
this specifies the name of the file to load within that
Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object
to use as the data source. The Secret must be in the
same namespace as the VitessCluster. The 'key' field
defines the item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the data source
must be defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of
a Volume in each Pod that should be mounted. You must
ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of the
file to load within this Volume.
type: string
required:
- key
type: object
database:
description: Database is the name of the database.
type: string
host:
description: Host is the endpoint string to an externally
managed MySQL, without any port.
type: string
port:
description: Port specifies the port for the externally managed
MySQL endpoint.
format: int32
maximum: 65535
minimum: 1
type: integer
serverCACertSecret:
description: ServerCACertSecret should link to a certificate
authority file if one is required by your externally managed
MySQL endpoint.
properties:
key:
description: Key is the name of the item within the data
source to use as the value. For a Kubernetes Secret
object (specified with the 'name' field), this is the
key within the 'data' map. When 'volumeName' is used,
this specifies the name of the file to load within that
Volume.
type: string
name:
description: Name is the name of a Kubernetes Secret object
to use as the data source. The Secret must be in the
same namespace as the VitessCluster. The 'key' field
defines the item to pick from the Secret object's 'data'
map. If a Secret name is not specified, the data source
must be defined with the 'volumeName' field instead.
type: string
volumeName:
description: VolumeName directly specifies the name of
a Volume in each Pod that should be mounted. You must
ensure a Volume by that name exists in all relevant
Pods, such as by using the appropriate ExtraVolumes
fields. If specified, this takes precedence over the
'name' field. The 'key' field defines the name of the
file to load within this Volume.
type: string
required:
- key
type: object
user:
description: User is a provided database user from an externally
managed MySQL that Vitess can use to carry out necessary
actions. Password for this user must be supplied in the
CredentialsSecret.
type: string
required:
- user
- host
- port
- database
- credentialsSecret
type: object
extraEnv:
description: ExtraEnv can optionally be used to override default
environment variables set by the operator, or pass additional
environment variables. These values are applied to both the
vttablet and mysqld containers.
items:
type: object
type: array
extraLabels:
additionalProperties:
type: string
description: ExtraLabels can optionally be used to attach custom
labels to Pods created for this component.
type: object
extraVolumeMounts:
description: ExtraVolumeMounts can optionally be used to override
default Pod volumeMounts defined by the operator, or specify
additional mounts. Typically, these are used to mount volumes
defined through extraVolumes. These values are applied to both
the vttablet and mysqld containers.
items:
type: object
type: array
extraVolumes:
description: ExtraVolumes can optionally be used to override default
Pod volumes defined by the operator, or provide additional volumes
to the Pod. Note that when adding a new volume, you should usually
also add a volumeMount to specify where in each container's
filesystem the volume should be mounted. These volumes are available
to be mounted by both vttablet and mysqld.
items:
type: object
type: array
initContainers:
description: InitContainers can optionally be used to supply extra
init containers that will be run to completion one after another
before any app containers are started.
items:
type: object
type: array
mysqld:
description: Mysqld configures a local MySQL running inside each
tablet Pod. You must specify either Mysqld or ExternalDatastore,
but not both.
properties:
configOverrides:
description: ConfigOverrides can optionally be used to provide
a my.cnf snippet to override default my.cnf values (included
with Vitess) for this particular MySQL instance.
type: string
resources:
description: Resources specify the compute resources to allocate
for just the MySQL process (the underlying local datastore).
This field is required.
type: object
required:
- resources
type: object
replicas:
description: Replicas is the number of tablets to deploy in this
pool. This field is required, although it may be set to 0, which
will scale the pool down to 0 tablets.
format: int32
minimum: 0
type: integer
sidecarContainers:
description: SidecarContainers can optionally be used to supply
extra containers that run alongside the main containers.
items:
type: object
type: array
type:
description: Type is the type of tablet contained in this tablet
pool. The allowed types are "replica" for master-eligible replicas
that serve transactional (OLTP) workloads; and "rdonly" for
master-ineligible replicas (can never be promoted to master)
that serve batch/analytical (OLAP) workloads.
enum:
- replica
- rdonly
- externalmaster
- externalreplica
- externalrdonly
type: string
vttablet:
description: Vttablet configures the vttablet server within each
tablet.
properties:
extraFlags:
additionalProperties:
type: string
description: 'ExtraFlags can optionally be used to override
default flags set by the operator, or pass additional flags
to vttablet. All entries must be key-value string pairs
of the form "flag": "value". The flag name should not have
any prefix (just "flag", not "-flag"). To set a boolean
flag, set the string value to either "true" or "false".'
type: object
resources:
description: Resources specify the compute resources to allocate
for just the vttablet process (the Vitess query server that
sits in front of MySQL). This field is required.
type: object
required:
- resources
type: object
required:
- cell
- type
- replicas
- vttablet
type: object
type: array
topologyReconciliation:
description: TopologyReconciliation is inherited from the parent's VitessClusterSpec.
properties:
pruneCells:
description: 'PruneCells can be used to enable or disable pruning
of extraneous cells from topo records. Default: true'
type: boolean
pruneKeyspaces:
description: 'PruneKeyspaces can be used to enable or disable pruning
of extraneous keyspaces from topo records. Default: true'
type: boolean
pruneShardCells:
description: 'PruneShardCells can be used to enable or disable pruning
of extraneous shard cells from topo records. Default: true'
type: boolean
pruneShards:
description: 'PruneShards can be used to enable or disable pruning
of extraneous shards from topo records. Default: true'
type: boolean
pruneSrvKeyspaces:
description: 'PruneSrvKeyspaces can be used to enable or disable
pruning of extraneous serving keyspaces from topo records. Default:
true'
type: boolean
pruneTablets:
description: 'PruneTablets can be used to enable or disable pruning
of extraneous tablets from topo records. Default: true'
type: boolean
registerCells:
description: 'RegisterCells can be used to enable or disable registering
cells into topo records. Default: true'
type: boolean
registerCellsAliases:
description: 'RegisterCellsAliases can be used to enable or disable
registering cells aliases into topo records. Default: true'
type: boolean
type: object
zoneMap:
additionalProperties:
type: string
description: ZoneMap is a map from Vitess cell name to zone (failure
domain) name for all cells defined in the VitessCluster.
type: object
required:
- databaseInitScriptSecret
- name
- zoneMap
- images
- keyRange
- globalLockserver
type: object
status:
properties:
backupLocations:
description: BackupLocations reports information about the backups for
this shard in each backup location.
items:
properties:
completeBackups:
description: CompleteBackups is the number of complete backups
observed.
format: int32
type: integer
incompleteBackups:
description: IncompleteBackups is the number of incomplete backups
observed.
format: int32
type: integer
latestCompleteBackupTime:
description: LatestCompleteBackupTime is the timestamp of the
most recent complete backup.
format: date-time
type: string
name:
description: Name is the backup location name.
type: string
required:
- completeBackups
- incompleteBackups
type: object
type: array
cells:
description: Cells is a list of cells in which any tablets for this
shard are deployed.
items:
type: string
type: array
conditions:
additionalProperties:
properties:
lastTransitionTime:
description: Last time the condition transitioned from one status
to another. Optional.
format: date-time
type: string
message:
description: Human-readable message indicating details about last
transition. Optional.
type: string
reason:
description: Unique, one-word, PascalCase reason for the condition's
last transition. Optional.
type: string
status:
description: Status is the status of the condition. Can be True,
False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
required:
- status
type: object
description: Conditions is a map of all VitessShard specific conditions
we want to set and monitor. It's ok for multiple controllers to add
conditions here, and those conditions will be preserved.
type: object
hasInitialBackup:
description: HasInitialBackup is a condition indicating whether the
initial backup has been seeded for the shard.
type: string
hasMaster:
description: HasMaster is a condition indicating whether the Vitess
topology reflects a master for this shard.
type: string
idle:
description: Idle is a condition indicating whether the shard can be
turned down. If Idle is True, the shard is not part of the active
shard set (partitioning) for any tablet type in any cell, so it should
be safe to turn down the shard.
type: string
masterAlias:
description: MasterAlias is the tablet alias of the master according
to the global shard record. This could be empty either because there
is no master, or because the shard record could not be read. Check
the HasMaster condition whenever the distinction is important.
type: string
observedGeneration:
description: The generation observed by the controller.
format: int64
type: integer
orphanedTablets:
additionalProperties:
properties:
message:
description: Message is a human-readable explanation for why the
object is orphaned.
type: string
reason:
description: Reason is a CamelCase token for programmatic reasoning
about why the object is orphaned.
type: string
required:
- reason
- message
type: object
description: OrphanedTablets is a list of unwanted tablets that could
not be turned down.
type: object
tablets:
additionalProperties:
properties:
available:
description: Available indicates whether the vttablet Pod has
been consistently Ready for long enough to be considered stable.
type: string
dataVolumeBound:
description: DataVolumeBound indicates whether the main PersistentVolumeClaim
has been matched up with a PersistentVolume and bound to it.
type: string
index:
description: Index is the tablet's index within its tablet pool.
format: int32
type: integer
pendingChanges:
description: PendingChanges describes changes to the tablet Pod
that will be applied the next time a rolling update allows.
type: string
poolType:
description: PoolType is the target tablet type for the tablet
pool.
type: string
ready:
description: Ready indicates whether the vttablet Pod is passing
health checks, meaning it's ready to serve queries.
type: string
running:
description: Running indicates whether the vttablet Pod is running.
type: string
type:
description: Type is the observed tablet type as reflected in
topology.
type: string
type: object
description: Tablets is a summary of the status of all desired tablets
in the shard.
type: object
type: object
version: v2
versions:
- name: v2
served: true
storage: true
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: vitess-operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: vitess-operator
rules:
- apiGroups:
- ""
resources:
- pods
- services
- endpoints
- persistentvolumeclaims
- events
- configmaps
- secrets
verbs:
- '*'
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- apiGroups:
- apps
resources:
- deployments
- daemonsets
- replicasets
- statefulsets
verbs:
- '*'
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- '*'
- apiGroups:
- apps
resourceNames:
- vitess-operator
resources:
- deployments/finalizers
verbs:
- update
- apiGroups:
- planetscale.com
resources:
- vitessclusters
- vitessclusters/status
- vitessclusters/finalizers
- vitesscells
- vitesscells/status
- vitesscells/finalizers
- vitesskeyspaces
- vitesskeyspaces/status
- vitesskeyspaces/finalizers
- vitessshards
- vitessshards/status
- vitessshards/finalizers
- etcdlockservers
- etcdlockservers/status
- etcdlockservers/finalizers
- vitessbackups
- vitessbackups/status
- vitessbackups/finalizers
- vitessbackupstorages
- vitessbackupstorages/status
- vitessbackupstorages/finalizers
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: vitess-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: vitess-operator
subjects:
- kind: ServiceAccount
name: vitess-operator
---
apiVersion: scheduling.k8s.io/v1beta1
description: Vitess components (vttablet, vtgate, vtctld, etcd)
globalDefault: false
kind: PriorityClass
metadata:
name: vitess
value: 1000
---
apiVersion: scheduling.k8s.io/v1beta1
description: The vitess-operator control plane.
globalDefault: false
kind: PriorityClass
metadata:
name: vitess-operator-control-plane
value: 5000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: vitess-operator
spec:
replicas: 1
selector:
matchLabels:
app: vitess-operator
template:
metadata:
labels:
app: vitess-operator
spec:
containers:
- args:
- --logtostderr
- -v=4
command:
- vitess-operator
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: PS_OPERATOR_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: PS_OPERATOR_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: vitess-operator
image: planetscale/vitess-operator:v2.0.0
imagePullPolicy: IfNotPresent
name: vitess-operator
resources:
limits:
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
priorityClassName: vitess-operator-control-plane
serviceAccountName: vitess-operator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment