#Create Instance
Following Redis versions are fully supported: 6.0, 7.2, 8.4; other versions are not supported by default.
When used in a production environment, it is recommended to prioritize the 7.2 or 8.4 version, followed by 6.0.
7.2and8.4are still maintained by the community and fix known issues in6.0. The6.0version is no longer maintained by the community.7.2and8.4are fully compatible with6.0.7.2and8.4have further improved the ACL features.
Single-node architecture has no replica nodes and lacks failover capabilities, so it should only be used in development and testing environments. You can choose between Sentinel architecture and Cluster architecture based on your business's data and concurrency needs.
#Create Redis Instance
#Procedure
Create a Redis 6.0 Sentinel mode instance using CLI:
$ cat << EOF | kubectl -n default create -f -
apiVersion: middleware.alauda.io/v1
kind: Redis
metadata:
name: s6
spec:
arch: sentinel
customConfig:
databases: "16"
hz: "10"
save: 60 10000 300 100 600 1
timeout: "0"
exporter:
enabled: true
resources:
limits:
cpu: 100m
memory: 384Mi
requests:
cpu: 50m
memory: 128Mi
replicas:
sentinel:
master: 1
slave: 1
resources:
limits:
cpu: "1"
memory: 2Gi
requests:
cpu: "1"
memory: 2Gi
sentinel:
monitorConfig:
down-after-milliseconds: "30000"
failover-timeout: "180000"
parallel-syncs: "1"
replicas: 3
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
version: "6.0"
EOFRefer to the Redis API documentation for field descriptions.
Create a Redis 6.0 Cluster mode instance using CLI:
$ cat << EOF | kubectl -n default create -f -
apiVersion: middleware.alauda.io/v1
kind: Redis
metadata:
name: c6
spec:
affinityPolicy: AntiAffinityInSharding
arch: cluster
customConfig:
hz: "10"
save: 60 10000 300 100 600 1
timeout: "0"
exporter:
enabled: true
resources:
limits:
cpu: 100m
memory: 384Mi
requests:
cpu: 50m
memory: 128Mi
expose:
type: NodePort
replicas:
cluster:
shard: 3
slave: 1
resources:
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 200m
memory: 200Mi
version: "6.0"
EOFRefer to the Redis API documentation for field descriptions.
Create a Redis 6.0 Standalone mode instance using CLI:
$ cat << EOF | kubectl -n default create -f -
apiVersion: middleware.alauda.io/v1
kind: Redis
metadata:
name: standalone
spec:
arch: standalone
customConfig:
databases: "16"
hz: "10"
save: 60 10000 300 100 600 1
timeout: "0"
exporter:
enabled: true
resources:
limits:
cpu: 100m
memory: 384Mi
requests:
cpu: 50m
memory: 128Mi
replicas:
sentinel:
master: 1
resources:
limits:
cpu: "1"
memory: 1Gi
requests:
cpu: "1"
memory: 1Gi
version: "6.0"
EOFRefer to the Redis API documentation for field descriptions.
-
Enter Alauda Application Services view.
-
In the left navigation bar of Alauda Application Services view, click Redis.
-
Click Namespace name.
-
Click Create Redis Instance.
-
Select an architecture type.
-
Refer to the instructions below to complete the relevant configurations.
Configuration Configuration Item Description Parameter Configuration Parameter Template You can choose between system or custom parameter templates. For custom parameter templates please refer to Parameter Template Management. Connection Configuration Set Default Password It is recommended to set a password for redis defaultuser when startup instance. If no password is set, refer to User Management to reset the password or create extra accounts.Access Method If applications and Redis instances resize in different workload clusters, use external access method. External access method supports LoadBalancerandNodePortwhereLoadBalanceris recommended for production environments. If applications and Redis instances resize in the same workload cluster, use Within the Cluster access method.Specify Host Port When using NodePort for external access, you can specify the service nodeport numbers.
Sentinel Mode: When updating the instance, ports cannot be swapped; if you need to swap ports, update to another unoccupied port first, then re-specify.
Cluster Mode: When updating the instance, if you only need to replace one port, you can re-enter or modify the corresponding node port in YAML.Scheduling Configuration Anti-Affinity Policy To meet the demands for high reliability and high availability under different business scenarios, the platform provides an anti-affinity policy for Cluster Mode, where Force anti-affinity is the default applied anti-affinity policy.
Note: Once the instance is created, this configuration can no longer be modified.Node Labels Filter available nodes in the current cluster through labels. Pods will be scheduled to available nodes.
Note: Once the instance is created, this configuration can no longer be modified.Pod Toleration If available nodes have taints, only Pods with tolerations set will tolerate these taints and may be scheduled to nodes that match the Pod toleration and node taint. The matching rules are as follows. - Equal: When the key, value, and effect that the Pod tolerates match exactly with the node taint settings, the Pod will tolerate the node taint.
- Exists: When the key and effect that the Pod tolerates remain consistent with the node taint settings, the Pod will tolerate the node taint.
Note: The effect determines whether Pods that do not tolerate the node taint will be assigned to the node with the taint. For example, if the effect is NoExecute, only Pods that tolerate the taint (including Pods in this Redis instance) will be scheduled, and already running Pods on the node that do not tolerate the taint will be evicted (Pods from other instances). For more information on matching rules, please refer to the Kubernetes community documentation.The current Web Console does not support creating
standalone(Redis single-node architecture). -
Click Create.
Once the instance status changes to Running, the instance has been successfully created.
After the instance is created, you can use the following command to check the status of the instance:
$ kubectl -n default get redis
NAME ARCH VERSION ACCESS STATUS MESSAGE BUNDLE VERSION AUTOUPGRADE AGE
c6 cluster 6.0 Initializing 4.0.1 3m26s
c7 cluster 7.2 NodePort Initializing 4.0.1 98s
c8 cluster 8.4 NodePort Ready 4.0.1 2m46s
s6 sentinel 6.0 Ready 4.0.1 25m
s7 sentinel 7.2 NodePort Ready 4.0.1 2m15s
s8 sentinel 8.4 Ready 4.0.1 3m10s
standalone standalone 6.0 Initializing 4.0.1 6sThe meanings of the output table fields are as follows:
| Field | Description |
|---|---|
| NAME | Instance name |
| ARCH | This value corresponds to the architecture of Redis.
|
| VERSION | Currently supports only the 3 versions: 6.0, 7.2, 8.4 |
| ACCESS | The access methods supported by the instance.
|
| STATUS | The current status of the instance, which may include the following states:
|
| MESSAGE | The reason for the instance being in its current status |
| BUNDLE VERSION | The version number of the operator managing the instance |
| AUTOUPGRADE | Whether automatic upgrades are enabled for the instance |
| AGE | How long ago the instance was created |