Redisinsight fails to launch in kubernetes

I have the following .yaml file to install redisgraph in kubernetes.

kind: StorageClass
  name: redisinsight-storage-class
provisioner: ''
  type: 'pd-standard'
apiVersion: v1
kind: PersistentVolumeClaim
  name: redisinsight-volume-claim
  storageClassName: redisinsight-storage-class
    - ReadWriteOnce
      storage: 10Gi
apiVersion: apps/v1
kind: Deployment
  name: redisinsight #deployment name
    app: redisinsight #deployment label
  replicas: 1 #a single replica pod
      app: redisinsight #which pods is the deployment managing, as defined by the pod template
  template: #pod template
        app: redisinsight #label for pod/s
        - name: change-data-dir-ownership
          image: alpine:3.6
            - chmod
            - -R
            - '777'
            - /db
            - name: db
              mountPath: /db
        - name: redisinsight #Container name (DNS_LABEL, unique)
          image: redislabs/redisinsight #repo/image
          imagePullPolicy: Always #Always pull image
            - name: db #Pod volumes to mount into the container's filesystem. Cannot be updated.
              mountPath: /db
            - containerPort: 8001 #exposed conainer port and protocol
              protocol: TCP
        - name: db
            claimName: redisinsight-volume-claim
apiVersion: v1
kind: Service
  name: redisinsight
    - port: 8001
      name: redisinsight
  type: LoadBalancer
    app: redisinsight

But the redisinsight pod does not get launched and gives the following error:

INFO 2020-07-03 06:30:08,117 redisinsight_startup Registered SIGTERM handler
ERROR 2020-07-03 06:30:08,131 redisinsight_startup Error in main()
Traceback (most recent call last):
  File "./", line 477, in main
ValueError: invalid literal for int() with base 10: 'tcp://'
Traceback (most recent call last):
  File "./", line 495, in <module>
  File "./", line 477, in main
ValueError: invalid literal for int() with base 10: 'tcp://'

My guess is that the port number is tried to be read as int but it comes as a string with protocol, ip address and port. I could also be wrong. This seems like a code issue. Or if there is any other ENV variable that I should set, I will be happy to add it. The documentation is inadequate in kubernetes related things. Any help ?

@psankar have you followed the steps to install #RedisInsight on #kubernetes?

Once the deployment has been successfully applied and the deployment complete, access RedisInsight. This can be accomplished by exposing the deployment as a K8s Service or by using port forwarding, as in the example below:

kubectl port-forward deployment/redisinsight 8001

Then you can open your browser and point to http://localhost:8001

The issue only seems to appear when a Service is provisioned to expose the redisinsight endpoint.

You can work around the bug by creating the Deployment first, allowing the redisinsight container to start up, then create the Service. Skipping the script bug.

Super inconvenient if you’re using Helm to deploy since Helm prioritises the creation of Services before Deployments.

Is there is a way to cache node.js application with Redis


what do you mean “cache node.js application”? please elaborate.

You may use redis or ioredis npm packages for node.js and then implement caching logic.

Below is npm packages for caching use cases using Redis:

@aniket Do you mean that you want to use Redis as a cache for a node.js application? If so, yes, you can do this. You can get more information here:

I have doubts service would affect deployments, since service does not manipulate deployment/pod’s environment.

My guess is this caused by some version that you use? You can try using a more stable version (instead of latest):

In addition to asking the question here I asked in stackoverflow and someone has recommended an answer.

வெள்., 18 செப்., 2020, பிற்பகல் 8:09 அன்று, Harry M via Redis Community Forum <> எழுதியது:

1 Like

The problem is with the name of the service. Since there’s a service named “redisinsight”, the new environment variables that is created via the service is passed to the redisinsight pod and there’s an environment variable conflict and so the redisinsight pod is crashing.

RedisInsight’s kubernetes documentation has been updated recently. It clearly describes how to create a RedisInsight k8s deployment with and without a service.

IT also explains what to do when there’s a service named “redisinsight” already:

Note - If the deployment will be exposed by a service whose name is ‘redisinsight’, set REDISINSIGHT_HOST and REDISINSIGHT_PORT environment variables to override the environment variables created by the service.

Please have a look at the documentation.

The error message invalid literal for int() with base 10 would seem to indicate that you are passing a string that’s not an integer to the int() function . In other words it’s either empty, or has a character in it other than a digit. You can solve this error by using Python isdigit() method to check whether the value is number or not. The returns True if all the characters are digits, otherwise False . The other way to overcome this issue is to wrap your code inside a Python try…except block to handle this error.

Sometimes the difference between Python2.x and Python3.x that leads to this ValueError: invalid literal for int() with base 10 . With Python2.x , int(str(3/2)) gives you “1”. With Python3.x , the same gives you (“1.5”): ValueError: invalid literal for int() with base 10: “1.5”.


RedisInsight has two port variables. RIPORT and REDISINSIGHT_PORT.

The problem is, @psankar has created a service under name REDISINSIGHT which causes k8s to pass service ip details as environment variable in the redisinsight container.

So k8s does <service_name>_PORT = “service-ip”, i.e., REDISINSIGHT_PORT=“service-ip” inside the container which is causing the crash. The solution is to not use “RI” or “Redisinsight” as service name.