Bootstrap

k8s pod 中通过service account 访问API Server

创建Role,Rolebinding, Service account 和Pod

创建Role

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  namespace: myns
  name: myrole
rules:
- apiGroups: ["apps"]
  resources: ["deployments"]
  verbs: ["get", "list", "watch","create","update", "delete"]

- apiGroups: [""] 
  resources: ["pods", "configmaps"]
  verbs: ["get", "list", "watch","create","update", "delete"]

创建Rolebinding

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: myrolebinding
  namespace: myns
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: myrole
subjects:
- kind: ServiceAccount
  name: mysa
  namespace: myns

创建Service Account

<

悦读

道可道,非常道;名可名,非常名。 无名,天地之始,有名,万物之母。 故常无欲,以观其妙,常有欲,以观其徼。 此两者,同出而异名,同谓之玄,玄之又玄,众妙之门。

;