OT-CONTAINER-KIT / helm-charts

A repository which that will contain helm charts with best and security practices.
https://ot-container-kit.github.io/helm-charts
49 stars 84 forks source link

Both redis-cluster and redis fail to install as documented. #4

Closed denist-huma closed 3 years ago

denist-huma commented 3 years ago

Goal

Install Redis Operator to the GCP sandbox cluster and record steps.

Operator

Following Redis Operator Installation

Release "redis-operator" does not exist. Installing it now.
NAME: redis-operator
LAST DEPLOYED: Mon Jun 28 14:53:06 2021
NAMESPACE: redis-operator
STATUS: deployed
REVISION: 1
TEST SUITE: None

Listing releases matching ^redis-operator$
redis-operator  redis-operator  1               2021-06-28 14:53:06.986523827 +0300 MSK deployed        redis-operator-0.5.0    0.5.0      

UPDATED RELEASES:
NAME             CHART                    VERSION
redis-operator   ot-helm/redis-operator     0.5.0

denis@L560:~/huma/phoenix-server-deployments/k8s/cluster$ kubectl create secret generic redis-secret \
>         --from-literal=password=password -n operator-sandbox
secret/redis-secret created
denis@L560:~/huma/phoenix-server-deployments/k8s/cluster$ helm upgrade redis-cluster ot-helm/redis-cluster \
>   --set redisCluster.clusterSize=3 --install --namespace operator-sandbox
Release "redis-cluster" does not exist. Installing it now.
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "RedisCluster" in version "redis.redis.opstreelabs.in/v1beta1"
denis@L560:~/huma/phoenix-server-deployments/k8s/cluster$ helm upgrade redis ot-helm/redis --install --namespace operator-sandbox
Release "redis" does not exist. Installing it now.
Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: [ValidationError(Redis.spec): unknown field "kubernetesConfig" in in.opstreelabs.redis.redis.v1beta1.Redis.spec, ValidationError(Redis.spec): missing required field "global" in in.opstreelabs.redis.redis.v1beta1.Redis.spec, ValidationError(Redis.spec): missing required field "mode" in in.opstreelabs.redis.redis.v1beta1.Redis.spec, ValidationError(Redis.spec): missing required field "service" in in.opstreelabs.redis.redis.v1beta1.Redis.spec]

@iamabhishek-dubey hey I am stuck :-1: have you any clue for me? Thanks in advance!

iamabhishek-dubey commented 3 years ago

This should be fixed now, can you please test it

denist-huma commented 3 years ago

Thanks @iamabhishek-dubey !

The cluster seems online, but I cannot get log in. The "password" I set in a secret myself, for user I got no clue what is it?

