Role
in the namespace for which you will grant permissions and bind a ServiceAccount
to the Role
.apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRolemetadata:name: coding-cd-rolerules:- apiGroups: [""]resources: ["namespaces", "configmaps", "events", "replicationcontrollers", "serviceaccounts", "pods/logs"]verbs: ["get", "list"]- apiGroups: [""]resources: ["pods", "pods/portforward", "services", "services/proxy", "secrets"]verbs: ["*"]- apiGroups: ["autoscaling"]resources: ["horizontalpodautoscalers"]verbs: ["list", "get"]- apiGroups: ["apps"]resources: ["controllerrevisions", "statefulsets"]verbs: ["list"]- apiGroups: ["extensions", "app", "apps"]resources: ["deployments", "replicasets", "ingresses", "daemonsets"]verbs: ["*"]
Service Account
for CODING-CD. The Continuous Deployment console uses the Service Account
to interact with the Kubernetes cluster. You can use the following manifest to create a Service Account
.apiVersion: v1kind: ServiceAccountmetadata:name: coding-cd-service-accountnamespace: default
RoleBinding
to bind the above coding-cd-role
to coding-cd-service-account
.apiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata:name: coding-cd-role-namespace: webapproleRef:apiGroup: rbac.authorization.k8s.iokind: Rolename: coding-cd-rolesubjects:- namespace: defaultkind: ServiceAccountname: coding-cd-service-account
Was this page helpful?