当前位置:网站首页>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 .
边栏推荐
猜你喜欢

CSRF attack

SQL注入闭合判断

SQL injection closure judgment

Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool

The boss said: whoever wants to use double to define the amount of goods, just pack up and go

Build FRP for intranet penetration

Oracle apex Ajax process + dy verification

Sqli labs customs clearance summary-page1

在php的开发环境中如何调取WebService?

@Transational踩坑
随机推荐
Only the background of famous universities and factories can programmers have a way out? Netizen: two, big factory background is OK
TCP attack
ARP attack
CAD二次开发 对象
Wechat applet Foundation
PXC high availability cluster summary
[Zhang San learns C language] - deeply understand data storage
IDEA2020中PySpark的两表关联(字段名相同)
Oracle 11g uses ords+pljson to implement JSON_ Table effect
叮咚,Redis OM对象映射框架来了
Oracle 11.2.0.3 handles the problem of continuous growth of sysaux table space without downtime
Principle analysis of spark
Cve - 2015 - 1635 (ms15 - 034) réplication de la vulnérabilité d'exécution de code à distance
[leetcode question brushing day 35] 1060 Missing element in ordered array, 1901 Find the peak element, 1380 Lucky number in matrix
Sqli-labs customs clearance (less6-less14)
搭建frp进行内网穿透
php中根据数字月份返回月份的英文缩写
Build FRP for intranet penetration
php中通过集合collect的方法来实现把某个值插入到数组中指定的位置
Uniapp introduces local fonts
2. Get into k8s Of etcd

