首页 > 其他分享 >k8s中,如何通过token的方式,访问认证的kubelet的metrics指标?

k8s中,如何通过token的方式,访问认证的kubelet的metrics指标?

时间:2023-11-16 17:24:32浏览次数:34  
标签:02 node metrics kubelet token nccztsjb root

 

1、背景说明

kubelet本身的10250端口,就提供了节点上的监控数据。

 

metrics server可以进行访问。

 

但是,如果想要通过浏览器,或者curl命令进行访问,发现,是需要进行认证

 

 

[root@nccztsjb-node-02 ~]# curl  -k https://172.20.59.238:10250/metrics
Unauthorized[root@nccztsjb-node-02 ~]# 
[root@nccztsjb-node-02 ~]# 

 

那要如何进行访问呢?

 

2、通过token的方式进行访问

 

在k8s中,可以通过证书,也可以通过token的方式进行认证和访问。

 

那么,这个token,从哪里来呢?

 

就涉及到一个概念,在k8s里面的概念,就是权限的问题,比如clusterrole和serviceaccount的概念。

 

serviceaccount是k8s里的用户的概念,只要seviceaccount有访问node资源的权限,就可以获取对应的资源的信息了。

 

通过下面的命令,创建clusterrole,serviceaccount和clusterrolebinding

 

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: node-metrics
rules:
- apiGroups:
  - ""
  resources:
  - nodes/metrics
  - nodes/stats
  - nodes/proxy
  verbs:
  - get
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: node-metrics
  namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: node-metrics
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: node-metrics
subjects:
- kind: ServiceAccount
  name: node-metrics
  namespace: default

 

 

  • 创建集群角色clusterrole node-metrics,有访问nodes资源的权限
  • 创建serviceaccount node-metrics,也就是用户
  • 创建clusterrolebinding,也就是将用户和角色进行绑定

 

[root@nccztsjb-node-02 ~]# vi node-metrics-privileges.yaml
[root@nccztsjb-node-02 ~]# kubectl apply -f node-metrics-privileges.yaml 
clusterrole.rbac.authorization.k8s.io/node-metrics unchanged
serviceaccount/node-metrics unchanged
clusterrolebinding.rbac.authorization.k8s.io/node-metrics unchanged
[root@nccztsjb-node-02 ~]# 

 

 

查看serviceaccount信息

[root@nccztsjb-node-02 ~]# kubectl get serviceaccount node-metrics -o yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"ServiceAccount","metadata":{"annotations":{},"name":"node-metrics","namespace":"default"}}
  creationTimestamp: "2023-11-16T08:30:53Z"
  name: node-metrics
  namespace: default
  resourceVersion: "15119522"
  selfLink: /api/v1/namespaces/default/serviceaccounts/node-metrics
  uid: bfb769eb-733b-45cb-9b7d-a0f82822a435
secrets:
- name: node-metrics-token-zln7v
[root@nccztsjb-node-02 ~]# 

 

 

其中,secrets里面是用户的认证信息

secrets:
- name: node-metrics-token-zln7v

 

 

查看secret的详细内容

[root@nccztsjb-node-02 ~]# kubectl get secret node-metrics-token-zln7v -o yaml
apiVersion: v1
data:
  ca.crt: LS0tLS1CRUdJcccTiBDRVsdfsdfJUSUZJsdfsdfsQ0FURS0tLS0tCk1JSUMvakNDQWVhZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJek1Ea3dPREE0TURjME5Gb1hEVE16TURrd05UQTRNRGMwTkZvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTVpvCkRRVDZrc0MwbUN5L21YYXkzK0xrVzJBNFpINEVWenRkYnpJamtNenlreDVnWkhmN25ZK0Rqdk1wS294a2NrTzAKN05qSTBmc3BIOEZnMU0rUlN5V3JTc1p6KzlWbE1WdnBQS2F4YmtDaDVhSUpibThDL2pmaU1tT1N6akovb05NUgpENVFTWmNCZFFuNEM1YlFGb1pRdUJ2QzRnNExTYlFVSDR3eURUcUFnZ2RsZHZRamZuTUNWUzdvc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SGJrS3B3dWVYdkhZU2psU21PeHhicTJERjJuUDNhOXRTOUlCd2tOdmswRTZFeWQ4bkE=
kind: Secret
metadata:
  annotations:
    kubernetes.io/service-account.name: node-metrics
    kubernetes.io/service-account.uid: bfb769eb-733b-45cb-9b7d-a0f82822a435
  creationTimestamp: "2023-11-16T08:30:53Z"
  name: node-metrics-token-zln7v
  namespace: default
  resourceVersion: "15119521"
  selfLink: /api/v1/namespaces/default/secrets/node-metrics-token-zln7v
  uid: 61d45eb4-9293-4a3a-93cd-66e12a90bf05
