请选择 进入手机版 | 继续访问电脑版

centOS7 minikube k8s etcd 数据查看

[复制链接]
时间苍白了等待 发表于 2021-1-2 17:42:40 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
检察K8s的etcd数据
centos7 minikube 情况下的k8s

ssh 登录你的centOS呆板

检察etcd.yaml内容
  1. manifests]# pwd/etc/kubernetes/manifestsmanifests]# lltotal 16-rw------- 1 root root 2348 Dec 27 22:08 etcd.yaml-rw------- 1 root root 3776 Dec 27 22:08 kube-apiserver.yaml-rw------- 1 root root 3087 Dec 30 18:04 kube-controller-manager.yaml-rw------- 1 root root 1427 Dec 30 18:01 kube-scheduler.yaml#检察证书信息manifests]# cat etcd.yaml apiVersion: v1kind: Pod  #你没看错,etcd以Pod的形式出现metadata:  annotations:   ...   labels:    component: etcd    tier: control-plane  name: etcd  namespace: kube-systemspec:  containers:  - command:    - etcd    - --cert-file=/var/lib/minikube/certs/etcd/server.crt    ...    - --key-file=/var/lib/minikube/certs/etcd/server.key        ...          ...    - --trusted-ca-file=/var/lib/minikube/certs/etcd/ca.crt    ..中间省略部门内容..    name: etcd-certs  - hostPath:      path: /var/lib/minikube/etcd      type: DirectoryOrCreate    name: etcd-datastatus: {}
复制代码
检察etcd pod
  1. ]# kubectl get pod -n kube-system | grep etcdetcd-xxxxxx名称xxxx                      1/1     Running   0          3d13h
复制代码
进入etcd pod
  1. #进入etcd pod]# kubectl exec -it -n kube-system etcd-xxxxxx名称xxxx -- shsh-5.0#sh-5.0# export ETCDCTL_API=3  #设置etcdctl使用的版本sh-5.0# etcdctl --endpoints=https://127.0.0.1:2379 \        --cacert=/var/lib/minikube/certs/etcd/ca.crt \        --cert=/var/lib/minikube/certs/etcd/server.crt \        --key=/var/lib/minikube/certs/etcd/server.key \        get / --prefix --keys-only然后会出一堆东西。。。/registry/apiregistration.k8s.io/apiservices/v1./registry/apiregistration.k8s.io/apiservices/v1.admissionregistration.k8s.io。省略大部门内容。。/registry/apiregistration.k8s.io/apiservices/v1beta1.batch。。。。。。/registry/services/specs/kubernetes-dashboard/kubernetes-dashboard/registry/statefulsets/default/kubia/registry/storageclasses/standard
复制代码
检察Pods
  1. sh-5.0# etcdctl --endpoints=https://127.0.0.1:2379 \        --cacert=/var/lib/minikube/certs/etcd/ca.crt \        --cert=/var/lib/minikube/certs/etcd/server.crt \        --key=/var/lib/minikube/certs/etcd/server.key \        get /registry/pods --prefix
复制代码
检察一个Pod在etcd中的展现
  1. sh-5.0# etcdctl --endpoints=https://127.0.0.1:2379 \> --cacert=/var/lib/minikube/certs/etcd/ca.crt \> --cert=/var/lib/minikube/certs/etcd/server.crt \> --key=/var/lib/minikube/certs/etcd/server.key \> get /registry/pods/default/kubia-bcf9bb974-4564t --prefix/registry/pods/default/kubia-bcf9bb974-4564tk8sv1Podkubia-bcf9bb974-4564tkubia-bcf9bb974-default" *$6a64696c-39c3-46af-af59-b0f6fbd13d812 8ǯ ZappkubiaZpod-template-hash     bcf9bb974jPReplicaSetkubia-bcf9bb974"$ad69d763-02db-457d-afe6-028bb2c8086a*apps/v108z kube-controller-managerUpdatevǯ FieldsV1:{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:app":{},"f:pod-template-hash":{}},"f:ownerReferences":{".":{},"k:{"uid":"ad69d763-02db-457d-afe6-028bb2c8086a"}":{".":{},"f:apiVersion":{},"f:blockOwnerDeletion":{},"f:controller":{},"f:kind":{},"f:name":{},"f:uid":{}}}},"f:spec":{"f:containers":{"k:{"name":"nodejs"}":{".":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}kubeletUpdatevǯ FieldsV1:{"f:status":{"f:conditions":{"k:{"type":"ContainersReady"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{"type":"Initialized"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{"type":"Ready"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}}},"f:containerStatuses":{},"f:hostIP":{},"f:phase":{},"f:podIP":{},"f:podIPs":{".":{},"k:{"ip":"172.17.0.17"}":{".":{},"f:ip":{}}},"f:startTime":{}}}1default-token-fstrq2default-token-fstrqnodejsluksa/kubia:v2* B JJdefault-token-fstrq-/var/run/secrets/kubernetes.io/serviceaccount" 2 j/dev/termination-logr                                                                                           IfNotPresent   FileAlways 2                                                                                                                      ClusterFirstBdefaultJdefaultRizbp15axph2ymsdo0w4681zX ` h r   default-scheduler6node.kubernetes.io/not-readyExists "        NoExecute(8node.kubernetes.io/unreachableExists "      NoExecute(  PreemptLowerPriorityRunning#InitializedTrueǯ * 2 ReadyTrueǯ * 2 'ContainersReadyTrueǯ * 2 $PodScheduledTrueǯ * 2  " *                          172.16.82.522                                       172.17.0.1ǯ Bnodejsǯ   ( 2docker.io/luksa/kubia:v2:odocker-pullable://docker.io/luksa/kubia@sha256:216cdd252c24726012bd78d47c2538de2abe5d75ac5a8afddeed8b3833f9e88dBIdocker://cf7bd32dfbe09c48524863d33c5c510f1a72637921572031662859514b3f8065HJBestEffortZ b172.17.0.17 "sh-5.0#
复制代码
来源:https://blog.csdn.net/csdnfanguyinheng/article/details/112006400
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


专注素材教程免费分享
全国免费热线电话

18768367769

周一至周日9:00-23:00

反馈建议

27428564@qq.com 在线QQ咨询

扫描二维码关注我们

Powered by Discuz! X3.4© 2001-2013 Comsenz Inc.( 蜀ICP备2021001884号-1 )