kubeasz/roles/helm/templates/helm-rbac.yaml.j2

38 lines
809 B
Plaintext
Raw Normal View History

2018-05-23 13:54:41 +08:00
# 限制helm应用只允许部署在指定namespace
# 可以配合NetworkPolicy等实现namespace间网络完全隔离
---
apiVersion: v1
kind: Namespace
metadata:
name: {{ helm_namespace }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ tiller_sa }}
namespace: {{ helm_namespace }}
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: tiller-manager
namespace: {{ helm_namespace }}
rules:
- apiGroups: ["", "extensions", "apps"]
resources: ["*"]
verbs: ["*"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: tiller-binding
namespace: {{ helm_namespace }}
subjects:
- kind: ServiceAccount
name: {{ tiller_sa }}
namespace: {{ helm_namespace }}
roleRef:
kind: Role
name: tiller-manager
apiGroup: rbac.authorization.k8s.io