type: kubernetes.io/service-account-token
[root@nccztsjb-node-02 ~]# 

 

 

可以看到token的信息

token: ZXlKaGJHY2lPaUpTVXpJMU5psdfsdfsfdsfSXNJbXRwWkNJNklqTjFRWFJ5WVhVeFdFSlJZa0pZU205M2FHeE5kVTE2Vm1KM04yeFBlVGhwYWxCMWNVdGxjMEZLVjJzaWZRLmV5SnBjM01pT2lKcmRXSmxjbTVsZEdWekwzTmxjblpwWTJWaFkyTnZkVzUwSWl3aWEzVmlaWEp1WlhSbGN5NXBieTl6WlhKMmFXTmxZV05qYjNWdWRDOXVZVzFsYzNCaFkyVWlPaUprWldaaGRXeDBJaXdpYTNWaVpYSnVaWFJsY3k1cGJ5OXpaWEoyYVdObFlXTmpiM1Z1ZEM5elpXTnlaWFF1Ym1GdFpTSTZJbTV2WkdVdGJXVjBjbWxqY3kxMGIydGxiaTE2Ykc0M2RpSXNJbXQxWW1WeWJtVjBaWE11YVc4dmMyVnlkbWxqWldGalkyOTFiblF2YzJWeWRtbGpaUzFoWTJOdmRXNTBMbTVoYldVaU9pSnViMlJsTFcxbGRISnBZM01pTENKcmRXSmxjbTVsZEdWekxtbHZMM05sY25acFkyVmhZMk52ZFc1MEwzTmxjblpwWTJVdFlXTmpiM1Z1ZEM1MWFXUWlPaUppWm1JM05qbGxZaTAzTXpOaUxUUTFZMkl0T1dJM1pDMWhNR1k0TWpneU1tRTBNelVpTENKemRXSWlPaUp6ZVhOMFpXMDZjMlZ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mVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJub2RlLW1ldHJpY3MiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiJiZmI3NjllYi03MzNiLTQ1Y2ItOWI3ZC1hMGY4MjgyMmE0MzUiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6ZGVmYXVsdDpub2RlLW1ldHJpY3MifQ.bwZAitp-64zNlE0UoWWPeKujcrYYtNHyPt_abX59UU7_3Kp7-V-HXbBu6XTSVAWURVpsaVG-sqEYwjfeoUyVKvKHMrtzRVKLnRs2MivRo_w0GXNLGSZkcmuMUj7La7Mofb3z68ZK_9eEDRDzVqA3AIZvsYq8uWG9CpQ8XJ4o0O5DuAwhQn7Gy0UCPeI80vnekW1Zh7VOM4R53sYwhX3K4B3m0sD61mlLO76bJmQ5iiZqALoTeMqaaghGpynbfkvAj5qEX80tpN_VajIKHJkK2maBbN89onDUCGjyHbkKpwueXvHYSjlSmOxxbq2DF2nP3a9tS9IBwkNvk0E6Eyd8nA[root@nccztsjb-node-02 ~]# 
 

 

 

然后用解密之后的token访问节点的,也就是kubelet的metrics

token=eyJhbGciOiJSUzI1NiIsIsdfsgmtpZCI6IjNssQXRyYXUxWEJRYkJYSm93aGxNdU16VmJ3N2xPeThpalB1cUtlc0FKV2sifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6Im5vZGUtbWV0cmljcy10b2tlbi16bG43diIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJub2RlLW1ldHJpY3MiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiJiZmI3NjllYi03MzNiLTQ1Y2ItOWI3ZC1hMGY4MjgyMmE0MzUiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6ZGVmYXVsdDpub2RlLW1ldHJpY3MifQ.bwZAitp-64zNlE0UoWWPeKujcrYYtNHyPt_abX59UU7_3Kp7-V-HXbBu6XTSVAWURVpsaVG-sqEYwjfeoUyVKvKHMrtzRVKLnRs2MivRo_w0GXNLGSZkcmuMUj7La7Mofb3z68ZK_9eEDRDzVqA3AIZvsYq8uWG9CpQ8XJ4o0O5DuAwhQn7Gy0UCPeI80vnekW1Zh7VOM4R53sYwhX3K4B3m0sD61mlLO76bJmQ5iiZqALoTeMqaaghGpynbfkvAj5qEX80tpN_VajIKHJkK2maBbN89onDUCGjyHbkKpwueXvHYSjlSmOxxbq2DF2nP3a9tS9IBwkNvk0E6Eyd8nA