denis@L560:~/huma/phoenix-server-deployments/k8s/cluster$ kubectl create secret generic redis-secret \
>         --from-literal=password=password -n operator-sandbox
secret/redis-secret created
$ kubectl exec -it redis-cluster-leader-0 -n operator-sandbox -- redis-cli -a Opstree@password cluster nodes
Defaulted container "redis-cluster-leader" out of: redis-cluster-leader, redis-exporter
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Warning: AUTH failed
NOAUTH Authentication required.
$ kubectl get pods -n operator-sandbox
NAME                       READY   STATUS    RESTARTS   AGE
redis-cluster-follower-0   2/2     Running   0          17m
redis-cluster-follower-1   2/2     Running   0          16m
redis-cluster-follower-2   2/2     Running   0          15m
redis-cluster-leader-0     2/2     Running   0          17m
redis-cluster-leader-1     2/2     Running   0          16m
redis-cluster-leader-2     2/2     Running   0          15m
2021-06-29T15:04:12.531Z        INFO    controller_redis        Total number of redis nodes are {"Request.RedisManager.Namespace": "operator-sandbox", "Request.RedisManager.Name": "redis-cluster", "Nodes": "6"}
2021-06-29T15:04:12.531Z        INFO    controllers.RedisCluster        Redis leader count is desired   {"Request.Namespace": "operator-sandbox", "Request.Name": "redis-cluster"}
2021-06-29T15:04:12.619Z        INFO    controller_redis        Successfully got the ip for redis       {"Request.RedisManager.Namespace": "operator-sandbox", "Request.RedisManager.Name": "redis-cluster-leader-0", "ip": "10.180.6.12"}
2021-06-29T15:04:12.623Z        INFO    controller_redis        Redis cluster nodes are listed  {"Request.RedisManager.Namespace": "operator-sandbox", "Request.RedisManager.Name": "redis-cluster", "Output": "51b0013ad13d3d761c563e2a25709f5c0470a6f0 10.180.2.16:6379@16379 slave 304a47049f44bc8daf7392a9fcf7d0baf178975a 0 1624979051000 2 connected\nf896b4f5ee84eeeee898ab236fc1cda48c37b56a 10.180.6.12:6379@16379 myself,master - 0 1624979050000 1 connected 0-5460\n304a47049f44bc8daf7392a9fcf7d0baf178975a 10.180.5.8:6379@16379 master - 0 1624979051000 2 connected 5461-10922\nc1641001da056be9c3f59bd6b37ea2a6f26cab53 10.180.2.17:6379@16379 master - 0 1624979051963 3 connected 10923-16383\n061afc238c617058e67a480764b3edfcd038002d 10.180.5.9:6379@16379 slave c1641001da056be9c3f59bd6b37ea2a6f26cab53 0 1624979050560 3 connected\nabfafc01525cb6d4c4962d3e0d29516faabbb6f9 10.180.0.17:6379@16379 slave f896b4f5ee84eeeee898ab236fc1cda48c37b56a 0 1624979051562 1 connected\n"}
2021-06-29T15:04:12.623Z        INFO    controller_redis        Number of failed nodes in cluster       {"Request.RedisManager.Namespace": "operator-sandbox", "Request.RedisManager.Name": "redis-cluster", "Failed Node Count": 0}
iamabhishek-dubey commented 3 years ago
denis@L560:~/huma/phoenix-server-deployments/k8s/cluster$ kubectl create secret generic redis-secret \
>         --from-literal=password=password -n operator-sandbox

Inside this command, you have set password=password

but in cli you are using something else

$ kubectl exec -it redis-cluster-leader-0 -n operator-sandbox -- redis-cli -a Opstree@password cluster nodes
Defaulted container "redis-cluster-leader" out of: redis-cluster-leader, redis-exporter
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Warning: AUTH failed
NOAUTH Authentication required.

You can always check password by doing,

echo $REDIS_PASSWORD
denist-huma commented 3 years ago

Hey, @iamabhishek-dubey thanks again. :+1: I got confused with redis-cli -a option thinking it needs also a user, like databases I used to work with before.

denis@L560:~/huma/phoenix-server-deployments$ kubectl exec -it redis-cluster-leader-0 -n operator-sandbox -- redis-cli -a password cluster nodes
Defaulted container "redis-cluster-leader" out of: redis-cluster-leader, redis-exporter
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
51b0013ad13d3d761c563e2a25709f5c0470a6f0 10.180.2.16:6379@16379 slave 304a47049f44bc8daf7392a9fcf7d0baf178975a 0 1625034442507 2 connected
f896b4f5ee84eeeee898ab236fc1cda48c37b56a 10.180.6.12:6379@16379 myself,master - 0 1625034442000 1 connected 0-5460
304a47049f44bc8daf7392a9fcf7d0baf178975a 10.180.5.8:6379@16379 master - 0 1625034441000 2 connected 5461-10922
c1641001da056be9c3f59bd6b37ea2a6f26cab53 10.180.2.17:6379@16379 master - 0 1625034442000 3 connected 10923-16383
061afc238c617058e67a480764b3edfcd038002d 10.180.5.9:6379@16379 slave c1641001da056be9c3f59bd6b37ea2a6f26cab53 0 1625034442908 3 connected
abfafc01525cb6d4c4962d3e0d29516faabbb6f9 10.180.0.17:6379@16379 slave f896b4f5ee84eeeee898ab236fc1cda48c37b56a 0 1625034442000 1 connected