Skip to content

Commit

Permalink
Update concpets for redissentinel
Browse files Browse the repository at this point in the history
Signed-off-by: Neaj Morshad <[email protected]>
  • Loading branch information
Neaj-Morshad-101 committed Aug 20, 2024
1 parent 071e7cb commit c74263a
Showing 1 changed file with 36 additions and 13 deletions.
49 changes: 36 additions & 13 deletions docs/guides/redis/concepts/redissentinel.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ spec:
imagePullSecrets:
- name: regcred
containers:
- name: redis
- name: redissentinel
args:
- "--loglevel verbose"
env:
Expand Down Expand Up @@ -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
Expand All @@ -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,

Expand All @@ -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).
Expand All @@ -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.
Expand Down

0 comments on commit c74263a

Please sign in to comment.