curl -s -k -H "Authorization: Bearer $token" https://172.20.59.238:10250/metrics > node-metrics.log

 

结果,输出到文件中。

 

查看结果:

 

就可以看到的metrics的指标数据了。

 

或者,在浏览器中,修改header,增加token,也可以进行访问

 

 

可以看到,对应的pod的信息

 

标签:02,node,metrics,kubelet,token,nccztsjb,root
From: https://www.cnblogs.com/chuanzhang053/p/17836794.html

相关文章

  • Angular 依赖注入系统里 Injection token APP_BASE_HREF 的使用场景
    Angular的依赖注入系统是其核心功能之一,它提供了一种优雅的方式来管理应用中的服务和组件之间的依赖关系。在Angular中,我们可以使用各种方式来提供依赖项,而APP_BASE_HREF是其中的一个依赖注入标记。APP_BASE_HREF是一个Injectiontoken,它在Angular的路由系统中扮演了重......
  • token以及axios响应拦截器请求拦截器
    一、token的介绍1.概念访问权限的令牌,本质上是一串字符串2.创建正确登录后,由后端签发并返回3.作用判断是否有登录状态等,控制访问权限注意:前端只能判断有无token,而后端才能判断token的有效性4.使用目标:只有登录状态,才能访问内容页面1.在utils/auth.js中判断有无token令牌字符串,则强......
  • jmeter-set up先登录获取token,再测试
    1.顶部加通用的信息头管理,cookie管理器 2.添加setup线程组,用户数为13.添加登录请求4.添加断言,添加debug调试 5.提取json,  6.添加debug,运行后查看是否获取到token 7.设置token为全局变量 8.再添加线程组,线程组可正常设置并发数需要用到token的地方再添加......
  • 使用JWT、拦截器与ThreadLocal实现在任意位置获取Token中的信息,并结合自定义注解实现
    1.简介1.1JWTJWT,即JSONWebToken,是一种用于在网络上传递声明的开放标准(RFC7519)。JWT可以在用户和服务器之间传递安全可靠的信息,通常用于身份验证和信息交换。声明(Claims):JWT包含一组称为声明的信息,声明描述了一些数据。有三种类型的声明:注册声明(RegisteredClaims):这是......
  • 关于Sa-token过程的一些解析
    1.Sa-Token是什么?Sa-Token是一个基于Java的轻量级身份认证和授权框架,用于简化和加强应用程序的用户认证和权限管理功能。它提供了一套简洁的API,使开发者可以轻松地实现用户登录、权限验证、会话管理等功能。2.如何生成token?根据用户id生成一串token字符串(一般来讲),......
  • redis 使用token实现重复提交
    使用Token实现重复提交介绍在Web开发过程中,重复提交是一个常见的问题。为了防止用户多次提交同一请求,我们可以使用Token实现重复提交的校验。本文将介绍如何使用Redis来实现这一功能。流程图flowchartTDA(生成Token)-->B(存储Token至Redis)B-->C(校验Token)......
  • kubeadm部署的k8s证书过期问题 k8s问题排查:the existing bootstrap client certifica
     解决问题:估计跟移动有关,下面那个没解决问题,是因为在原有文件的基础上修改的吧?而这里直接是移走,重新生成了新的。不太清楚是不是这个原因。$cd/etc/kubernetes/pki/$mv{apiserver.crt,apiserver-etcd-client.key,apiserver-kubelet-client.crt,front-proxy-ca.crt,front......
  • token、session和cookie的对比
    Cookie1991年HTTP0.9诞生了,当时只是为了满足大家浏览web文档的要求,所以只有GET请求,浏览完了就走了,两个连接之间是没有任何联系的,这也是HTTP为无状态的原因,因为它诞生之初就没有这个需求。但随着交互式Web的兴起(所谓交互式就是你不光可以浏览,还可以登录,发评论,购物等......
  • 解决etcd服务--listen-metrics-urls=http://127.0.0.1:2381
     1、查看etcd的2381端口[root@master-nodemanifests]#netstat-anp|grep2381tcp00127.0.0.1:23810.0.0.0:*LISTEN21765/etcd2、获取etcd的pod[root@master-nodemanifests]#kubectlgetpod-ANAMESPACENAME......
  • ts + axios token无感刷新,及重新请求后页面不刷新问题
    最近上班遇到的新需求,token无感刷新,参考了很多博客,也看了渡一老师的视频,功能是实现了,但是发现重新请求后页面数据没有更新遇到相同问题的先理清代码执行顺序和Promise,看看执行结果有没有resolve()出去。话不多说,直接上代码,因为自己封装的请求和大家的不一样,仅供参考无感刷新token......