Kubernetes集群上的Apache Ignite第2部分:RBAC解释

您有一个正在运行的缓存服务,但是您所做的只是安装了头盔图表。
在此博客中,我们将评估已安装的产品并为我们的期货掌舵图做笔记。

第一步是查看舵图。

 > helm list  NAME           NAMESPACE  REVISION   UPDATED                                STATUS     CHART          APP VERSION  ignite-cache   default    1          2020-03-07 22:23:49.918924 +0000 UTC   deployed   ignite-1.0.1   2.7.6 

现在让我们下载

 > helm fetch stable /ignite  > tar xvf ignite-1.0.1.tgz  > cd ignite/; ls -R  Chart.yaml README.md  templates  values.yaml  . /templates :  NOTES.txt          account-role.yaml      persistence-storage-class.yaml service-account.yaml       svc.yaml  _helpers.tpl           configmap.yaml         role-binding.yaml      stateful- set .yaml      wal-storage-class.yaml 

读取模板文件有点挑战性(它们是tempaltes:P),因此我们将只检查通过我们先前的博客安装的文件。

让我们从帐户角色开始。 点燃应使用的群集角色需要能够获取/列出/监视吊舱和端点。 这是有道理的,因为需要在节点之间进行发现。

 > kubectl get ClusterRole ignite-cache -o yaml  kind: ClusterRole  metadata: 
   creationTimestamp: 2020-03-07T22:23:50Z 
   name: ignite-cache 
   resourceVersion: "137525" 
   selfLink: /apis/rbac .authorization.k8s.io /v1/clusterroles/ignite-cache 
   uid: 0cad0689-2f94-4b74-87bc-b468e2ac78ae  rules:  - apiGroups: 
   - "" 
   resources: 
   - pods 
   - endpoints 
   verbs: 
   - get 
   - list 
   - watch 

为了使用此角色,您需要一个服务帐户。 使用令牌创建服务帐户。

 > kubectl get serviceaccount ignite-cache -o yaml  apiVersion: v1  kind: ServiceAccount  metadata: 
   creationTimestamp: 2020-03-07T22:23:50Z 
   name: ignite-cache 
   namespace: default 
   resourceVersion: "137524" 
   selfLink: /api/v1/namespaces/default/serviceaccounts/ignite-cache 
   uid: 7aab67e5-04db-41a8-b73d-e76e34ca1d8e  secrets:  - name: ignite-cache-token-8rln4 

然后我们有了角色绑定。 我们有一个名为ignite-cache的新服务帐户,其角色为ignite-cache。

 > kubectl get ClusterRoleBinding ignite-cache -o yaml  apiVersion: rbac.authorization.k8s.io /v1  kind: ClusterRoleBinding  metadata: 
   creationTimestamp: 2020-03-07T22:23:50Z 
   name: ignite-cache 
   resourceVersion: "137526" 
   selfLink: /apis/rbac .authorization.k8s.io /v1/clusterrolebindings/ignite-cache 
   uid: 1e180bd1-567f-4979-a278-ba2e420ed482  roleRef: 
   apiGroup: rbac.authorization.k8s.io 
   kind: ClusterRole 
   name: ignite-cache  subjects:  - kind: ServiceAccount 
   name: ignite-cache 
   namespace: default 

使用此服务帐户及其令牌来点燃工作负载对您很重要。 这样,他们就可以发现群集中的其他节点。

下一个博客重点介绍配置。

翻译自: https://www.javacodegeeks.com/2020/04/apache-ignite-on-your-kubernetes-cluster-part-2-rbac-explained.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值