cs@debian:~/oss/hexo$ kubectl get svc -n devops NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE jenkins ClusterIP 121.21.92.146 <none> 8081/TCP,50000/TCP 105d redis-headless-service ClusterIP None <none> 6379/TCP 13d redis-service ClusterIP 121.21.24.33 <none> 6379/TCP 13d tomcat ClusterIP 121.21.191.100 <none> 8082/TCP 105d
cs@debian:~/oss/hexo$ kubectl exec -it redis-app-1 -n devops /bin/bash kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl kubectl exec [POD] -- [COMMAND] instead. ............. root@redis-app-1:/data# redis-cli -c -h 121.21.24.33 -p 6379 121.21.24.33:6379> auth 123456 OK 121.21.24.33:6379> ping PONG 121.21.24.33:6379> get test21 -> Redirected to slot [8530] located at 121.21.35.3:6379 (error) NOAUTH Authentication required. 121.21.35.3:6379> auth 123456 OK 121.21.35.3:6379> get test21 "20220721cs"
cs@debian:~/oss/hexo$ kubectl get pod --field-selector status.podIP=121.21.35.3 -o wide -n devops NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES redis-app-1 1/1 Running 1 9d 121.21.35.3 node04 <none> <none>