当前位置:网站首页>Illustration of etcd access in kubernetes
Illustration of etcd access in kubernetes
2022-07-02 07:13:00 【wuzd】
Catalog
1. stay k8s Check the installed etcd
4. View all nodes in the cluster (etcdctl member list)
5. Write test data (etcdctl put /testdir/testkey "Hello world1")
6. Read out the test data (etcdctl get /testdir/testkey)
Preface
Kubernetes Medium etcd visit .
Normal installation k8s, Didn't deliberately install etcd, utilize K8s Attached to etcd, Feel the etcd Read and write operations .
Tips : The following is the main body of this article , The following cases can be used for reference
One 、etcd What is it? ?
etcd It's a distributed one key-value Storage database .
Two 、 Use steps
1. stay k8s Check the installed etcd
kubectl get pod -n kube-system | grep etcd
2. Get into k8s Of etcd
kubectl exec -ti etcd-s205 -n kube-system -- /bin/shetcd-s205 yes etcd Of pod Name ,
kube-system yes etcd In the namespace

3. Appoint etcd Version of 3
export ETCDCTL_API=34. View all nodes in the cluster (etcdctl member list)
The original order was etcdctl member list, Will make mistakes ,
"level":"warn","ts":"2022-01-23T07:20:36.684Z","caller":"clientv3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"endpoint://client-f4a0c47f-bfc5-4e20-938f-fd9f60be32fd/127.0.0.1:2379","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest balancer error: all SubConns are in TransientFailure, latest connection error: connection closed"}
Error: context deadline exceeded
"level":"warn","ts":"2022-01-23T07:20:36.684Z","caller":"clientv3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"endpoint://client-f4a0c47f-bfc5-4e20-938f-fd9f60be32fd/127.0.0.1:2379","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest balancer error: all SubConns are in TransientFailure, latest connection error: connection closed"}
Error: context deadline exceeded
To access with certificate parameters ,
Added certificate parameters
--cacert=/etc/kubernetes/pki/etcd/ca.crt
--cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt
--key=/etc/kubernetes/pki/etcd/healthcheck-client.key
etcdctl --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt --key=/etc/kubernetes/pki/etcd/healthcheck-client.key member list5. Write test data (etcdctl put /testdir/testkey "Hello world1")
etcdctl --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt --key=/etc/kubernetes/pki/etcd/healthcheck-client.key put /testdir/testkey "Hello world1"
6. Read out the test data (etcdctl get /testdir/testkey)
etcdctl --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt --key=/etc/kubernetes/pki/etcd/healthcheck-client.key get /testdir/testkeysummary
k8s Medium etcd, Add the certificate parameters , You can test and learn directly .
边栏推荐
- SQLI-LABS通关(less15-less17)
- SQLI-LABS通關(less6-less14)
- sparksql数据倾斜那些事儿
- Oracle general ledger balance table GL for foreign currency bookkeeping_ Balance change (Part 1)
- JS judge whether the object is empty
- sqli-labs通关汇总-page2
- ssm垃圾分类管理系统
- Review of reflection topics
- php中时间戳转换为毫秒以及格式化时间
- In depth study of JVM bottom layer (3): garbage collector and memory allocation strategy
猜你喜欢
随机推荐
Oracle APEX 21.2 installation et déploiement en une seule touche
sqli-labs通关汇总-page1
Anti shake and throttling of JS
SQLI-LABS通關(less6-less14)
ARP攻击
Sqli-labs customs clearance (less1)
图解Kubernetes中的etcd的访问
SSM学生成绩信息管理系统
php中的二维数组去重
IDEA2020中测试PySpark的运行出错
JSP智能小区物业管理系统
Take you to master the formatter of visual studio code
Sqli-labs customs clearance (less6-less14)
Only the background of famous universities and factories can programmers have a way out? Netizen: two, big factory background is OK
Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
中年人的认知科普
Explain in detail the process of realizing Chinese text classification by CNN
Sqli Labs clearance summary - page 2
Data warehouse model fact table model design
JS create a custom JSON array
2. Get into k8s Of etcd










