Redis

Gloo Platform deploys Redis as a backing instance for several components, such as the Gloo management server, UI, and Gloo portal server. You can also bring your own instance. For more information, see Backing databases.

Use the following troubleshooting topics to help debug issues with Redis.

Review data in Redis

To review the data that is stored in Redis, you can connect to the Redis instance. If you bring your own Redis, you must use those connection values. For more information, see your Redis provider docs, such as Amazon ElastiCache or Google Cloud Memorystore.

You can use the Redis CLI built into your deployment to review the data in your database.

  1. From your terminal, log in to the Redis pod and open a Redis CLI shell.
    • gloo-mesh-redis instance in the gloo-mesh namespace, which backs the Gloo management server and UI.
      kubectl exec -n gloo-mesh deploy/gloo-mesh-redis -it -- redis-cli
      
    • redis instance in the gloo-mesh-addons namespace, which backs the external auth and portal servers.
      kubectl exec -n gloo-mesh-addons deploy/redis -it -- redis-cli
      
  2. Run Redis CLI commands, such as monitor or keys. For more information, see the Redis docs.
    monitor
    OK
    1681223733.198361 [0 10.xxx.x.x:xxxxx] "zrange" "relation#clusters#list" "0" "-1"
    
    keys *
    1) "aa11a11a-bbb2-3333-dddd-55e5e55555e"
    2) "username@example.com"
    3) "A1BCD2EfG3H45IjKLmNOP6r7tUV8x9/y+ZAbCdeF1g2="
    

RedisInsights is a desktop application that you can install for GUI- and CLI-based interactions. For more information, see the Redis docs.

  1. Download RedisInsights.
  2. Enable port forwarding on the Redis deployment.
    kubectl port-forward -n gloo-mesh-addons deploy/redis 6379
    
  3. Launch the RedisInsights app.
  4. Click + Add Redis Database and enter in your localhost and port details, which by default are 127.0.0.1:6379.
  5. Click the database that you just added.
  6. Use the GUI or CLI to explore the data. For example, you can click the Browser tab (the key icon) and toggle the Key view to explore all of the keys in the database instance, as shown in the following screenshot.

RedisInsights view of all keys in the database

Debug Redis for the Gloo management server

After debugging the management server and agent pods, you might still see error messages related to reconciling state. Gloo stores the state of its resources in a Redis pod. You can try to restart the pod to resolve these reconciliation issues.

  1. Enable port forwarding on port 9091 of the gloo-mesh-mgmt-server pod to your localhost.

    For more information, see the CLI documentation.

    meshctl proxy
    

    Forward port 9091 of the gloo-mesh-mgmt-server pod to your localhost.

    kubectl port-forward -n gloo-mesh deploy/gloo-mesh-mgmt-server 9091
    

  2. Take snapshots of your current state in case you want to refer to the logs later, such as to open a Support issue.

    curl localhost:9091/snapshots/input -o input_snapshot.json 
    curl localhost:9091/snapshots/output -o output_snapshot.json
    
  3. Get the gloo-mesh-redis-* pod.

    kubectl get pods -n gloo-mesh
    

    Example output:

    NAME                                    READY   STATUS    RESTARTS   AGE
    gloo-mesh-mgmt-server-c7cc4dd77-8shdw   1/1     Running   0          4d19h
    gloo-mesh-redis-794d79b7df-28mcr        1/1     Running   0          4d19h
    gloo-mesh-ui-c8cfd5fdd-mdscf            3/3     Running   0          4d19h
    prometheus-server-647b488bb-ns748       2/2     Running   0          4d19h
    
  4. Restart the Redis deployment.

    kubectl rollout restart deployment/gloo-mesh-redis -n gloo-mesh
    
  5. Try checking your Gloo management server or agent logs to see if the reconciliation errors are resolved.