Add agent-dns RBAC: static SA + ClusterRole + per-namespace RoleBindings #332
@@ -0,0 +1,16 @@
|
||||
---
|
||||
# Confines the agent-dns service account (in bind-system) to the agent-dns
|
||||
# ClusterRole within this namespace.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: agent-dns
|
||||
namespace: bind-external
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: agent-dns
|
||||
namespace: bind-system
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: agent-dns
|
||||
@@ -7,3 +7,4 @@ resources:
|
||||
- cluster.yaml
|
||||
- tsigkey.yaml
|
||||
- zones.yaml
|
||||
- agent-dns-rolebinding.yaml
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
# Confines the agent-dns service account (in bind-system) to the agent-dns
|
||||
# ClusterRole within this namespace.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: agent-dns
|
||||
namespace: bind-internal
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: agent-dns
|
||||
namespace: bind-system
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: agent-dns
|
||||
@@ -8,3 +8,4 @@ resources:
|
||||
- resolvers
|
||||
- externaldns
|
||||
- tsig-api
|
||||
- agent-dns-rolebinding.yaml
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
# Static service account that Vault's kubernetes secret engine mints scoped
|
||||
# tokens for (agent-dns role). RBAC is confined to the bind namespaces via the
|
||||
# per-namespace RoleBindings below, not a ClusterRoleBinding.
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: agent-dns
|
||||
namespace: bind-system
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: agent-dns
|
||||
rules:
|
||||
- apiGroups: ["bind.unkin.net"]
|
||||
resources: ["*"]
|
||||
verbs: ["*"]
|
||||
- apiGroups: [""]
|
||||
resources: ["pods", "services", "configmaps", "events"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["pods/log"]
|
||||
verbs: ["get"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: agent-dns
|
||||
namespace: bind-system
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: agent-dns
|
||||
namespace: bind-system
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: agent-dns
|
||||
@@ -8,5 +8,6 @@ resources:
|
||||
# vendored here, so they never drift from the operator.
|
||||
- https://git.unkin.net/unkin/bind-operator/raw/tag/v0.2.6/config/crd/install.yaml
|
||||
- rbac.yaml
|
||||
- agent-dns-rbac.yaml
|
||||
- deployment.yaml
|
||||
- vpa.yaml
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
# Confines the agent-dns service account (in bind-system) to the agent-dns
|
||||
# ClusterRole within this namespace.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: agent-dns
|
||||
namespace: externaldns
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: agent-dns
|
||||
namespace: bind-system
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: agent-dns
|
||||
@@ -6,3 +6,4 @@ resources:
|
||||
- namespace.yaml
|
||||
- vaultauth.yaml
|
||||
- vaultstaticsecret.yaml
|
||||
- agent-dns-rolebinding.yaml
|
||||
|
||||
Reference in New Issue
Block a user