Comments (1)
docs/api/index.html
demo.yaml
# The following example is minimalist. The security policies
# and resource specifications are not meant to be used in production.
# Please refer to the operator documentation for recommendations on
# production settings.
apiVersion: planetscale.com/v2
kind: VitessCluster
metadata:
name: my_cluster
namespace: vitess
spec:
images:
vtctld: vitess/lite:latest
vtgate: vitess/lite:latest
vttablet: vitess/lite:latest
vtbackup: vitess/lite:latest
mysqld:
mysql56Compatible: vitess/lite:latest
mysqldExporter: prom/mysqld-exporter:v0.11.0
globalLockserver:
etcd:
tolerations:
- key: "my_cluster.cn/database"
operator: "Equal"
value: "true"
effect: "NoSchedule"
- key: "my_cluster.cn/storage"
operator: "Equal"
value: "true"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/vitess
operator: In
values:
- vitess
cells:
- name: my_cell
gateway:
tolerations:
- key: "my_cluster.cn/database"
operator: "Equal"
value: "true"
effect: "NoSchedule"
- key: "my_cluster.cn/storage"
operator: "Equal"
value: "true"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/vitess
operator: In
values:
- vitess
authentication:
static:
secret:
name: my_cluster-cluster-config
key: users.json
replicas: 2
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
memory: 1024Mi
vitessDashboard:
cells:
- my_cell
extraFlags:
security_policy: read-only
replicas: 1
tolerations:
- key: "my_cluster.cn/database"
operator: "Equal"
value: "true"
effect: "NoSchedule"
- key: "my_cluster.cn/storage"
operator: "Equal"
value: "true"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/vitess
operator: In
values:
- vitess
resources:
limits:
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
keyspaces:
- name: my_db
turndownPolicy: Immediate
backupEngine: xtrabackup
backupLocations:
- name: db-backup
volume:
server: 10.0.0.4
path: /data/vitess_backup_online/db
partitionings:
- equal:
parts: 1
shardTemplate:
databaseInitScriptSecret:
name: my_cluster-cluster-config
key: init_db.sql
replication:
enforceSemiSync: false
tabletPools:
- cell: my_cell
type: replica
replicas: 2
tolerations:
- key: "my_cluster.cn/database"
operator: "Equal"
value: "true"
effect: "NoSchedule"
- key: "my_cluster.cn/storage"
operator: "Equal"
value: "true"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/vitess
operator: In
values:
- vitess
vttablet:
extraFlags:
db_charset: utf8mb4
resources:
requests:
cpu: 100m
memory: 256Mi
mysqld:
configOverrides: |-
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
resources:
requests:
cpu: 100m
memory: 256Mi
dataVolumeClaimTemplate:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 100Gi
- cell: my_cell
type: rdonly
replicas: 1
tolerations:
- key: "my_cluster.cn/database"
operator: "Equal"
value: "true"
effect: "NoSchedule"
- key: "my_cluster.cn/storage"
operator: "Equal"
value: "true"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/vitess
operator: In
values:
- vitess
vttablet:
extraFlags:
db_charset: utf8mb4
resources:
requests:
cpu: 100m
memory: 256Mi
mysqld:
configOverrides: |-
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
resources:
requests:
cpu: 100m
memory: 256Mi
dataVolumeClaimTemplate:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 100Gi
updateStrategy:
type: Immediate
---
apiVersion: v1
kind: Secret
metadata:
name: my_cluster-cluster-config
namespace: vitess
type: Opaque
stringData:
users.json: |
{
"user": [{
"UserData": "user",
"Password": ""
}]
}
init_db.sql: |
# This file is executed immediately after mysql_install_db,
# to initialize a fresh data directory.
###############################################################################
# Equivalent of mysql_secure_installation
###############################################################################
# Changes during the init db should not make it to the binlog.
# They could potentially create errant transactions on replicas.
SET sql_log_bin = 0;
# Remove anonymous users.
DELETE FROM mysql.user WHERE User = '';
# Disable remote root access (only allow UNIX socket).
DELETE FROM mysql.user WHERE User = 'root' AND Host != 'localhost';
# Remove test database.
DROP DATABASE IF EXISTS test;
###############################################################################
# Vitess defaults
###############################################################################
# Vitess-internal database.
CREATE DATABASE IF NOT EXISTS _vt;
# Note that definitions of local_metadata and shard_metadata should be the same
# as in production which is defined in go/vt/mysqlctl/metadata_tables.go.
CREATE TABLE IF NOT EXISTS _vt.local_metadata (
name VARCHAR(255) NOT NULL,
value VARCHAR(255) NOT NULL,
db_name VARBINARY(255) NOT NULL,
PRIMARY KEY (db_name, name)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS _vt.shard_metadata (
name VARCHAR(255) NOT NULL,
value MEDIUMBLOB NOT NULL,
db_name VARBINARY(255) NOT NULL,
PRIMARY KEY (db_name, name)
) ENGINE=InnoDB;
# Admin user with all privileges.
CREATE USER 'vt_dba'@'localhost';
GRANT ALL ON *.* TO 'vt_dba'@'localhost';
GRANT GRANT OPTION ON *.* TO 'vt_dba'@'localhost';
# User for app traffic, with global read-write access.
CREATE USER 'vt_app'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, FILE,
REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES,
LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW,
SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER
ON *.* TO 'vt_app'@'localhost';
# User for app debug traffic, with global read access.
CREATE USER 'vt_appdebug'@'localhost';
GRANT SELECT, SHOW DATABASES, PROCESS ON *.* TO 'vt_appdebug'@'localhost';
# User for administrative operations that need to be executed as non-SUPER.
# Same permissions as vt_app here.
CREATE USER 'vt_allprivs'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, FILE,
REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES,
LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW,
SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER
ON *.* TO 'vt_allprivs'@'localhost';
# User for slave replication connections.
# TODO: Should we set a password on this since it allows remote connections?
CREATE USER 'vt_repl'@'%';
GRANT REPLICATION SLAVE ON *.* TO 'vt_repl'@'%';
# User for Vitess filtered replication (binlog player).
# Same permissions as vt_app.
CREATE USER 'vt_filtered'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, FILE,
REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES,
LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW,
SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER
ON *.* TO 'vt_filtered'@'localhost';
# User for Orchestrator (https://github.com/openark/orchestrator).
# TODO: Reenable when the password is randomly generated.
#CREATE USER 'orc_client_user'@'%' IDENTIFIED BY 'orc_client_user_password';
#GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD
# ON *.* TO 'orc_client_user'@'%';
#GRANT SELECT
# ON _vt.* TO 'orc_client_user'@'%';
FLUSH PRIVILEGES;
RESET SLAVE ALL;
RESET MASTER;
from vitess-operator.
Related Issues (20)
- AWS IAM Role for Service Account support HOT 2
- Vtadmin volume mount not effected
- Ready for production in 2023? HOT 11
- vitess operator doesn't accept integer values for vttablet extraFlags
- [Feature request] Allow for `Service` name overrides HOT 1
- support kubernetes v1.25 for recommended stable vitess versions HOT 6
- Vitess Operator spawns a VTOrc even for shards that have only external tablets HOT 1
- Feature Request: Allow more than one VitessShardTabletPool with a certain tablet type in a given cell
- Unable to install vitess on kubernetes behind proxy HOT 1
- Feature request: support controlled mysqld version upgrade with rollback HOT 1
- Feature Request: configure operator to communicate with Vitess components using TLS
- [Feature Request] Allow enabling additional mysqld_exporter collectors
- vtctldclient backup not working with defined VitessBackupStorages in cluster HOT 4
- `vtop-rollout` tooling for safer rollout of new Vitess versions in Kubernetes
- Add custom annotations to PVC
- [Feature] Allow setting pod sysctls
- LabelPrefix["planetscale.com"] whose '.' can't apply on Prometheus 's kubernetes_sd_config section HOT 1
- Pass `--mysql_clientcert_auth_method` flag to Vitess HOT 1
- Supported Kubernetes Versions going EOL HOT 1
- Operator misbehaving when a imagePullSecrets is defined on the default service account of the namespace HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vitess-operator.