Skip to content

Redis for Opstella Installation

This content is not available in your language yet.

🟢 Management

Redis is a Pub/Sub Service and In-Memory Cache for Opstella

  • 💿Persistence Storage Access for Redis for Opstella
    • On Kubernetes when requesting for a PVC, will request with Storage Class specified.
  1. Connect to 🟢 Management Kubernetes Cluster ; i.e w/ Kubeconfig File

  2. Prepare 🟢 Management Kubernetes Cluster Information

    Ensure K8S_INTERNAL_DOMAIN, K8S_STORAGECLASS_NAME are defined as per the Shell Variables guide.


  1. Set Redis Authentication Password

    Recommended to enabled authentication for Redis (You can optionally disable it)

    export REDIS_PASSWORD="CHANGEME"
  2. Create Redis manifest and secret

    You will be creating Kubernetes Secret named opstella-redis-credentials, RedisReplication CR named redis-opstella, and RedisSentinel CR named redis-sentinel-opstella

    Terminal window
    cat <<EOF > $HOME/opstella-installation/kubernetes-manifests/redis-opstella-platform-full.yaml
    apiVersion: v1
    kind: Secret
    metadata:
    name: opstella-redis-credentials
    namespace: opstella-system
    type: Opaque
    stringData:
    redis-password: "${REDIS_PASSWORD}"
    ---
    apiVersion: redis.redis.opstreelabs.in/v1beta2
    kind: RedisReplication
    metadata:
    name: redis-opstella
    namespace: opstella-system
    spec:
    clusterSize: 3
    podSecurityContext:
    runAsUser: 1000
    fsGroup: 1000
    kubernetesConfig:
    image: quay.io/opstree/redis:v7.4.7
    imagePullPolicy: IfNotPresent
    resources:
    requests:
    cpu: 100m
    memory: 128Mi
    limits:
    cpu: 250m
    memory: 512Mi
    redisSecret:
    name: opstella-redis-credentials
    key: redis-password
    storage:
    volumeClaimTemplate:
    spec:
    storageClassName: "${K8S_STORAGECLASS_NAME}"
    accessModes: ["ReadWriteOnce"]
    resources:
    requests:
    storage: 2Gi
    redisExporter:
    enabled: false
    image: quay.io/opstree/redis-exporter:v1.44.0
    resources:
    requests:
    cpu: 50m
    memory: 64Mi
    limits:
    cpu: 100m
    memory: 128Mi
    ---
    apiVersion: redis.redis.opstreelabs.in/v1beta2
    kind: RedisSentinel
    metadata:
    name: redis-sentinel-opstella
    namespace: opstella-system
    spec:
    clusterSize: 3
    podSecurityContext:
    runAsUser: 1000
    fsGroup: 1000
    redisSentinelConfig:
    redisReplicationName: redis-opstella
    redisReplicationPassword:
    secretKeyRef:
    name: opstella-redis-credentials
    key: redis-password
    masterGroupName: redis-opstella
    downAfterMilliseconds: "10000"
    failoverTimeout: "10000"
    kubernetesConfig:
    image: quay.io/opstree/redis-sentinel:v8.4.0
    imagePullPolicy: IfNotPresent
    resources:
    requests:
    cpu: 50m
    memory: 64Mi
    limits:
    cpu: 100m
    memory: 128Mi
    EOF
  1. Install Redis

    Terminal window
    kubectl apply -n opstella-system -f $HOME/opstella-installation/kubernetes-manifests/redis-opstella-platform-full.yaml
  1. Get Pod Status - Redis for Opstella

    Terminal window
    kubectl get pods -n opstella-system

    Redis for Opstella should be Running

    NAME READY STATUS RESTARTS AGE
    ... (deducted)
    redis-opstella-0 1/1 Running 0 XdXh
    redis-opstella-1 1/1 Running 0 XdXh
    redis-opstella-2 1/1 Running 0 XdXh
    redis-sentinel-opstella-0 1/1 Running 0 XdXh
    redis-sentinel-opstella-1 1/1 Running 0 XdXh
    redis-sentinel-opstella-2 1/1 Running 0 XdXh

Finished?

Use the below navigation to proceed