mirror of
https://github.com/bitnami/charts.git
synced 2026-08-10 14:15:55 +08:00
[bitnami/valkey-cluster] Update all the references from to master/slave to primary/replica (#30025)
* [bitnami/valkey-cluster] Update all the references from to Signed-off-by: David Gomez <dgomezleon@vmware.com> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> * [bitnami/valkey-cluster] Apply feedback Signed-off-by: David Gomez <dgomezleon@vmware.com> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> * [bitnami/valkey-cluster] Fix linter warnings and update upgrading notes Signed-off-by: David Gomez <dgomezleon@vmware.com> --------- Signed-off-by: David Gomez <dgomezleon@vmware.com> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
co-authored by
Bitnami Containers
parent
75cc62d9ca
commit
e273ef7b41
@@ -1,8 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## 1.0.3 (2024-10-22)
|
||||
## 2.0.0 (2024-10-23)
|
||||
|
||||
* [bitnami/valkey-cluster] Release 1.0.3 ([#30047](https://github.com/bitnami/charts/pull/30047))
|
||||
* [bitnami/valkey-cluster] Update all the references from to master/slave to primary/replica ([#30025](https://github.com/bitnami/charts/pull/30025))
|
||||
|
||||
## <small>1.0.3 (2024-10-22)</small>
|
||||
|
||||
* [bitnami/valkey-cluster] Release 1.0.3 (#30047) ([66979a1](https://github.com/bitnami/charts/commit/66979a1de5d865b84e614737f9a0c6955d3cccc0)), closes [#30047](https://github.com/bitnami/charts/issues/30047)
|
||||
* Update documentation links to techdocs.broadcom.com (#29931) ([f0d9ad7](https://github.com/bitnami/charts/commit/f0d9ad78f39f633d275fc576d32eae78ded4d0b8)), closes [#29931](https://github.com/bitnami/charts/issues/29931)
|
||||
|
||||
## <small>1.0.2 (2024-10-03)</small>
|
||||
|
||||
|
||||
@@ -33,4 +33,4 @@ name: valkey-cluster
|
||||
sources:
|
||||
- https://github.com/bitnami/charts/tree/main/bitnami/valkey-cluster
|
||||
- https://github.com/bitnami/containers/tree/main/bitnami/vakey-cluster
|
||||
version: 1.0.3
|
||||
version: 2.0.0
|
||||
|
||||
@@ -25,14 +25,14 @@ Bitnami charts can be used with [Kubeapps](https://kubeapps.dev/) for deployment
|
||||
### Choose between Valkey Helm Chart and Valkey Cluster Helm Chart
|
||||
|
||||
You can choose any of the two Valkey Helm charts for deploying a Valkey cluster.
|
||||
While [Valkey Helm Chart](https://github.com/bitnami/charts/tree/main/bitnami/valkey) will deploy a master-slave cluster using Valkey Sentinel, the [Valkey Cluster Helm Chart](https://github.com/bitnami/charts/tree/main/bitnami/valkey-cluster) will deploy a Valkey Cluster with sharding.
|
||||
While [Valkey Helm Chart](https://github.com/bitnami/charts/tree/main/bitnami/valkey) will deploy a primary-replica cluster using Valkey Sentinel, the [Valkey Cluster Helm Chart](https://github.com/bitnami/charts/tree/main/bitnami/valkey-cluster) will deploy a Valkey Cluster with sharding.
|
||||
The main features of each chart are the following:
|
||||
|
||||
| Valkey | Valkey Cluster |
|
||||
|--------------------------------------------|------------------------------------------------------------------|
|
||||
| Supports multiple databases | Supports only one database. Better if you have a big dataset |
|
||||
| Single write point (single master) | Multiple write points (multiple masters) |
|
||||
|  |  |
|
||||
| Single write point (single primary) | Multiple write points (multiple primary nodes) |
|
||||
| |  |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -81,20 +81,20 @@ To modify the application version used in this chart, specify a different versio
|
||||
|
||||
### Cluster topology
|
||||
|
||||
To successfully set the cluster up, it will need to have at least 3 master nodes. The total number of nodes is calculated like- `nodes = numOfMasterNodes + numOfMasterNodes * replicas`. Hence, the defaults `cluster.nodes = 6` and `cluster.replicas = 1` means, 3 master and 3 replica nodes will be deployed by the chart.
|
||||
To successfully set the cluster up, it will need to have at least 3 primary nodes. The total number of nodes is calculated like- `nodes = numOfPrimaryNodes + numOfPrimaryNodes * replicas`. Hence, the defaults `cluster.nodes = 6` and `cluster.replicas = 1` means, 3 primary and 3 replica nodes will be deployed by the chart.
|
||||
|
||||
By default the Valkey Cluster is not accessible from outside the Kubernetes cluster, to access the Valkey Cluster from outside you have to set `cluster.externalAccess.enabled=true` at deployment time. It will create in the first installation only 6 LoadBalancer services, one for each Valkey node, once you have the external IPs of each service you will need to perform an upgrade passing those IPs to the `cluster.externalAccess.service.loadbalancerIP` array.
|
||||
|
||||
The replicas will be read-only replicas of the masters. By default only one service is exposed (when not using the external access mode). You will connect your client to the exposed service, regardless you need to read or write. When a write operation arrives to a replica it will redirect the client to the proper master node. For example, using `valkey-cli` you will need to provide the `-c` flag for `valkey-cli` to follow the redirection automatically.
|
||||
The replicas will be read-only replicas of the primary nodes. By default only one service is exposed (when not using the external access mode). You will connect your client to the exposed service, regardless you need to read or write. When a write operation arrives to a replica it will redirect the client to the proper primary node. For example, using `valkey-cli` you will need to provide the `-c` flag for `valkey-cli` to follow the redirection automatically.
|
||||
|
||||
Using the external access mode, you can connect to any of the pods and the slaves will redirect the client in the same way as explained before, but the all the IPs will be public.
|
||||
Using the external access mode, you can connect to any of the pods and the replicas will redirect the client in the same way as explained before, but the all the IPs will be public.
|
||||
|
||||
In case the master crashes, one of his slaves will be promoted to master. The slots stored by the crashed master will be unavailable until the slave finish the promotion. If a master and all his slaves crash, the cluster will be down until one of them is up again. To avoid downtime, it is possible to configure the number of Valkey nodes with `cluster.nodes` and the number of replicas that will be assigned to each master with `cluster.replicas`. For example:
|
||||
In case the primary crashes, one of his replicas will be promoted to primary. The slots stored by the crashed primary will be unavailable until the replica finish the promotion. If a primary and all his replicas crash, the cluster will be down until one of them is up again. To avoid downtime, it is possible to configure the number of Valkey nodes with `cluster.nodes` and the number of replicas that will be assigned to each primary with `cluster.replicas`. For example:
|
||||
|
||||
- `cluster.nodes=9` ( 3 master plus 2 replicas for each master)
|
||||
- `cluster.nodes=9` ( 3 primary plus 2 replicas for each primary)
|
||||
- `cluster.replicas=2`
|
||||
|
||||
Providing the values above, the cluster will have 3 masters and, each master, will have 2 replicas.
|
||||
Providing the values above, the cluster will have 3 primarys and, each primary, will have 2 replicas.
|
||||
|
||||
> NOTE: By default `cluster.init` will be set to `true` in order to initialize the Valkey Cluster in the first installation. If for testing purposes you only want to deploy or upgrade the nodes but avoiding the creation of the cluster you can set `cluster.init` to `false`.
|
||||
|
||||
@@ -148,7 +148,7 @@ Note we are providing the new IPs at `cluster.update.newExternalIPs`, the flag `
|
||||
|
||||
To scale down the Valkey Cluster, follow these steps:
|
||||
|
||||
First perform a normal upgrade setting the `cluster.nodes` value to the desired number of nodes. It should not be less than `6` and the difference between current number of nodes and the desired should be less or equal to `cluster.replicas` to avoid removing master node an its slaves at the same time. Also it is needed to provide the password using the `password`. For example, having more than 6 nodes, to scale down the cluster to 6 nodes:
|
||||
First perform a normal upgrade setting the `cluster.nodes` value to the desired number of nodes. It should not be less than `6` and the difference between current number of nodes and the desired should be less or equal to `cluster.replicas` to avoid removing primary node an its replicas at the same time. Also it is needed to provide the password using the `password`. For example, having more than 6 nodes, to scale down the cluster to 6 nodes:
|
||||
|
||||
```console
|
||||
helm upgrade --timeout 600s <release> --set "password=${VALKEY_PASSWORD},cluster.nodes=6" .
|
||||
@@ -282,7 +282,7 @@ sysctlImage:
|
||||
echo never > /host-sys/kernel/mm/transparent_hugepage/enabled
|
||||
```
|
||||
|
||||
Alternatively, for Kubernetes 1.12+ you can set `podSecurityContext.sysctls` which will configure sysctls for master and slave pods. Example:
|
||||
Alternatively, for Kubernetes 1.12+ you can set `podSecurityContext.sysctls` which will configure sysctls for primary and replica pods. Example:
|
||||
|
||||
```yaml
|
||||
podSecurityContext:
|
||||
@@ -346,7 +346,7 @@ As an alternative, you can use of the preset configurations for pod affinity, po
|
||||
|
||||
By default, the chart mounts a [Persistent Volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) at the `/bitnami` path. The volume is created using dynamic volume provisioning.
|
||||
|
||||
If persistence is disabled, an emptyDir volume is used. **This is only recommended for testing environments** because the required information included in the nodes.conf file is missing. This file contains the relationship between the nodes and the cluster. For example, if any node is down or faulty, when it starts again, it is a self-proclaimed master and also acts as an independent node outside the main cluster as it doesn't have the necessary information to connect to it.
|
||||
If persistence is disabled, an emptyDir volume is used. **This is only recommended for testing environments** because the required information included in the nodes.conf file is missing. This file contains the relationship between the nodes and the cluster. For example, if any node is down or faulty, when it starts again, it is a self-proclaimed primary and also acts as an independent node outside the main cluster as it doesn't have the necessary information to connect to it.
|
||||
|
||||
To reconnect the failed node, run the following:
|
||||
|
||||
@@ -506,7 +506,7 @@ OK
|
||||
| `valkey.initContainers` | Extra init containers to add to the deployment | `[]` |
|
||||
| `valkey.sidecars` | Extra sidecar containers to add to the deployment | `[]` |
|
||||
| `valkey.podLabels` | Additional labels for Valkey pod | `{}` |
|
||||
| `valkey.priorityClassName` | Valkey Master pod priorityClassName | `""` |
|
||||
| `valkey.priorityClassName` | Valkey Primary pod priorityClassName | `""` |
|
||||
| `valkey.defaultConfigOverride` | Optional default Valkey configuration for the nodes | `""` |
|
||||
| `valkey.configmap` | Additional Valkey configuration for the nodes | `""` |
|
||||
| `valkey.extraEnvVars` | An array to add extra environment variables | `[]` |
|
||||
@@ -582,8 +582,8 @@ OK
|
||||
| Name | Description | Value |
|
||||
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -------------- |
|
||||
| `cluster.init` | Enable the initialization of the Valkey Cluster | `true` |
|
||||
| `cluster.nodes` | The number of master nodes should always be >= 3, otherwise cluster creation will fail | `6` |
|
||||
| `cluster.replicas` | Number of replicas for every master in the cluster | `1` |
|
||||
| `cluster.nodes` | The number of primary nodes should always be >= 3, otherwise cluster creation will fail | `6` |
|
||||
| `cluster.replicas` | Number of replicas for every primary in the cluster | `1` |
|
||||
| `cluster.externalAccess.enabled` | Enable access to the Valkey | `false` |
|
||||
| `cluster.externalAccess.hostMode` | Set cluster preferred endpoint type as hostname | `false` |
|
||||
| `cluster.externalAccess.service.disableLoadBalancerIP` | Disable use of `Service.spec.loadBalancerIP` | `false` |
|
||||
@@ -694,6 +694,19 @@ helm install my-release -f values.yaml oci://REGISTRY_NAME/REPOSITORY_NAME/valke
|
||||
|
||||
Find more information about how to deal with common errors related to Bitnami's Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues).
|
||||
|
||||
## Upgrading
|
||||
|
||||
### To 2.0.0
|
||||
|
||||
This major updates all the references from `master/slave` to `primary/replica` to follow the upstream project strategy:
|
||||
|
||||
- The term *master* has been replaced by the term *primary*. Therefore, parameters prefixed with `master` are now prefixed with `primary`.
|
||||
- Environment variables previously prefixed as `VALKEY_MASTER` or `VALKEY_SENTINEL_MASTER` use `VALKEY_PRIMARY` and `VALKEY_SENTINEL_PRIMARY` now.
|
||||
|
||||
Consequences:
|
||||
|
||||
Backwards compatibility is not guaranteed. To upgrade to `2.0.0`, install a new release of the Valkey chart, and migrate the data from your previous release. You have to create a backup of the database, and restore it on the new release as explained in the [Backup and restore](#backup-and-restore) section.
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2024 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
||||
|
||||
@@ -106,7 +106,7 @@ data:
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
bind 127.0.0.1 -::1
|
||||
|
||||
# By default, outgoing connections (from replica to master, from Sentinel to
|
||||
# By default, outgoing connections (from replica to primary, from Sentinel to
|
||||
# instances, cluster bus, etc.) are not bound to a specific local address. In
|
||||
# most cases, this means the operating system will handle that based on routing
|
||||
# and the interface through which the connection goes out.
|
||||
@@ -214,7 +214,7 @@ data:
|
||||
# tls-port 6379
|
||||
|
||||
# Configure a X.509 certificate and private key to use for authenticating the
|
||||
# server to connected clients, masters or cluster peers. These files should be
|
||||
# server to connected clients, primarys or cluster peers. These files should be
|
||||
# PEM formatted.
|
||||
#
|
||||
# tls-cert-file valkey.crt
|
||||
@@ -226,7 +226,7 @@ data:
|
||||
# tls-key-file-pass secret
|
||||
|
||||
# Normally Valkey uses the same certificate for both server functions (accepting
|
||||
# connections) and client functions (replicating from a master, establishing
|
||||
# connections) and client functions (replicating from a primary, establishing
|
||||
# cluster bus connections, etc.).
|
||||
#
|
||||
# Sometimes certificates are issued with attributes that designate them as
|
||||
@@ -266,7 +266,7 @@ data:
|
||||
# tls-auth-clients optional
|
||||
|
||||
# By default, a Valkey replica does not attempt to establish a TLS connection
|
||||
# with its master.
|
||||
# with its primary.
|
||||
#
|
||||
# Use the following directive to enable TLS on replication links.
|
||||
#
|
||||
@@ -488,7 +488,7 @@ data:
|
||||
# no - Never perform full sanitization
|
||||
# yes - Always perform full sanitization
|
||||
# clients - Perform full sanitization only for user connections.
|
||||
# Excludes: RDB files, RESTORE commands received from the master
|
||||
# Excludes: RDB files, RESTORE commands received from the primary
|
||||
# connection, and client connections which have the
|
||||
# skip-sanitize-payload ACL flag.
|
||||
# The default should be 'clients' but since it currently affects cluster
|
||||
@@ -502,13 +502,13 @@ data:
|
||||
# Remove RDB files used by replication in instances without persistence
|
||||
# enabled. By default this option is disabled, however there are environments
|
||||
# where for regulations or other security concerns, RDB files persisted on
|
||||
# disk by masters in order to feed replicas, or stored on disk by replicas
|
||||
# disk by primarys in order to feed replicas, or stored on disk by replicas
|
||||
# in order to load them for the initial synchronization, should be deleted
|
||||
# ASAP. Note that this option ONLY WORKS in instances that have both AOF
|
||||
# and RDB persistence disabled, otherwise is completely ignored.
|
||||
#
|
||||
# An alternative (and sometimes better) way to obtain the same effect is
|
||||
# to use diskless replication on both master and replicas instances. However
|
||||
# to use diskless replication on both primary and replicas instances. However
|
||||
# in the case of replicas, diskless is not always an option.
|
||||
rdb-del-sync-files no
|
||||
|
||||
@@ -524,46 +524,46 @@ data:
|
||||
|
||||
################################# REPLICATION #################################
|
||||
|
||||
# Master-Replica replication. Use replicaof to make a Valkey instance a copy of
|
||||
# Primary-Replica replication. Use replicaof to make a Valkey instance a copy of
|
||||
# another Valkey server. A few things to understand ASAP about Valkey replication.
|
||||
#
|
||||
# +------------------+ +---------------+
|
||||
# | Master | ---> | Replica |
|
||||
# | Primary | ---> | Replica |
|
||||
# | (receive writes) | | (exact copy) |
|
||||
# +------------------+ +---------------+
|
||||
#
|
||||
# 1) Valkey replication is asynchronous, but you can configure a master to
|
||||
# 1) Valkey replication is asynchronous, but you can configure a primary to
|
||||
# stop accepting writes if it appears to be not connected with at least
|
||||
# a given number of replicas.
|
||||
# 2) Valkey replicas are able to perform a partial resynchronization with the
|
||||
# master if the replication link is lost for a relatively small amount of
|
||||
# primary if the replication link is lost for a relatively small amount of
|
||||
# time. You may want to configure the replication backlog size (see the next
|
||||
# sections of this file) with a sensible value depending on your needs.
|
||||
# 3) Replication is automatic and does not need user intervention. After a
|
||||
# network partition replicas automatically try to reconnect to masters
|
||||
# network partition replicas automatically try to reconnect to primarys
|
||||
# and resynchronize with them.
|
||||
#
|
||||
# replicaof <masterip> <masterport>
|
||||
# replicaof <primaryip> <primaryport>
|
||||
|
||||
# If the master is password protected (using the "requirepass" configuration
|
||||
# If the primary is password protected (using the "requirepass" configuration
|
||||
# directive below) it is possible to tell the replica to authenticate before
|
||||
# starting the replication synchronization process, otherwise the master will
|
||||
# starting the replication synchronization process, otherwise the primary will
|
||||
# refuse the replica request.
|
||||
#
|
||||
# masterauth <master-password>
|
||||
# primaryauth <primary-password>
|
||||
#
|
||||
# However this is not enough if you are using Valkey ACLs (for Valkey version
|
||||
# 6 or greater), and the default user is not capable of running the PSYNC
|
||||
# command and/or other commands needed for replication. In this case it's
|
||||
# better to configure a special user to use with replication, and specify the
|
||||
# masteruser configuration as such:
|
||||
# primaryuser configuration as such:
|
||||
#
|
||||
# masteruser <username>
|
||||
# primaryuser <username>
|
||||
#
|
||||
# When masteruser is specified, the replica will authenticate against its
|
||||
# master using the new AUTH form: AUTH <username> <password>.
|
||||
# When primaryuser is specified, the replica will authenticate against its
|
||||
# primary using the new AUTH form: AUTH <username> <password>.
|
||||
|
||||
# When a replica loses its connection with the master, or when the replication
|
||||
# When a replica loses its connection with the primary, or when the replication
|
||||
# is still in progress, the replica can act in two different ways:
|
||||
#
|
||||
# 1) if replica-serve-stale-data is set to 'yes' (the default) the replica will
|
||||
@@ -581,7 +581,7 @@ data:
|
||||
|
||||
# You can configure a replica instance to accept writes or not. Writing against
|
||||
# a replica instance may be useful to store some ephemeral data (because data
|
||||
# written on a replica will be easily deleted after resync with the master) but
|
||||
# written on a replica will be easily deleted after resync with the primary) but
|
||||
# may also cause problems if clients are writing to it because of a
|
||||
# misconfiguration.
|
||||
#
|
||||
@@ -599,15 +599,15 @@ data:
|
||||
#
|
||||
# New replicas and reconnecting replicas that are not able to continue the
|
||||
# replication process just receiving differences, need to do what is called a
|
||||
# "full synchronization". An RDB file is transmitted from the master to the
|
||||
# "full synchronization". An RDB file is transmitted from the primary to the
|
||||
# replicas.
|
||||
#
|
||||
# The transmission can happen in two different ways:
|
||||
#
|
||||
# 1) Disk-backed: The Valkey master creates a new process that writes the RDB
|
||||
# 1) Disk-backed: The Valkey primary creates a new process that writes the RDB
|
||||
# file on disk. Later the file is transferred by the parent
|
||||
# process to the replicas incrementally.
|
||||
# 2) Diskless: The Valkey master creates a new process that directly writes the
|
||||
# 2) Diskless: The Valkey primary creates a new process that directly writes the
|
||||
# RDB file to replica sockets, without touching the disk at all.
|
||||
#
|
||||
# With disk-backed replication, while the RDB file is generated, more replicas
|
||||
@@ -616,7 +616,7 @@ data:
|
||||
# once the transfer starts, new replicas arriving will be queued and a new
|
||||
# transfer will start when the current one terminates.
|
||||
#
|
||||
# When diskless replication is used, the master waits a configurable amount of
|
||||
# When diskless replication is used, the primary waits a configurable amount of
|
||||
# time (in seconds) before starting the transfer in the hope that multiple
|
||||
# replicas will arrive and the transfer can be parallelized.
|
||||
#
|
||||
@@ -647,15 +647,15 @@ data:
|
||||
# does not immediately store an RDB on disk, it may cause data loss during
|
||||
# failovers. RDB diskless load + Valkey modules not handling I/O reads may also
|
||||
# cause Valkey to abort in case of I/O errors during the initial synchronization
|
||||
# stage with the master. Use only if you know what you are doing.
|
||||
# stage with the primary. Use only if you know what you are doing.
|
||||
# -----------------------------------------------------------------------------
|
||||
#
|
||||
# Replica can load the RDB it reads from the replication link directly from the
|
||||
# socket, or store the RDB to a file and read that file after it was completely
|
||||
# received from the master.
|
||||
# received from the primary.
|
||||
#
|
||||
# In many cases the disk is slower than the network, and storing and loading
|
||||
# the RDB file may increase replication time (and even increase the master's
|
||||
# the RDB file may increase replication time (and even increase the primary's
|
||||
# Copy on Write memory and replica buffers).
|
||||
# However, parsing the RDB file directly from the socket may mean that we have
|
||||
# to flush the contents of the current database before the full rdb was
|
||||
@@ -666,13 +666,13 @@ data:
|
||||
# "swapdb" - Keep current db contents in RAM while parsing the data directly
|
||||
# from the socket. Replicas in this mode can keep serving current
|
||||
# data set while replication is in progress, except for cases where
|
||||
# they can't recognize master as having a data set from same
|
||||
# they can't recognize primary as having a data set from same
|
||||
# replication history.
|
||||
# Note that this requires sufficient memory, if you don't have it,
|
||||
# you risk an OOM kill.
|
||||
repl-diskless-load disabled
|
||||
|
||||
# Master send PINGs to its replicas in a predefined interval. It's possible to
|
||||
# Primary send PINGs to its replicas in a predefined interval. It's possible to
|
||||
# change this interval with the repl_ping_replica_period option. The default
|
||||
# value is 10 seconds.
|
||||
#
|
||||
@@ -681,12 +681,12 @@ data:
|
||||
# The following option sets the replication timeout for:
|
||||
#
|
||||
# 1) Bulk transfer I/O during SYNC, from the point of view of replica.
|
||||
# 2) Master timeout from the point of view of replicas (data, pings).
|
||||
# 3) Replica timeout from the point of view of masters (REPLCONF ACK pings).
|
||||
# 2) Primary timeout from the point of view of replicas (data, pings).
|
||||
# 3) Replica timeout from the point of view of primary nodes (REPLCONF ACK pings).
|
||||
#
|
||||
# It is important to make sure that this value is greater than the value
|
||||
# specified for repl-ping-replica-period otherwise a timeout will be detected
|
||||
# every time there is low traffic between the master and the replica. The default
|
||||
# every time there is low traffic between the primary and the replica. The default
|
||||
# value is 60 seconds.
|
||||
#
|
||||
# repl-timeout 60
|
||||
@@ -702,7 +702,7 @@ data:
|
||||
# be reduced but more bandwidth will be used for replication.
|
||||
#
|
||||
# By default we optimize for low latency, but in very high traffic conditions
|
||||
# or when the master and replicas are many hops away, turning this to "yes" may
|
||||
# or when the primary and replicas are many hops away, turning this to "yes" may
|
||||
# be a good idea.
|
||||
repl-disable-tcp-nodelay no
|
||||
|
||||
@@ -719,13 +719,13 @@ data:
|
||||
#
|
||||
# repl-backlog-size 1mb
|
||||
|
||||
# After a master has no connected replicas for some time, the backlog will be
|
||||
# After a primary has no connected replicas for some time, the backlog will be
|
||||
# freed. The following option configures the amount of seconds that need to
|
||||
# elapse, starting from the time the last replica disconnected, for the backlog
|
||||
# buffer to be freed.
|
||||
#
|
||||
# Note that replicas never free the backlog for timeout, since they may be
|
||||
# promoted to masters later, and should be able to correctly "partially
|
||||
# promoted to primarys later, and should be able to correctly "partially
|
||||
# resynchronize" with other replicas: hence they should always accumulate backlog.
|
||||
#
|
||||
# A value of 0 means to never release the backlog.
|
||||
@@ -734,21 +734,21 @@ data:
|
||||
|
||||
# The replica priority is an integer number published by Valkey in the INFO
|
||||
# output. It is used by Valkey Sentinel in order to select a replica to promote
|
||||
# into a master if the master is no longer working correctly.
|
||||
# into a primary if the primary is no longer working correctly.
|
||||
#
|
||||
# A replica with a low priority number is considered better for promotion, so
|
||||
# for instance if there are three replicas with priority 10, 100, 25 Sentinel
|
||||
# will pick the one with priority 10, that is the lowest.
|
||||
#
|
||||
# However a special priority of 0 marks the replica as not able to perform the
|
||||
# role of master, so a replica with priority of 0 will never be selected by
|
||||
# role of primary, so a replica with priority of 0 will never be selected by
|
||||
# Valkey Sentinel for promotion.
|
||||
#
|
||||
# By default the priority is 100.
|
||||
replica-priority 100
|
||||
|
||||
# The propagation error behavior controls how Valkey will behave when it is
|
||||
# unable to handle a command being processed in the replication stream from a master
|
||||
# unable to handle a command being processed in the replication stream from a primary
|
||||
# or processed while reading from an AOF file. Errors that occur during propagation
|
||||
# are unexpected, and can cause data inconsistency. However, there are edge cases
|
||||
# in earlier versions of Valkey where it was possible for the server to replicate or persist
|
||||
@@ -764,27 +764,27 @@ data:
|
||||
# propagation-error-behavior ignore
|
||||
|
||||
# Replica ignore disk write errors controls the behavior of a replica when it is
|
||||
# unable to persist a write command received from its master to disk. By default,
|
||||
# unable to persist a write command received from its primary to disk. By default,
|
||||
# this configuration is set to 'no' and will crash the replica in this condition.
|
||||
# It is not recommended to change this default, however in order to be compatible
|
||||
# with older versions of Valkey this config can be toggled to 'yes' which will just
|
||||
# log a warning and execute the write command it got from the master.
|
||||
# log a warning and execute the write command it got from the primary.
|
||||
#
|
||||
# replica-ignore-disk-write-errors no
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# By default, Valkey Sentinel includes all replicas in its reports. A replica
|
||||
# can be excluded from Valkey Sentinel's announcements. An unannounced replica
|
||||
# will be ignored by the 'sentinel replicas <master>' command and won't be
|
||||
# will be ignored by the 'sentinel replicas <primary>' command and won't be
|
||||
# exposed to Valkey Sentinel's clients.
|
||||
#
|
||||
# This option does not change the behavior of replica-priority. Even with
|
||||
# replica-announced set to 'no', the replica can be promoted to master. To
|
||||
# replica-announced set to 'no', the replica can be promoted to primary. To
|
||||
# prevent this behavior, set replica-priority to 0.
|
||||
#
|
||||
# replica-announced yes
|
||||
|
||||
# It is possible for a master to stop accepting writes if there are less than
|
||||
# It is possible for a primary to stop accepting writes if there are less than
|
||||
# N replicas connected, having a lag less or equal than M seconds.
|
||||
#
|
||||
# The N replicas need to be in "online" state.
|
||||
@@ -806,18 +806,18 @@ data:
|
||||
# By default min-replicas-to-write is set to 0 (feature disabled) and
|
||||
# min-replicas-max-lag is set to 10.
|
||||
|
||||
# A Valkey master is able to list the address and port of the attached
|
||||
# A Valkey primary is able to list the address and port of the attached
|
||||
# replicas in different ways. For example the "INFO replication" section
|
||||
# offers this information, which is used, among other tools, by
|
||||
# Valkey Sentinel in order to discover replica instances.
|
||||
# Another place where this info is available is in the output of the
|
||||
# "ROLE" command of a master.
|
||||
# "ROLE" command of a primary.
|
||||
#
|
||||
# The listed IP address and port normally reported by a replica is
|
||||
# obtained in the following way:
|
||||
#
|
||||
# IP: The address is auto detected by checking the peer address
|
||||
# of the socket used by the replica to connect with the master.
|
||||
# of the socket used by the replica to connect with the primary.
|
||||
#
|
||||
# Port: The port is communicated by the replica during the replication
|
||||
# handshake, and is normally the port that the replica is using to
|
||||
@@ -826,7 +826,7 @@ data:
|
||||
# However when port forwarding or Network Address Translation (NAT) is
|
||||
# used, the replica may actually be reachable via different IP and port
|
||||
# pairs. The following two options can be used by a replica in order to
|
||||
# report to its master a specific set of IP and port, so that both INFO
|
||||
# report to its primary a specific set of IP and port, so that both INFO
|
||||
# and ROLE will report those values.
|
||||
#
|
||||
# There is no need to use both the options if you need to override just
|
||||
@@ -1180,11 +1180,11 @@ data:
|
||||
# maxmemory-eviction-tenacity 10
|
||||
|
||||
# By default a replica will ignore its maxmemory setting
|
||||
# (unless it is promoted to master after a failover or manually). It means
|
||||
# that the eviction of keys will be just handled by the master, sending the
|
||||
# DEL commands to the replica as keys evict in the master side.
|
||||
# (unless it is promoted to primary after a failover or manually). It means
|
||||
# that the eviction of keys will be just handled by the primary, sending the
|
||||
# DEL commands to the replica as keys evict in the primary side.
|
||||
#
|
||||
# This behavior ensures that masters and replicas stay consistent, and is usually
|
||||
# This behavior ensures that primarys and replicas stay consistent, and is usually
|
||||
# what you want, however if your replica is writable, or you want the replica
|
||||
# to have a different memory setting, and you are sure all the writes performed
|
||||
# to the replica are idempotent, then you may change this default (but be sure
|
||||
@@ -1195,7 +1195,7 @@ data:
|
||||
# be larger on the replica, or data structures may sometimes take more memory
|
||||
# and so forth). So make sure you monitor your replicas and make sure they
|
||||
# have enough memory to never hit a real out-of-memory condition before the
|
||||
# master hits the configured maxmemory setting.
|
||||
# primary hits the configured maxmemory setting.
|
||||
#
|
||||
# replica-ignore-maxmemory yes
|
||||
|
||||
@@ -1252,7 +1252,7 @@ data:
|
||||
# itself removes any old content of the specified key in order to replace
|
||||
# it with the specified string.
|
||||
# 4) During replication, when a replica performs a full resynchronization with
|
||||
# its master, the content of the whole database is removed in order to
|
||||
# its primary, the content of the whole database is removed in order to
|
||||
# load the RDB file just transferred.
|
||||
#
|
||||
# In all the above cases the default is to delete objects in a blocking way,
|
||||
@@ -1333,7 +1333,7 @@ data:
|
||||
# Enabling this feature makes Valkey actively control the oom_score_adj value
|
||||
# for all its processes, depending on their role. The default scores will
|
||||
# attempt to have background child processes killed before all others, and
|
||||
# replicas killed before masters.
|
||||
# replicas killed before primarys.
|
||||
#
|
||||
# Valkey supports these options:
|
||||
#
|
||||
@@ -1347,7 +1347,7 @@ data:
|
||||
oom-score-adj no
|
||||
|
||||
# When oom-score-adj is used, this directive controls the specific values used
|
||||
# for master, replica and background child processes. Values range -2000 to
|
||||
# for primary, replica and background child processes. Values range -2000 to
|
||||
# 2000 (higher means more likely to be killed).
|
||||
#
|
||||
# Unprivileged processes (not root, and without CAP_SYS_RESOURCE capabilities)
|
||||
@@ -1528,7 +1528,7 @@ data:
|
||||
# Maximum time to wait for replicas when shutting down, in seconds.
|
||||
#
|
||||
# During shut down, a grace period allows any lagging replicas to catch up with
|
||||
# the latest replication offset before the master exists. This period can
|
||||
# the latest replication offset before the primary exists. This period can
|
||||
# prevent data loss, especially for deployments without configured disk backups.
|
||||
#
|
||||
# The 'shutdown-timeout' value is the grace period's duration in seconds. It is
|
||||
@@ -1604,7 +1604,7 @@ data:
|
||||
# you to specify the cluster bus port when executing cluster meet.
|
||||
# cluster-port 0
|
||||
|
||||
# A replica of a failing master will avoid to start a failover if its data
|
||||
# A replica of a failing primary will avoid to start a failover if its data
|
||||
# looks too old.
|
||||
#
|
||||
# There is no simple way for a replica to actually have an exact measure of
|
||||
@@ -1612,35 +1612,35 @@ data:
|
||||
#
|
||||
# 1) If there are multiple replicas able to failover, they exchange messages
|
||||
# in order to try to give an advantage to the replica with the best
|
||||
# replication offset (more data from the master processed).
|
||||
# replication offset (more data from the primary processed).
|
||||
# Replicas will try to get their rank by offset, and apply to the start
|
||||
# of the failover a delay proportional to their rank.
|
||||
#
|
||||
# 2) Every single replica computes the time of the last interaction with
|
||||
# its master. This can be the last ping or command received (if the master
|
||||
# its primary. This can be the last ping or command received (if the primary
|
||||
# is still in the "connected" state), or the time that elapsed since the
|
||||
# disconnection with the master (if the replication link is currently down).
|
||||
# disconnection with the primary (if the replication link is currently down).
|
||||
# If the last interaction is too old, the replica will not try to failover
|
||||
# at all.
|
||||
#
|
||||
# The point "2" can be tuned by user. Specifically a replica will not perform
|
||||
# the failover if, since the last interaction with the master, the time
|
||||
# the failover if, since the last interaction with the primary, the time
|
||||
# elapsed is greater than:
|
||||
#
|
||||
# (node-timeout * cluster-replica-validity-factor) + repl-ping-replica-period
|
||||
#
|
||||
# So for example if node-timeout is 30 seconds, and the cluster-replica-validity-factor
|
||||
# is 10, and assuming a default repl-ping-replica-period of 10 seconds, the
|
||||
# replica will not try to failover if it was not able to talk with the master
|
||||
# replica will not try to failover if it was not able to talk with the primary
|
||||
# for longer than 310 seconds.
|
||||
#
|
||||
# A large cluster-replica-validity-factor may allow replicas with too old data to failover
|
||||
# a master, while a too small value may prevent the cluster from being able to
|
||||
# a primary, while a too small value may prevent the cluster from being able to
|
||||
# elect a replica at all.
|
||||
#
|
||||
# For maximum availability, it is possible to set the cluster-replica-validity-factor
|
||||
# to a value of 0, which means, that replicas will always try to failover the
|
||||
# master regardless of the last time they interacted with the master.
|
||||
# primary regardless of the last time they interacted with the primary.
|
||||
# (However they'll always try to apply a delay proportional to their
|
||||
# offset rank).
|
||||
#
|
||||
@@ -1649,19 +1649,19 @@ data:
|
||||
#
|
||||
# cluster-replica-validity-factor 10
|
||||
|
||||
# Cluster replicas are able to migrate to orphaned masters, that are masters
|
||||
# Cluster replicas are able to migrate to orphaned primarys, that are primarys
|
||||
# that are left without working replicas. This improves the cluster ability
|
||||
# to resist to failures as otherwise an orphaned master can't be failed over
|
||||
# to resist to failures as otherwise an orphaned primary can't be failed over
|
||||
# in case of failure if it has no working replicas.
|
||||
#
|
||||
# Replicas migrate to orphaned masters only if there are still at least a
|
||||
# given number of other working replicas for their old master. This number
|
||||
# Replicas migrate to orphaned primarys only if there are still at least a
|
||||
# given number of other working replicas for their old primary. This number
|
||||
# is the "migration barrier". A migration barrier of 1 means that a replica
|
||||
# will migrate only if there is at least 1 other working replica for its master
|
||||
# will migrate only if there is at least 1 other working replica for its primary
|
||||
# and so forth. It usually reflects the number of replicas you want for every
|
||||
# master in your cluster.
|
||||
# primary in your cluster.
|
||||
#
|
||||
# Default is 1 (replicas migrate only if their masters remain with at least
|
||||
# Default is 1 (replicas migrate only if their primarys remain with at least
|
||||
# one replica). To disable migration just set it to a very large value or
|
||||
# set cluster-allow-replica-migration to 'no'.
|
||||
# A value of 0 can be set but is useful only for debugging and dangerous
|
||||
@@ -1670,7 +1670,7 @@ data:
|
||||
# cluster-migration-barrier 1
|
||||
|
||||
# Turning off this option allows to use less automatic cluster configuration.
|
||||
# It both disables migration to orphaned masters and migration from masters
|
||||
# It both disables migration to orphaned primarys and migration from primarys
|
||||
# that became empty.
|
||||
#
|
||||
# Default is 'yes' (allow automatic migrations).
|
||||
@@ -1691,7 +1691,7 @@ data:
|
||||
# cluster-require-full-coverage yes
|
||||
|
||||
# This option, when set to yes, prevents replicas from trying to failover its
|
||||
# master during master failures. However the replica can still perform a
|
||||
# primary during primary failures. However the replica can still perform a
|
||||
# manual failover, if forced to do so.
|
||||
#
|
||||
# This is useful in different scenarios, especially in the case of multiple
|
||||
@@ -1710,9 +1710,9 @@ data:
|
||||
#
|
||||
# The second use case is for configurations that don't meet the recommended
|
||||
# three shards but want to enable cluster mode and scale later. A
|
||||
# master outage in a 1 or 2 shard configuration causes a read/write outage to the
|
||||
# primary outage in a 1 or 2 shard configuration causes a read/write outage to the
|
||||
# entire cluster without this option set, with it set there is only a write outage.
|
||||
# Without a quorum of masters, slot ownership will not change automatically.
|
||||
# Without a quorum of primarys, slot ownership will not change automatically.
|
||||
#
|
||||
# cluster-allow-reads-when-down no
|
||||
|
||||
|
||||
@@ -95,14 +95,14 @@ spec:
|
||||
echo "Node $nodeIP not ready, waiting for all the nodes to be ready..."
|
||||
sleep 5
|
||||
done
|
||||
slave=()
|
||||
replica=()
|
||||
if (( $VALKEY_CLUSTER_REPLICAS >= 1 )) && (( newNodeCounter % (( $VALKEY_CLUSTER_REPLICAS + 1 )) )); then
|
||||
slave+=("--cluster-slave")
|
||||
replica+=("--cluster-slave")
|
||||
fi
|
||||
{{- if .Values.tls.enabled }}
|
||||
while ! valkey-cli --cluster --tls --cert ${VALKEY_TLS_CERT_FILE} --key ${VALKEY_TLS_KEY_FILE} --cacert ${VALKEY_TLS_CA_FILE} add-node "${nodeIP}:${VALKEY_TLS_PORT_NUMBER}" "{{ index .Values.cluster.externalAccess.service.loadBalancerIP 0 }}:${VALKEY_TLS_PORT_NUMBER}" ${slave[@]}; do
|
||||
while ! valkey-cli --cluster --tls --cert ${VALKEY_TLS_CERT_FILE} --key ${VALKEY_TLS_KEY_FILE} --cacert ${VALKEY_TLS_CA_FILE} add-node "${nodeIP}:${VALKEY_TLS_PORT_NUMBER}" "{{ index .Values.cluster.externalAccess.service.loadBalancerIP 0 }}:${VALKEY_TLS_PORT_NUMBER}" ${replica[@]}; do
|
||||
{{- else }}
|
||||
while ! valkey-cli --cluster add-node "${nodeIP}:${VALKEY_PORT_NUMBER}" "{{ index .Values.cluster.externalAccess.service.loadBalancerIP 0 }}:${VALKEY_PORT_NUMBER}" ${slave[@]}; do
|
||||
while ! valkey-cli --cluster add-node "${nodeIP}:${VALKEY_PORT_NUMBER}" "{{ index .Values.cluster.externalAccess.service.loadBalancerIP 0 }}:${VALKEY_PORT_NUMBER}" ${replica[@]}; do
|
||||
{{- end }}
|
||||
echo "Add-node ${newNodeIndex} ${newNodeIP} failed, retrying"
|
||||
sleep 5
|
||||
@@ -125,10 +125,10 @@ spec:
|
||||
done
|
||||
|
||||
{{- else }}
|
||||
# number of currently deployed valkey master nodes
|
||||
currentMasterNodesNum="$(( {{ .Values.cluster.update.currentNumberOfNodes }} / (( {{ .Values.cluster.update.currentNumberOfReplicas }} + 1 )) ))"
|
||||
# end postion of new replicas that should be assigned to original valkey master nodes
|
||||
slaveNodesEndPos="$(( {{ .Values.cluster.update.currentNumberOfNodes }} + (($VALKEY_CLUSTER_REPLICAS - {{ .Values.cluster.update.currentNumberOfReplicas }})) * $currentMasterNodesNum ))"
|
||||
# number of currently deployed valkey primary nodes
|
||||
currentPrimaryNodesNum="$(( {{ .Values.cluster.update.currentNumberOfNodes }} / (( {{ .Values.cluster.update.currentNumberOfReplicas }} + 1 )) ))"
|
||||
# end postion of new replicas that should be assigned to original valkey primary nodes
|
||||
replicaNodesEndPos="$(( {{ .Values.cluster.update.currentNumberOfNodes }} + (($VALKEY_CLUSTER_REPLICAS - {{ .Values.cluster.update.currentNumberOfReplicas }})) * $currentPrimaryNodesNum ))"
|
||||
for node in $(seq $((1+{{ .Values.cluster.update.currentNumberOfNodes }})) {{ .Values.cluster.nodes }}); do
|
||||
newNodeIndex="$(($node - 1))"
|
||||
newNodeIP=$(wait_for_dns_lookup "{{ template "common.names.fullname" . }}-${newNodeIndex}.{{ template "common.names.fullname" . }}-headless" 120 5)
|
||||
@@ -141,16 +141,16 @@ spec:
|
||||
newNodeIP=$(wait_for_dns_lookup "{{ template "common.names.fullname" . }}-${newNodeIndex}.{{ template "common.names.fullname" . }}-headless" 120 5)
|
||||
sleep 5
|
||||
done
|
||||
slave=()
|
||||
# when the index of the new node is less than `slaveNodesEndPos`,the added node is a replica that assigned to original valkey master node
|
||||
# when the index of the new node is greater than or equal to `slaveNodesEndPos`,and it is not a multiple of `$VALKEY_CLUSTER_REPLICAS + 1`, the added node is a replica that assigned to newly added master node
|
||||
if (( $VALKEY_CLUSTER_REPLICAS >= 1 )) && (( (( $newNodeIndex < $slaveNodesEndPos )) || (( (( $newNodeIndex >= $slaveNodesEndPos )) && (( $newNodeIndex % (( $VALKEY_CLUSTER_REPLICAS + 1 )) )) )) )); then
|
||||
slave+=("--cluster-slave")
|
||||
replica=()
|
||||
# when the index of the new node is less than `replicaNodesEndPos`,the added node is a replica that assigned to original valkey primary node
|
||||
# when the index of the new node is greater than or equal to `replicaNodesEndPos`,and it is not a multiple of `$VALKEY_CLUSTER_REPLICAS + 1`, the added node is a replica that assigned to newly added primary node
|
||||
if (( $VALKEY_CLUSTER_REPLICAS >= 1 )) && (( (( $newNodeIndex < $replicaNodesEndPos )) || (( (( $newNodeIndex >= $replicaNodesEndPos )) && (( $newNodeIndex % (( $VALKEY_CLUSTER_REPLICAS + 1 )) )) )) )); then
|
||||
replica+=("--cluster-slave")
|
||||
fi
|
||||
{{- if .Values.tls.enabled }}
|
||||
while ! valkey-cli --cluster add-node --tls --cert ${VALKEY_TLS_CERT_FILE} --key ${VALKEY_TLS_KEY_FILE} --cacert ${VALKEY_TLS_CA_FILE} "${newNodeIP}:${VALKEY_TLS_PORT_NUMBER}" "${firstNodeIP}:${VALKEY_TLS_PORT_NUMBER}" ${slave[@]}; do
|
||||
while ! valkey-cli --cluster add-node --tls --cert ${VALKEY_TLS_CERT_FILE} --key ${VALKEY_TLS_KEY_FILE} --cacert ${VALKEY_TLS_CA_FILE} "${newNodeIP}:${VALKEY_TLS_PORT_NUMBER}" "${firstNodeIP}:${VALKEY_TLS_PORT_NUMBER}" ${replica[@]}; do
|
||||
{{- else }}
|
||||
while ! valkey-cli --cluster add-node "${newNodeIP}:${VALKEY_PORT_NUMBER}" "${firstNodeIP}:${VALKEY_PORT_NUMBER}" ${slave[@]}; do
|
||||
while ! valkey-cli --cluster add-node "${newNodeIP}:${VALKEY_PORT_NUMBER}" "${firstNodeIP}:${VALKEY_PORT_NUMBER}" ${replica[@]}; do
|
||||
{{- end }}
|
||||
echo "Add-node ${newNodeIndex} ${newNodeIP} failed, retrying"
|
||||
sleep 5
|
||||
|
||||
@@ -547,7 +547,7 @@ valkey:
|
||||
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
##
|
||||
podLabels: {}
|
||||
## @param valkey.priorityClassName Valkey Master pod priorityClassName
|
||||
## @param valkey.priorityClassName Valkey Primary pod priorityClassName
|
||||
##
|
||||
priorityClassName: ""
|
||||
## @param valkey.defaultConfigOverride Optional default Valkey configuration for the nodes
|
||||
@@ -830,16 +830,16 @@ cluster:
|
||||
## Number of Valkey nodes to be deployed
|
||||
##
|
||||
## Note:
|
||||
## This is total number of nodes including the replicas. Meaning there will be 3 master and 3 replica
|
||||
## nodes (as replica count is set to 1 by default, there will be 1 replica per master node).
|
||||
## Hence, nodes = numberOfMasterNodes + numberOfMasterNodes * replicas
|
||||
## This is total number of nodes including the replicas. Meaning there will be 3 primary and 3 replica
|
||||
## nodes (as replica count is set to 1 by default, there will be 1 replica per primary node).
|
||||
## Hence, nodes = numberOfPrimaryNodes + numberOfPrimaryNodes * replicas
|
||||
##
|
||||
## @param cluster.nodes The number of master nodes should always be >= 3, otherwise cluster creation will fail
|
||||
## @param cluster.nodes The number of primary nodes should always be >= 3, otherwise cluster creation will fail
|
||||
##
|
||||
nodes: 6
|
||||
## @param cluster.replicas Number of replicas for every master in the cluster
|
||||
## @param cluster.replicas Number of replicas for every primary in the cluster
|
||||
## Parameter to be passed as --cluster-replicas to the valkey-cli --cluster create
|
||||
## 1 means that we want a replica for every master created
|
||||
## 1 means that we want a replica for every primary created
|
||||
##
|
||||
replicas: 1
|
||||
## Configuration to access the Valkey Cluster from outside the Kubernetes cluster
|
||||
|
||||
Reference in New Issue
Block a user