Create Instance

Following Redis versions are fully supported: 5.0, 6.0, 7.2; other versions are not supported by default.

Version suggestion

When used in a production environment, it is recommended to prioritize the 7.2 version, followed by 6.0.

  1. 7.2 is a version still maintained by the community, which fixes known issues in 6.0 and 5.0. The 6.0 and 5.0 versions are no longer maintained by the community.
  2. 7.2 is fully compatible with 6.0 and 5.0.
  3. 7.2 has further improved the ACL features.
  4. 5.0 is not recommended for use as it does not support advanced features like ACL and lacks user management capabilities; all business processes will share a single password, presenting potential security risks; also, changing the password requires restarting all nodes.
Architecture suggestion

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.

TOC

Create Redis Instance

Procedure

Sentinel CLI
Cluster CLI
Standalone CLI
Web Console

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"
EOF

Refer to the Redis API documentation for field descriptions.

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
c5           cluster      5.0       NodePort   Ready                    4.0.1                         2m46s
c6           cluster      6.0                  Initializing             4.0.1                         3m26s
c7           cluster      7.2       NodePort   Initializing             4.0.1                         98s
s5           sentinel     5.0                  Ready                    4.0.1                         3m10s
s6           sentinel     6.0                  Ready                    4.0.1                         25m
s7           sentinel     7.2       NodePort   Ready                    4.0.1                         2m15s
standalone   standalone   6.0                  Initializing             4.0.1                         6s

The meanings of the output table fields are as follows:

FieldDescription
NAMEInstance name
ARCHThis value corresponds to the architecture of Redis.
  • cluster: Cluster mode
  • sentinel: Sentinel mode
  • standalone: Single-node Redis
This field indicates whether this CR resource manages a standalone, Sentinel, or Cluster mode of Redis.
VERSIONCurrently supports only the 3 versions: 5.0, 6.0, 7.2
ACCESSThe access methods supported by the instance.
  • : The instance provides services via ClusterIP
  • NodePort: The instance provides services via NodePort
  • LoadBalancer: The instance provides services via LoadBalancer
STATUSThe current status of the instance, which may include the following states:
  • Initializing: The instance is initializing or updating
  • Rebalancing: The cluster instance is scaling up or down
  • Error: The instance has encountered a non-recoverable error
  • Paused: The instance has been manually paused
  • Ready: The instance is ready
MESSAGEThe reason for the instance being in its current status
BUNDLE VERSIONThe version number of the operator managing the instance
AUTOUPGRADEWhether automatic upgrades are enabled for the instance
AGEHow long ago the instance was created