1. 搭建
从仓库找一个模版安装,很容易:
设置一个密码:123456, 然后点安装即可。
2. 看下搭建情况
2.1. 应用
2.2. 服务
是个headless服务,无法采用clusterip访问了
2.3. 容器
3. 测试
创建一个k8s客户端进行测试
bash-5.1# kubectl run redis-client --image=redis --restart=Never --env REDIS_PASSWORD=rds0704152245 -it -- /bin/bash
If you don't see a command prompt, try pressing enter.
root@redis-client:/data#
root@redis-client:/data# redis-cli -h 172.31.33.69 -a 123456
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
172.31.33.69:6379> set mykey "hello world"
OK
172.31.33.69:6379> get mykey
"hello world"
172.31.33.69:6379>