From 78e2f8f5a4c8a54785686af0d887347ff2cd6f4d Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Thu, 22 Aug 2024 11:19:20 +0600 Subject: [PATCH] Update Concepts Docs (#664) Signed-off-by: Neaj Morshad --- .../concepts/elasticsearch/index.md | 127 ++++++++++++------ docs/guides/kafka/concepts/kafka.md | 92 ++++++++----- docs/guides/mariadb/concepts/mariadb/index.md | 41 ++++-- docs/guides/memcached/concepts/memcached.md | 40 +++++- docs/guides/mongodb/concepts/mongodb.md | 46 +++++-- docs/guides/mysql/concepts/database/index.md | 48 +++++-- .../concepts/perconaxtradb/index.md | 44 ++++-- docs/guides/pgbouncer/concepts/pgbouncer.md | 43 ++++-- docs/guides/postgres/concepts/postgres.md | 53 ++++++-- .../proxysql/concepts/proxysql/index.md | 47 +++++-- docs/guides/redis/concepts/redis.md | 50 ++++--- docs/guides/redis/concepts/redissentinel.md | 49 +++++-- 12 files changed, 489 insertions(+), 191 deletions(-) diff --git a/docs/guides/elasticsearch/concepts/elasticsearch/index.md b/docs/guides/elasticsearch/concepts/elasticsearch/index.md index 9aa36fcac..0b6427f26 100644 --- a/docs/guides/elasticsearch/concepts/elasticsearch/index.md +++ b/docs/guides/elasticsearch/concepts/elasticsearch/index.md @@ -333,13 +333,16 @@ Currently supported node types are - data: maxUnavailable: 1 replicas: 3 - resources: - limits: - cpu: 500m - memory: 1Gi - requests: - cpu: 500m - memory: 1Gi + podTemplate: + spec: + containers: + - name: "elasticsearch" + resources: + requests: + cpu: "500m" + limits: + cpu: "600m" + memory: "1.5Gi" storage: accessModes: - ReadWriteOnce @@ -351,13 +354,16 @@ Currently supported node types are - ingest: maxUnavailable: 1 replicas: 3 - resources: - limits: - cpu: 500m - memory: 1Gi - requests: - cpu: 500m - memory: 1Gi + podTemplate: + spec: + containers: + - name: "elasticsearch" + resources: + requests: + cpu: "500m" + limits: + cpu: "600m" + memory: "1.5Gi" storage: accessModes: - ReadWriteOnce @@ -369,13 +375,17 @@ Currently supported node types are - master: maxUnavailable: 1 replicas: 2 - resources: - limits: - cpu: 500m - memory: 1Gi - requests: - cpu: 500m - memory: 1Gi + podTemplate: + spec: + containers: + - name: "elasticsearch" + resources: + limits: + cpu: 500m + memory: 1Gi + requests: + cpu: 500m + memory: 1Gi storage: accessModes: - ReadWriteOnce @@ -718,9 +728,9 @@ KubeDB accept following fields to set in `spec.podTemplate:` - annotations (petset's annotation) - labels (petset's labels) - spec: - - args - - env - - resources + - containers + - volumes + - podPlacementPolicy - initContainers - imagePullSecrets - nodeSelector @@ -735,24 +745,24 @@ KubeDB accept following fields to set in `spec.podTemplate:` - readinessProbe - lifecycle -You can checkout the full list [here](https://github.com/kmodules/offshoot-api/blob/ea366935d5bad69d7643906c7556923271592513/api/v1/types.go#L42-L259). Uses of some field of `spec.podTemplate` is described below, +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). Uses of some fields of `spec.podTemplate` are described below, -#### spec.podTemplate.spec.env -`spec.podTemplate.spec.env` is an `optional` field that specifies the environment variables to pass to the Elasticsearch Docker image. -You are not allowed to pass the following `env`: -- `node.name` -- `node.ingest` -- `node.master` -- `node.data` +#### spec.podTemplate.spec.tolerations +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. + +#### spec.podTemplate.spec.volumes + +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. + +#### spec.podTemplate.spec.podPlacementPolicy + +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. -```ini -Error from server (Forbidden): error when creating "./elasticsearch.yaml": admission webhook "elasticsearch.validators.kubedb.com" denied the request: environment variable node.name is forbidden to use in Elasticsearch spec -``` #### spec.podTemplate.spec.imagePullSecrets @@ -779,23 +789,52 @@ spec: serviceAccountName: es ``` -#### spec.podTemplate.spec.resources +#### spec.podTemplate.spec.containers + +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, + +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].env + +`spec.podTemplate.spec.env` is an `optional` field that specifies the environment variables to pass to the Elasticsearch Containers. + +You are not allowed to pass the following `env`: +- `node.name` +- `node.ingest` +- `node.master` +- `node.data` + + +```ini +Error from server (Forbidden): error when creating "./elasticsearch.yaml": admission webhook "elasticsearch.validators.kubedb.com" denied the request: environment variable node.name is forbidden to use in Elasticsearch spec +``` + +##### spec.podTemplate.spec.containers[].resources -`spec.podTemplate.spec.resources` is an `optional` field. If the `spec.topology` field is not set, then it can be used to request or limit computational resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). +`spec.podTemplate.spec.containers[].resources` is an `optional` field. then it can be used to request or limit computational resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). ```yaml spec: podTemplate: spec: - resources: - limits: - cpu: "1" - memory: 1Gi - requests: - cpu: 500m - memory: 512Mi + containers: + - name: "elasticsearch" + resources: + limits: + cpu: 500m + memory: 1Gi + requests: + cpu: 500m + memory: 1Gi ``` + + ### spec.serviceTemplates `spec.serviceTemplates` is an `optional` field that contains a list of the serviceTemplate. The templates are identified by the `alias`. For Elasticsearch, the configurable services' `alias` are `primary` and `stats`. diff --git a/docs/guides/kafka/concepts/kafka.md b/docs/guides/kafka/concepts/kafka.md index 49d0b00e7..361d4f65f 100644 --- a/docs/guides/kafka/concepts/kafka.md +++ b/docs/guides/kafka/concepts/kafka.md @@ -23,7 +23,7 @@ section_menu_id: guides As with all other Kubernetes objects, a Kafka needs `apiVersion`, `kind`, and `metadata` fields. It also needs a `.spec` section. Below is an example Kafka object. ```yaml -apiVersion: kubedb.com/v1alpha2 +apiVersion: kubedb.com/v1 kind: Kafka metadata: name: kafka @@ -65,37 +65,37 @@ spec: name: kafka-ca-issuer topology: broker: - replicas: 3 - resources: - limits: - memory: 1Gi - requests: - cpu: 500m - memory: 1Gi + podTemplate: + spec: + containers: + - name: kafka + resources: + requests: + cpu: 500m + memory: 1024Mi + limits: + cpu: 700m + memory: 2Gi storage: accessModes: - ReadWriteOnce resources: requests: - storage: 1Gi + storage: 10Gi storageClassName: standard - suffix: broker controller: - replicas: 3 - resources: - limits: - memory: 1Gi - requests: - cpu: 500m - memory: 1Gi - storage: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - storageClassName: standard - suffix: controller + replicas: 1 + podTemplate: + spec: + containers: + - name: kafka + resources: + requests: + cpu: 500m + memory: 1024Mi + limits: + cpu: 700m + memory: 2Gi monitor: agent: prometheus.io/operator prometheus: @@ -317,7 +317,9 @@ KubeDB accept following fields to set in `spec.podTemplate:` - annotations (petset's annotation) - labels (petset's labels) - spec: - - resources + - containers + - volumes + - podPlacementPolicy - initContainers - containers - imagePullSecrets @@ -333,17 +335,26 @@ KubeDB accept following fields to set in `spec.podTemplate:` - readinessProbe - lifecycle -You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/39bf8b2/api/v2/types.go#L44-L279). Uses of some field of `spec.podTemplate` is described below, +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). +Uses of some field of `spec.podTemplate` is described below, NB. If `spec.topology` is set, then `spec.podTemplate` needs to be empty. Instead use `spec.topology..podTemplate` -#### spec.podTemplate.spec.nodeSelector +#### spec.podTemplate.spec.tolerations -`spec.podTemplate.spec.nodeSelector` is an optional field that specifies a map of key-value pairs. For the pod to be eligible to run on a node, the node must have each of the indicated key-value pairs as labels (it can have additional labels as well). To learn more, see [here](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) . +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. + +#### spec.podTemplate.spec.volumes + +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. + +#### spec.podTemplate.spec.podPlacementPolicy -#### spec.podTemplate.spec.resources +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. -`spec.podTemplate.spec.resources` is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). +#### spec.podTemplate.spec.nodeSelector + +`spec.podTemplate.spec.nodeSelector` is an optional field that specifies a map of key-value pairs. For the pod to be eligible to run on a node, the node must have each of the indicated key-value pairs as labels (it can have additional labels as well). To learn more, see [here](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) . ### spec.serviceTemplates @@ -368,6 +379,25 @@ KubeDB allows following fields to set in `spec.serviceTemplates`: See [here](https://github.com/kmodules/offshoot-api/blob/kubernetes-1.21.1/api/v1/types.go#L237) to understand these fields in detail. + +#### spec.podTemplate.spec.containers + +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, + +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].env + +`spec.podTemplate.spec.containers[].env` is an optional field that specifies the environment variables to pass to the Redis containers. + +##### spec.podTemplate.spec.containers[].resources + +`spec.podTemplate.spec.containers[].resources` is an optional field. This can be used to request compute resources required by containers of the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). + ### spec.deletionPolicy `deletionPolicy` gives flexibility whether to `nullify`(reject) the delete operation of `Kafka` crd or which resources KubeDB should keep or delete when you delete `Kafka` crd. KubeDB provides following four deletion policies: diff --git a/docs/guides/mariadb/concepts/mariadb/index.md b/docs/guides/mariadb/concepts/mariadb/index.md index 8e3a6c659..f02f85cf5 100644 --- a/docs/guides/mariadb/concepts/mariadb/index.md +++ b/docs/guides/mariadb/concepts/mariadb/index.md @@ -231,9 +231,9 @@ KubeDB accepts the following fields to set in `spec.podTemplate:` - controller: - annotations (petset's annotation) - spec: - - args - - env - - resources + - containers + - volumes + - podPlacementPolicy - initContainers - imagePullSecrets - nodeSelector @@ -250,11 +250,36 @@ KubeDB accepts the following fields to set in `spec.podTemplate:` Uses of some field of `spec.podTemplate` is described below, -#### spec.podTemplate.spec.args +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). +Uses of some field of `spec.podTemplate` is described below, + +#### spec.podTemplate.spec.tolerations + +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. + +#### spec.podTemplate.spec.volumes + +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. + +#### spec.podTemplate.spec.podPlacementPolicy + +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. -`spec.podTemplate.spec.args` is an optional field. This can be used to provide additional arguments for database installation. To learn about available args of `mysqld`, visit [here](https://mariadb.com/kb/en/mysqld-options/). +#### spec.podTemplate.spec.containers -#### spec.podTemplate.spec.env +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, + +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].resources + +`spec.podTemplate.spec.containers[].resources` is an optional field. This can be used to request compute resources required by containers of the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). + +##### spec.podTemplate.spec.containers[].env `spec.podTemplate.spec.env` is an optional field that specifies the environment variables to pass to the MariaDB docker image. To know about supported environment variables, please visit [here](https://hub.docker.com/_/mariadb/). @@ -303,10 +328,6 @@ for: "./mariadb.yaml": admission webhook "mariadb.validators.kubedb.com" denied If a service account name is given, and there's an existing service account by that name, the KubeDB operator will use that existing service account. Since this service account is not managed by KubeDB, users are responsible for providing necessary access permissions manually. -#### spec.podTemplate.spec.resources - -`spec.podTemplate.spec.resources` is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). - ### spec.serviceTemplate You can also provide a template for the services created by KubeDB operator for MariaDB database through `spec.serviceTemplate`. This will allow you to set the type and other properties of the services. diff --git a/docs/guides/memcached/concepts/memcached.md b/docs/guides/memcached/concepts/memcached.md index db91d2cd0..c52b4d116 100644 --- a/docs/guides/memcached/concepts/memcached.md +++ b/docs/guides/memcached/concepts/memcached.md @@ -115,9 +115,9 @@ KubeDB accept following fields to set in `spec.podTemplate:` - controller - annotations (petset's annotation) - spec: - - args - - env - - resources + - containers + - volumes + - podPlacementPolicy - initContainers - imagePullSecrets - nodeSelector @@ -134,13 +134,35 @@ KubeDB accept following fields to set in `spec.podTemplate:` Uses of some field of `spec.podTemplate` is described below, -#### spec.podTemplate.spec.args -`spec.podTemplate.spec.args` is an optional field. This can be used to provide additional arguments to database installation. +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). +Uses of some field of `spec.podTemplate` is described below, + +#### spec.podTemplate.spec.tolerations + +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. + +#### spec.podTemplate.spec.volumes + +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. + +#### spec.podTemplate.spec.podPlacementPolicy + +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. -#### spec.podTemplate.spec.env +#### spec.podTemplate.spec.containers -`spec.env` is an optional field that specifies the environment variables to pass to the Memcached docker image. +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, + +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].env + +`.env` is an optional field that specifies the environment variables to pass to the Memcached containers. Note that, KubeDB does not allow to update the environment variables. If you try to update environment variables, KubeDB operator will reject the request with following error, @@ -158,6 +180,10 @@ At least one of the following was changed: spec.podTemplate.spec.env ``` +##### spec.podTemplate.spec.containers[].resources + +`spec.podTemplate.spec.containers[].resources` is an optional field. This can be used to request compute resources required by containers of the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). + #### spec.podTemplate.spec.imagePullSecrets `KubeDB` provides the flexibility of deploying Memcached server from a private Docker registry. To learn how to deploym Memcached from a private registry, please visit [here](/docs/guides/memcached/private-registry/using-private-registry.md). diff --git a/docs/guides/mongodb/concepts/mongodb.md b/docs/guides/mongodb/concepts/mongodb.md index d1e16393b..2818fad57 100644 --- a/docs/guides/mongodb/concepts/mongodb.md +++ b/docs/guides/mongodb/concepts/mongodb.md @@ -475,9 +475,9 @@ KubeDB accept following fields to set in `spec.podTemplate:` - annotations (petset's annotation) - labels (petset's labels) - spec: - - args - - env - - resources + - containers + - volumes + - podPlacementPolicy - initContainers - imagePullSecrets - nodeSelector @@ -492,17 +492,39 @@ KubeDB accept following fields to set in `spec.podTemplate:` - readinessProbe - lifecycle -You can checkout the full list [here](https://github.com/kmodules/offshoot-api/blob/ea366935d5bad69d7643906c7556923271592513/api/v1/types.go#L42-L259). Uses of some field of `spec.podTemplate` is described below, +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). +Uses of some field of `spec.podTemplate` is described below, NB. If `spec.shardTopology` is set, then `spec.podTemplate` needs to be empty. Instead use `spec.shardTopology..podTemplate` -#### spec.podTemplate.spec.args +#### spec.podTemplate.spec.tolerations -`spec.podTemplate.spec.args` is an optional field. This can be used to provide additional arguments to database installation. To learn about available args of `mongod`, visit [here](https://docs.mongodb.com/manual/reference/program/mongod/). +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. -#### spec.podTemplate.spec.env +#### spec.podTemplate.spec.volumes -`spec.podTemplate.spec.env` is an optional field that specifies the environment variables to pass to the MongoDB docker image. To know about supported environment variables, please visit [here](https://hub.docker.com/r/_/mongo/). +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. + +#### spec.podTemplate.spec.podPlacementPolicy + +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. + + + + +#### spec.podTemplate.spec.containers + +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, + +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].env + +`spec.podTemplate.spec.containers[].env` is an optional field that specifies the environment variables to pass to the MongoDB docker image. To know about supported environment variables, please visit [here](https://hub.docker.com/r/_/mongo/). Note that, KubeDB does not allow `MONGO_INITDB_ROOT_USERNAME` and `MONGO_INITDB_ROOT_PASSWORD` environment variables to set in `spec.podTemplate.spec.env`. If you want to use custom superuser and password, please use `spec.authSecret` instead described earlier. @@ -532,6 +554,10 @@ for: "./mongodb.yaml": admission webhook "mongodb.validators.kubedb.com" denied spec.podTemplate.spec.env ``` +##### spec.podTemplate.spec.containers[].resources + +`spec.podTemplate.spec.containers[].resources` is an optional field. This can be used to request compute resources required by containers of the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). + #### spec.podTemplate.spec.imagePullSecret `KubeDB` provides the flexibility of deploying MongoDB database from a private Docker registry. `spec.podTemplate.spec.imagePullSecrets` is an optional field that points to secrets to be used for pulling docker image if you are using a private docker registry. To learn how to deploy MongoDB from a private registry, please visit [here](/docs/guides/mongodb/private-registry/using-private-registry.md). @@ -550,10 +576,6 @@ If a service account name is given, but there's no existing service account by t If a service account name is given, and there's an existing service account by that name, the KubeDB operator will use that existing service account. Since this service account is not managed by KubeDB, users are responsible for providing necessary access permissions manually. Follow the guide [here](/docs/guides/mongodb/custom-rbac/using-custom-rbac.md) to grant necessary permissions in this scenario. -#### spec.podTemplate.spec.resources - -`spec.podTemplate.spec.resources` is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). - ### spec.serviceTemplates You can also provide template for the services created by KubeDB operator for MongoDB database through `spec.serviceTemplates`. This will allow you to set the type and other properties of the services. diff --git a/docs/guides/mysql/concepts/database/index.md b/docs/guides/mysql/concepts/database/index.md index 34edabc66..2ec2e16d5 100644 --- a/docs/guides/mysql/concepts/database/index.md +++ b/docs/guides/mysql/concepts/database/index.md @@ -269,9 +269,9 @@ KubeDB accepts the following fields to set in `spec.podTemplate:` - controller: - annotations (petset's annotation) - spec: - - args - - env - - resources + - containers + - volumes + - podPlacementPolicy - initContainers - imagePullSecrets - nodeSelector @@ -286,15 +286,37 @@ KubeDB accepts the following fields to set in `spec.podTemplate:` - readinessProbe - lifecycle +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). Uses of some field of `spec.podTemplate` is described below, -#### spec.podTemplate.spec.args +#### spec.podTemplate.spec.tolerations -`spec.podTemplate.spec.args` is an optional field. This can be used to provide additional arguments for database installation. To learn about available args of `mysqld`, visit [here](https://dev.mysql.com/doc/refman/8.0/en/server-options.html). +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. -#### spec.podTemplate.spec.env +#### spec.podTemplate.spec.volumes -`spec.podTemplate.spec.env` is an optional field that specifies the environment variables to pass to the MySQL docker image. To know about supported environment variables, please visit [here](https://hub.docker.com/_/mysql/). +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. + +#### spec.podTemplate.spec.podPlacementPolicy + +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. + + + + +#### spec.podTemplate.spec.containers + +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, + +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].env + +`spec.podTemplate.spec.containers[].env` is an optional field that specifies the environment variables to pass to the MySQL docker image. To know about supported environment variables, please visit [here](https://hub.docker.com/_/mysql/). Note that, KubeDB does not allow `MYSQL_ROOT_PASSWORD`, `MYSQL_ALLOW_EMPTY_PASSWORD`, `MYSQL_RANDOM_ROOT_PASSWORD`, and `MYSQL_ONETIME_PASSWORD` environment variables to set in `spec.env`. If you want to set the root password, please use `spec.authSecret` instead described earlier. @@ -323,6 +345,10 @@ for: "./mysql.yaml": admission webhook "mysql.validators.kubedb.com" denied the spec.podTemplate.spec.env ``` +##### spec.podTemplate.spec.containers[].resources + +`spec.podTemplate.spec.containers[].resources` is an optional field. This can be used to request compute resources required by containers of the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). + #### spec.podTemplate.spec.imagePullSecrets `KubeDB` provides the flexibility of deploying MySQL database from a private Docker registry. `spec.podTemplate.spec.imagePullSecrets` is an optional field that points to secrets to be used for pulling docker image if you are using a private docker registry. To learn how to deploy MySQL from a private registry, please visit [here](/docs/guides/mysql/private-registry/index.md). @@ -341,10 +367,6 @@ for: "./mysql.yaml": admission webhook "mysql.validators.kubedb.com" denied the If a service account name is given, and there's an existing service account by that name, the KubeDB operator will use that existing service account. Since this service account is not managed by KubeDB, users are responsible for providing necessary access permissions manually. Follow the guide [here](/docs/guides/mysql/custom-rbac/index.md) to grant necessary permissions in this scenario. -#### spec.podTemplate.spec.resources - -`spec.podTemplate.spec.resources` is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). - ### spec.serviceTemplate You can also provide a template for the services created by KubeDB operator for MySQL database through `spec.serviceTemplate`. This will allow you to set the type and other properties of the services. @@ -370,9 +392,7 @@ See [here](https://github.com/kmodules/offshoot-api/blob/kubernetes-1.16.3/api/v `spec.halted` is an optional field. This field will be used to halt the kubeDB operator. When you set `spec.halted` to `true`, the KubeDB operator doesn't perform any operation on `MySQL` object. -### spec.halted - -`spec.halted` is an optional field. Suppose you want to delete the `MySQL` resources(`PetSet`, `Service` etc.) except `MySQL` object, `PVCs` and `Secret` then you need to set `spec.halted` to `true`. If you set `spec.halted` to `true` then the `deletionPolicy` in `MySQL` object will be set `Halt` by-default. +Suppose you want to delete the `MySQL` resources(`PetSet`, `Service` etc.) except `MySQL` object, `PVCs` and `Secret` then you need to set `spec.halted` to `true`. If you set `spec.halted` to `true` then the `deletionPolicy` in `MySQL` object will be set `Halt` by-default. ### spec.deletionPolicy diff --git a/docs/guides/percona-xtradb/concepts/perconaxtradb/index.md b/docs/guides/percona-xtradb/concepts/perconaxtradb/index.md index 66f2f4903..6c3287e86 100644 --- a/docs/guides/percona-xtradb/concepts/perconaxtradb/index.md +++ b/docs/guides/percona-xtradb/concepts/perconaxtradb/index.md @@ -202,9 +202,9 @@ KubeDB accepts the following fields to set in `spec.podTemplate:` - controller: - annotations (petset's annotation) - spec: - - args - - env - - resources + - containers + - volumes + - podPlacementPolicy - initContainers - imagePullSecrets - nodeSelector @@ -221,13 +221,35 @@ KubeDB accepts the following fields to set in `spec.podTemplate:` Uses of some field of `spec.podTemplate` is described below, -#### spec.podTemplate.spec.args -`spec.podTemplate.spec.args` is an optional field. This can be used to provide additional arguments for database installation. +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). +Uses of some field of `spec.podTemplate` is described below, + +#### spec.podTemplate.spec.tolerations + +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. + +#### spec.podTemplate.spec.volumes + +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. + +#### spec.podTemplate.spec.podPlacementPolicy + +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. + +#### spec.podTemplate.spec.containers -#### spec.podTemplate.spec.env +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, -`spec.podTemplate.spec.env` is an optional field that specifies the environment variables to pass to the PerconaXtraDB docker image. To know about supported environment variables, please visit [here](https://hub.docker.com/_/perconaxtradb/). +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].env + +`spec.podTemplate.spec.containers[].env` is an optional field that specifies the environment variables to pass to the PerconaXtraDB docker image. To know about supported environment variables, please visit [here](https://hub.docker.com/_/perconaxtradb/). Note that, KubeDB does not allow `MYSQL_ROOT_PASSWORD`, `MYSQL_ALLOW_EMPTY_PASSWORD`, `MYSQL_RANDOM_ROOT_PASSWORD`, and `MYSQL_ONETIME_PASSWORD` environment variables to set in `spec.env`. If you want to set the root password, please use `spec.authSecret` instead described earlier. @@ -256,6 +278,10 @@ for: "./perconaxtradb.yaml": admission webhook "perconaxtradb.validators.kubedb. spec.podTemplate.spec.env ``` +##### spec.podTemplate.spec.containers[].resources + +`spec.podTemplate.spec.containers[].resources` is an optional field. This can be used to request compute resources required by containers of the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). + #### spec.podTemplate.spec.imagePullSecrets `KubeDB` provides the flexibility of deploying PerconaXtraDB database from a private Docker registry. `spec.podTemplate.spec.imagePullSecrets` is an optional field that points to secrets to be used for pulling docker image if you are using a private docker registry. @@ -274,10 +300,6 @@ for: "./perconaxtradb.yaml": admission webhook "perconaxtradb.validators.kubedb. If a service account name is given, and there's an existing service account by that name, the KubeDB operator will use that existing service account. Since this service account is not managed by KubeDB, users are responsible for providing necessary access permissions manually. -#### spec.podTemplate.spec.resources - -`spec.podTemplate.spec.resources` is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). - ### spec.serviceTemplate You can also provide a template for the services created by KubeDB operator for PerconaXtraDB database through `spec.serviceTemplate`. This will allow you to set the type and other properties of the services. diff --git a/docs/guides/pgbouncer/concepts/pgbouncer.md b/docs/guides/pgbouncer/concepts/pgbouncer.md index 278415c7c..f343a68e6 100644 --- a/docs/guides/pgbouncer/concepts/pgbouncer.md +++ b/docs/guides/pgbouncer/concepts/pgbouncer.md @@ -153,8 +153,9 @@ KubeDB accept following fields to set in `spec.podTemplate:` - controller - annotations (petset's annotation) - spec: - - env - - resources + - containers + - volumes + - podPlacementPolicy - initContainers - imagePullSecrets - affinity @@ -163,11 +164,37 @@ KubeDB accept following fields to set in `spec.podTemplate:` - priority - lifecycle +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). Usage of some fields in `spec.podTemplate` is described below, -#### spec.podTemplate.spec.env +#### spec.podTemplate.spec.tolerations -`spec.podTemplate.spec.env` is an optional field that specifies the environment variables to pass to the PgBouncer docker image. To know about supported environment variables, please visit [here](https://hub.docker.com/kubedb/pgbouncer/). +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. + +#### spec.podTemplate.spec.volumes + +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. + +#### spec.podTemplate.spec.podPlacementPolicy + +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. + + + + +#### spec.podTemplate.spec.containers + +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, + +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].env + +`spec.podTemplate.spec.containers[].env` is an optional field that specifies the environment variables to pass to the PgBouncer containers. To know about supported environment variables, please visit [here](https://hub.docker.com/kubedb/pgbouncer/). Also, note that KubeDB does not allow updates to the environment variables as updating them does not have any effect once the server is created. If you try to update environment variables, KubeDB operator will reject the request with following error, @@ -184,6 +211,10 @@ At least one of the following was changed: spec.podTemplate.spec.nodeSelector ``` +##### spec.podTemplate.spec.containers[].resources + +`spec.podTemplate.spec.containers[].resources` is an optional field. This can be used to request compute resources required by containers of the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). + #### spec.podTemplate.spec.imagePullSecrets `spec.podTemplate.spec.imagePullSecrets` is an optional field that points to secrets to be used for pulling docker image if you are using a private docker registry. For more details on how to use private docker registry, please visit [here](/docs/guides/pgbouncer/private-registry/using-private-registry.md). @@ -192,10 +223,6 @@ At least one of the following was changed: `spec.podTemplate.spec.nodeSelector` is an optional field that specifies a map of key-value pairs. For the pod to be eligible to run on a node, the node must have each of the indicated key-value pairs as labels (it can have additional labels as well). To learn more, see [here](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) . -#### spec.podTemplate.spec.resources - -`spec.podTemplate.spec.resources` is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). - ### spec.serviceTemplate KubeDB creates a service for each PgBouncer instance. The service has the same name as the `pgbouncer.name` and points to pgbouncer pods. diff --git a/docs/guides/postgres/concepts/postgres.md b/docs/guides/postgres/concepts/postgres.md index c5ad20133..c1c93ed79 100644 --- a/docs/guides/postgres/concepts/postgres.md +++ b/docs/guides/postgres/concepts/postgres.md @@ -271,9 +271,10 @@ KubeDB accept following fields to set in `spec.podTemplate:` - controller - annotations (petset's annotation) - spec: + - containers + - volumes + - podPlacementPolicy - serviceAccountName - - env - - resources - initContainers - imagePullSecrets - nodeSelector @@ -287,21 +288,37 @@ KubeDB accept following fields to set in `spec.podTemplate:` - readinessProbe - lifecycle +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). Uses of some field of `spec.podTemplate` is described below, -#### spec.podTemplate.spec.serviceAccountName +#### spec.podTemplate.spec.tolerations -`serviceAccountName` is an optional field supported by KubeDB Operator (version 0.13.0 and higher) that can be used to specify a custom service account to fine tune role based access control. +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. -If this field is left empty, the KubeDB operator will create a service account name matching Postgres crd name. Role and RoleBinding that provide necessary access permissions will also be generated automatically for this service account. +#### spec.podTemplate.spec.volumes -If a service account name is given, but there's no existing service account by that name, the KubeDB operator will create one, and Role and RoleBinding that provide necessary access permissions will also be generated for this service account. +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. + +#### spec.podTemplate.spec.podPlacementPolicy + +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. -If a service account name is given, and there's an existing service account by that name, the KubeDB operator will use that existing service account. Since this service account is not managed by KubeDB, users are responsible for providing necessary access permissions manually. Follow the guide [here](/docs/guides/postgres/custom-rbac/using-custom-rbac.md) to grant necessary permissions in this scenario. -#### spec.podTemplate.spec.env -`spec.podTemplate.spec.env` is an optional field that specifies the environment variables to pass to the Postgres docker image. To know about supported environment variables, please visit [here](https://hub.docker.com/_/postgres/). + +#### spec.podTemplate.spec.containers + +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, + +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].env + +`spec.podTemplate.spec.containers[].env` is an optional field that specifies the environment variables to pass to the Postgres docker image. To know about supported environment variables, please visit [here](https://hub.docker.com/_/postgres/). Note that, the KubeDB operator does not allow `POSTGRES_USER` and `POSTGRES_PASSWORD` environment variable to set in `spec.podTemplate.spec.env`. If you want to set the superuser _username_ and _password_, please use `spec.authSecret` instead described earlier. @@ -332,6 +349,20 @@ At least one of the following was changed: spec.init ``` +##### spec.podTemplate.spec.containers[].resources + +`spec.podTemplate.spec.containers[].resources` is an optional field. This can be used to request compute resources required by containers of the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). + +#### spec.podTemplate.spec.serviceAccountName + +`serviceAccountName` is an optional field supported by KubeDB Operator (version 0.13.0 and higher) that can be used to specify a custom service account to fine tune role based access control. + +If this field is left empty, the KubeDB operator will create a service account name matching Postgres crd name. Role and RoleBinding that provide necessary access permissions will also be generated automatically for this service account. + +If a service account name is given, but there's no existing service account by that name, the KubeDB operator will create one, and Role and RoleBinding that provide necessary access permissions will also be generated for this service account. + +If a service account name is given, and there's an existing service account by that name, the KubeDB operator will use that existing service account. Since this service account is not managed by KubeDB, users are responsible for providing necessary access permissions manually. Follow the guide [here](/docs/guides/postgres/custom-rbac/using-custom-rbac.md) to grant necessary permissions in this scenario. + #### spec.podTemplate.spec.imagePullSecrets `spec.podTemplate.spec.imagePullSecrets` is an optional field that points to secrets to be used for pulling docker image if you are using a private docker registry. For more details on how to use private docker registry, please visit [here](/docs/guides/postgres/private-registry/using-private-registry.md). @@ -340,10 +371,6 @@ At least one of the following was changed: `spec.podTemplate.spec.nodeSelector` is an optional field that specifies a map of key-value pairs. For the pod to be eligible to run on a node, the node must have each of the indicated key-value pairs as labels (it can have additional labels as well). To learn more, see [here](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) . -#### spec.podTemplate.spec.resources - -`spec.podTemplate.spec.resources` is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). - ### spec.serviceTemplate KubeDB creates two different services for each Postgres instance. One of them is a master service named `` and points to the Postgres `Primary` pod/node. Another one is a replica service named `-replicas` and points to Postgres `replica` pods/nodes. diff --git a/docs/guides/proxysql/concepts/proxysql/index.md b/docs/guides/proxysql/concepts/proxysql/index.md index 5ccf8a288..7e5c8822a 100644 --- a/docs/guides/proxysql/concepts/proxysql/index.md +++ b/docs/guides/proxysql/concepts/proxysql/index.md @@ -286,9 +286,9 @@ KubeDB accept following fields to set in `.spec.podTemplate`: - controller: - annotations (petset's annotation) - spec: - - args - - env - - resources + - containers + - volumes + - podPlacementPolicy - initContainers - imagePullSecrets - nodeSelector @@ -303,15 +303,42 @@ KubeDB accept following fields to set in `.spec.podTemplate`: - readinessProbe - lifecycle -Usage of some field of `.spec.podTemplate` is described below, +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). +Uses of some field of `spec.podTemplate` is described below, -#### .spec.podTemplate.spec.args +#### spec.podTemplate.spec.tolerations -`.spec.podTemplate.spec.args` is an optional field. This can be used to provide additional arguments to proxysql installation. +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. -#### .spec.podTemplate.spec.env +#### spec.podTemplate.spec.volumes + +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. + +#### spec.podTemplate.spec.podPlacementPolicy + +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. + + + + +#### spec.podTemplate.spec.containers + +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, + +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].env + +`spec.podTemplate.spec.containers[].env` is an optional field that specifies the environment variables to pass to the Redis containers. + +##### spec.podTemplate.spec.containers[].resources + +`spec.podTemplate.spec.containers[].resources` is an optional field. This can be used to request compute resources required by containers of the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). -`.spec.podTemplate.spec.env` is an optional field that specifies the environment variables to pass to the ProxySQL docker image. Here is a list of currently supported environment variables to the ProxySQL image: #### .spec.podTemplate.spec.imagePullSecrets @@ -331,10 +358,6 @@ Usage of some field of `.spec.podTemplate` is described below, If a service account name is given, and there's an existing service account by that name, the KubeDB operator will use that existing service account. Since this service account is not managed by KubeDB, users are responsible for providing necessary access permissions manually. -#### .spec.podTemplate.spec.resources - -`.spec.podTemplate.spec.resources` is an optional field. This can be used to request compute resources required by the ProxySQL Pod. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). - ### .spec.serviceTemplate You can also provide a template for the services created by KubeDB operator for the ProxySQL through `.spec.serviceTemplate`. This will allow you to set the type and other properties of the services. diff --git a/docs/guides/redis/concepts/redis.md b/docs/guides/redis/concepts/redis.md index 4e1fd4081..fdddd8ef6 100644 --- a/docs/guides/redis/concepts/redis.md +++ b/docs/guides/redis/concepts/redis.md @@ -128,10 +128,9 @@ AutoOps is an optional field to control the generation of version update & TLS-r `spec.version` is a required field specifying the name of the [RedisVersion](/docs/guides/redis/concepts/catalog.md) crd where the docker images are specified. Currently, when you install KubeDB, it creates the following `RedisVersion` crds, -- `4.0.6-v2`, `4.0.11`, `6.2.14`, `5.0.14` -- `6.0.20`, `6.2.14`, `6.2.14` `6.2.14` -- `7.0.4`, `7.0.14`, `7.0.6` - +- `4.0.11`, `5.0.14` +- `6.0.20`, `6.2.14` +- `7.0.14`, `7.0.15`, `7.2.3`, `7.2.4` ### spec.mode `spec.mode` specifies the mode in which Redis server instance(s) will be deployed. The possible values are either `"Standalone"`, `"Cluster"` and `"Sentinel""`. The default value is `"Standalone"`. @@ -150,7 +149,7 @@ When `spec.mode` is set to `Sentinel`, `spec.sentinelRef.name` and `spec.sentine If `spec.mode` is set to `"Cluster"`, users can optionally provide a cluster specification. Currently, the following two parameters can be configured: - `spec.cluster.shards`: specifies the number of Redis shard nodes. It must be greater or equal to 3. If not set, the operator set it to 3. -- `spec.cluster.replicas`: specifies the number of replica nodes per shard. It must be greater than 0. If not set, the operator set it to 1. +- `spec.cluster.replicas`: specifies the number of replica nodes per shard. It must be greater than 1. If not set, the operator set it to 2. KubeDB uses `PodDisruptionBudget` to ensure that majority of these cluster replicas are available during [voluntary disruptions](https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#voluntary-and-involuntary-disruptions) so that quorum is maintained and no data loss is occurred. @@ -287,10 +286,10 @@ KubeDB accept following fields to set in `spec.podTemplate:` - controller: - annotations (petset's annotation) - spec: - - args - - env - - resources - initContainers + - containers + - volumes + - podPlacementPolicy - imagePullSecrets - nodeSelector - affinity @@ -304,16 +303,20 @@ KubeDB accept following fields to set in `spec.podTemplate:` - readinessProbe - lifecycle -You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/ea366935d5bad69d7643906c7556923271592513/api/v1/types.go#L42-L259). +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). Uses of some field of `spec.podTemplate` is described below, -#### spec.podTemplate.spec.args - `spec.podTemplate.spec.args` is an optional field. This can be used to provide additional arguments to database installation. +#### spec.podTemplate.spec.tolerations + +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. + +#### spec.podTemplate.spec.volumes -### spec.podTemplate.spec.env +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. -`spec.podTemplate.spec.env` is an optional field that specifies the environment variables to pass to the Redis docker image. +#### spec.podTemplate.spec.podPlacementPolicy +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. #### spec.podTemplate.spec.imagePullSecret @@ -323,6 +326,24 @@ Uses of some field of `spec.podTemplate` is described below, `spec.podTemplate.spec.nodeSelector` is an optional field that specifies a map of key-value pairs. For the pod to be eligible to run on a node, the node must have each of the indicated key-value pairs as labels (it can have additional labels as well). To learn more, see [here](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) . +#### spec.podTemplate.spec.containers + +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, + +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].env + +`spec.podTemplate.spec.containers[].env` is an optional field that specifies the environment variables to pass to the Redis containers. + +##### spec.podTemplate.spec.containers[].resources + +`spec.podTemplate.spec.containers[].resources` is an optional field. This can be used to request compute resources required by containers of the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). + #### spec.podTemplate.spec.serviceAccountName `serviceAccountName` is an optional field supported by KubeDB Operator (version 0.13.0 and higher) that can be used to specify a custom service account to fine tune role based access control. @@ -333,9 +354,6 @@ Uses of some field of `spec.podTemplate` is described below, If a service account name is given, and there's an existing service account by that name, the KubeDB operator will use that existing service account. Since this service account is not managed by KubeDB, users are responsible for providing necessary access permissions manually. Follow the guide [here](/docs/guides/redis/custom-rbac/using-custom-rbac.md) to grant necessary permissions in this scenario. -#### spec.podTemplate.spec.resources - -`spec.podTemplate.spec.resources` is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). ### spec.serviceTemplates diff --git a/docs/guides/redis/concepts/redissentinel.md b/docs/guides/redis/concepts/redissentinel.md index 89b617a45..94cf9adfd 100644 --- a/docs/guides/redis/concepts/redissentinel.md +++ b/docs/guides/redis/concepts/redissentinel.md @@ -81,7 +81,7 @@ spec: imagePullSecrets: - name: regcred containers: - - name: redis + - name: redissentinel args: - "--loglevel verbose" env: @@ -248,9 +248,9 @@ KubeDB accept following fields to set in `spec.podTemplate:` - controller: - annotations (petset's annotation) - spec: - - args - - env - - resources + - containers + - volumes + - podPlacementPolicy - initContainers - imagePullSecrets - nodeSelector @@ -265,14 +265,37 @@ KubeDB accept following fields to set in `spec.podTemplate:` - readinessProbe - lifecycle +You can check out the full list [here](https://github.com/kmodules/offshoot-api/blob/master/api/v2/types.go#L26C1-L279C1). Uses of some field of `spec.podTemplate` is described below, -#### spec.podTemplate.spec.args - `spec.podTemplate.spec.args` is an optional field. This can be used to provide additional arguments to database installation. +#### spec.podTemplate.spec.tolerations -### spec.podTemplate.spec.env +The `spec.podTemplate.spec.tolerations` is an optional field. This can be used to specify the pod's tolerations. -`spec.podTemplate.spec.env` is an optional field that specifies the environment variables to pass to the Redis docker image. +#### spec.podTemplate.spec.volumes + +The `spec.podTemplate.spec.volumes` is an optional field. This can be used to provide the list of volumes that can be mounted by containers belonging to the pod. + +#### spec.podTemplate.spec.podPlacementPolicy + +`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the podPlacementPolicy. This will be used by our Petset controller to place the db pods throughout the region, zone & nodes according to the policy. It utilizes kubernetes affinity & podTopologySpreadContraints feature to do so. + + + + +#### spec.podTemplate.spec.containers + +The `spec.podTemplate.spec.containers` can be used to provide the list containers and their configurations for to the database pod. some of the fields are described below, + +##### spec.podTemplate.spec.containers[].name +The `spec.podTemplate.spec.containers[].name` field used to specify the name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +##### spec.podTemplate.spec.containers[].args +`spec.podTemplate.spec.containers[].args` is an optional field. This can be used to provide additional arguments to database installation. + +##### spec.podTemplate.spec.containers[].env + +`spec.podTemplate.spec.containers[].env` is an optional field that specifies the environment variables to pass to the Redis containers. Note that, KubeDB does not allow to update the environment variables. If you try to update environment variables, KubeDB operator will reject the request with following error, @@ -288,9 +311,13 @@ name namespace spec.storage spec.podTemplate.spec.nodeSelector -spec.podTemplate.spec.env +spec.podTemplate.spec.containers[].env ``` +##### spec.podTemplate.spec.containers[].resources + +`spec.podTemplate.spec.containers[].resources` is an optional field. This can be used to request compute resources required by containers of the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). + #### spec.podTemplate.spec.imagePullSecret `KubeDB` provides the flexibility of deploying Redis server from a private Docker registry. To learn how to deploy Redis from a private registry, please visit [here](/docs/guides/redis/private-registry/using-private-registry.md). @@ -309,10 +336,6 @@ spec.podTemplate.spec.env If a service account name is given, and there's an existing service account by that name, the KubeDB operator will use that existing service account. Since this service account is not managed by KubeDB, users are responsible for providing necessary access permissions manually. Follow the guide [here](/docs/guides/redis/custom-rbac/using-custom-rbac.md) to grant necessary permissions in this scenario. -#### spec.podTemplate.spec.resources - -`spec.podTemplate.spec.resources` is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/). - ### spec.serviceTemplates You can also provide a template for the services created by KubeDB operator for Redis server through `spec.serviceTemplates`. This will allow you to set the type and other properties of the services.