Create Instance

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

Version suggestion

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

  1. 7.2 and 8.4 are still maintained by the community and fix known issues in 6.0. The 6.0 version is no longer maintained by the community.
  2. 7.2 and 8.4 are fully compatible with 6.0.
  3. 7.2 and 8.4 have further improved the ACL features.
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.

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
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                         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: 6.0, 7.2, 8.4
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