'Cannot connect to cassandra from within the same k3s cluster

I have deployed cassandra in my local k3s cluster with the below command:

helm install monitoring-cassandra bitnami/cassandra --set dbUser.password="cassandra" --set dbUser.user="cassandra" --set image.debug=true

Now, as per the instructions from the output of the above command, I create a cassandra client pod using

kubectl run --namespace default monitoring-cassandra-client --rm --tty -i --restart='Never'  --image docker.io/bitnami/cassandra:4.0.3-debian-10-r59 -- bash

And then in the command prompt, when I attempt to connect to the deployed cassandra deployment, I get the below error

$ cqlsh -u cassandra -p cassandra monitoring-cassandra
Connection error: ('Unable to connect to any servers', {'192.168.96.199:9042': AuthenticationFailed('Failed to authenticate to 192.168.96.199:9042: Error from server: code=0100 [Bad credentials] message="Provided username cassandra and/or password are incorrect"')})
Connection error: ('Unable to connect to any servers', {'192.168.96.199:9042': AuthenticationFailed('Failed to authenticate to 192.168.96.199:9042: Error from server: code=0100 [Bad credentials] message="Provided username cassandra and/or password are incorrect"')})
I have no name!@monitoring-cassandra-client:/$ cqlsh -u cassandra -p $CASSANDRA_PASSWORD monitoring-cassandra

Please can someone help me with this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source