From 303376a34f1f8b0affd0c76be5b64d54437be249 Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Fri, 16 Aug 2024 19:30:52 +0600 Subject: [PATCH 01/13] Update Concepts Docs Signed-off-by: Neaj Morshad --- docs/guides/redis/concepts/redis.md | 48 ++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/docs/guides/redis/concepts/redis.md b/docs/guides/redis/concepts/redis.md index 4e1fd40810..c89681b061 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"`. @@ -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 #### 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 From 7bb05dfe030a414462570e52b0723bfa88fbf6f9 Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Mon, 19 Aug 2024 18:15:37 +0600 Subject: [PATCH 02/13] Update Concepts Docs for Redis Signed-off-by: Neaj Morshad --- docs/guides/redis/concepts/redis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/redis/concepts/redis.md b/docs/guides/redis/concepts/redis.md index c89681b061..9069acc3ab 100644 --- a/docs/guides/redis/concepts/redis.md +++ b/docs/guides/redis/concepts/redis.md @@ -316,7 +316,7 @@ The `spec.podTemplate.spec.volumes` is an optional field. This can be used to pr #### spec.podTemplate.spec.podPlacementPolicy -`spec.podTemplate.spec.podPlacementPolicy` is an optional field. This can be used to provide the reference of the 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 From ee3dc80900c982a80f1baf931bc1e34feafb3a00 Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Tue, 20 Aug 2024 16:02:52 +0600 Subject: [PATCH 03/13] Concepts update for es Signed-off-by: Neaj Morshad --- .../concepts/elasticsearch/index.md | 127 ++++++++++++------ docs/guides/redis/concepts/redis.md | 2 +- 2 files changed, 84 insertions(+), 45 deletions(-) diff --git a/docs/guides/elasticsearch/concepts/elasticsearch/index.md b/docs/guides/elasticsearch/concepts/elasticsearch/index.md index 9aa36fcacb..0b6427f264 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/redis/concepts/redis.md b/docs/guides/redis/concepts/redis.md index 9069acc3ab..fdddd8ef6d 100644 --- a/docs/guides/redis/concepts/redis.md +++ b/docs/guides/redis/concepts/redis.md @@ -149,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. From cc064ff13ce9c446feda3a9246bee8213731ce4a Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Tue, 20 Aug 2024 16:15:56 +0600 Subject: [PATCH 04/13] Update concpets for kafka Signed-off-by: Neaj Morshad --- docs/guides/kafka/concepts/kafka.md | 92 +++++++++++++++++++---------- 1 file changed, 61 insertions(+), 31 deletions(-) diff --git a/docs/guides/kafka/concepts/kafka.md b/docs/guides/kafka/concepts/kafka.md index 49d0b00e70..361d4f65f5 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: From f1a4c44f1d86ac6bba9bab6e2f5e1260f6c0519c Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Tue, 20 Aug 2024 16:18:56 +0600 Subject: [PATCH 05/13] Update concpets for mariadb Signed-off-by: Neaj Morshad --- docs/guides/mariadb/concepts/mariadb/index.md | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/docs/guides/mariadb/concepts/mariadb/index.md b/docs/guides/mariadb/concepts/mariadb/index.md index 8e3a6c6590..f02f85cf5b 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. From ab8dd4217f9baeec618c46deb5564a04e5d874a7 Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Tue, 20 Aug 2024 16:21:12 +0600 Subject: [PATCH 06/13] Update concpets for mem Signed-off-by: Neaj Morshad --- docs/guides/memcached/concepts/memcached.md | 40 +++++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/docs/guides/memcached/concepts/memcached.md b/docs/guides/memcached/concepts/memcached.md index db91d2cd05..c52b4d1164 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). From 6950531183dddd1aceb0e4f552f4ffe175ac6e7c Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Tue, 20 Aug 2024 16:24:58 +0600 Subject: [PATCH 07/13] Update concpets for mongo Signed-off-by: Neaj Morshad --- docs/guides/mongodb/concepts/mongodb.md | 46 ++++++++++++++++++------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/docs/guides/mongodb/concepts/mongodb.md b/docs/guides/mongodb/concepts/mongodb.md index d1e16393b1..2818fad57e 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. From 7acbb79913ea2b591b468787993a518e54900a57 Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Tue, 20 Aug 2024 16:28:23 +0600 Subject: [PATCH 08/13] Update concpets for mysql Signed-off-by: Neaj Morshad --- docs/guides/mysql/concepts/database/index.md | 48 ++++++++++++++------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/docs/guides/mysql/concepts/database/index.md b/docs/guides/mysql/concepts/database/index.md index 34edabc66a..2ec2e16d58 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 From d2be4563d577ab1a28a390909933462c3cab7cc9 Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Tue, 20 Aug 2024 16:30:49 +0600 Subject: [PATCH 09/13] Update concpets for percona Signed-off-by: Neaj Morshad --- .../concepts/perconaxtradb/index.md | 44 ++++++++++++++----- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/docs/guides/percona-xtradb/concepts/perconaxtradb/index.md b/docs/guides/percona-xtradb/concepts/perconaxtradb/index.md index 66f2f49033..6c3287e86e 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. From 2191e4a693a66a8ef5cee5028c87407a0372a38a Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Tue, 20 Aug 2024 16:34:09 +0600 Subject: [PATCH 10/13] Update concpets for pgbouncer Signed-off-by: Neaj Morshad --- docs/guides/pgbouncer/concepts/pgbouncer.md | 43 +++++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/docs/guides/pgbouncer/concepts/pgbouncer.md b/docs/guides/pgbouncer/concepts/pgbouncer.md index 278415c7c4..f343a68e6c 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. From 68790b65789aa62fa59e66a9ae0a3be7cb52edbc Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Tue, 20 Aug 2024 16:41:02 +0600 Subject: [PATCH 11/13] Update concpets for postgres Signed-off-by: Neaj Morshad --- docs/guides/postgres/concepts/postgres.md | 53 +++++++++++++++++------ 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/docs/guides/postgres/concepts/postgres.md b/docs/guides/postgres/concepts/postgres.md index c5ad20133a..c1c93ed798 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. From 071e7cbb408d3e07a2d8457f68c6e0e9818589e7 Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Tue, 20 Aug 2024 16:48:22 +0600 Subject: [PATCH 12/13] Update concpets for proxysql Signed-off-by: Neaj Morshad --- .../proxysql/concepts/proxysql/index.md | 47 ++++++++++++++----- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/docs/guides/proxysql/concepts/proxysql/index.md b/docs/guides/proxysql/concepts/proxysql/index.md index 5ccf8a2883..7e5c8822ac 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. From c74263a0d007f28595335a3a5b7e56559745ff10 Mon Sep 17 00:00:00 2001 From: Neaj Morshad Date: Tue, 20 Aug 2024 16:57:11 +0600 Subject: [PATCH 13/13] Update concpets for redissentinel Signed-off-by: Neaj Morshad --- docs/guides/redis/concepts/redissentinel.md | 49 +++++++++++++++------ 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/docs/guides/redis/concepts/redissentinel.md b/docs/guides/redis/concepts/redissentinel.md index 89b617a454..94cf9adfdc 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.