您有一个正在运行的缓存服务,但是您所做的只是安装了头盔图表。
在此博客中,我们将评估已安装的产品并为我们的期货掌舵图做笔记。
第一步是查看舵图。
> 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
使用此服务帐户及其令牌来点燃工作负载对您很重要。 这样,他们就可以发现群集中的其他节点。
下一个博客重点介绍配置。