Files
addons/virt/bridges/rbac.tf
2024-09-19 08:37:03 +02:00

51 lines
1.1 KiB
HCL

resource "kubectl_manifest" "sa" {
yaml_body = <<-EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: bridge-marker
namespace: ${var.namespace}
ownerReferences: ${jsonencode(var.install_owner)}
labels: ${jsonencode(local.common-labels)}
EOF
}
resource "kubectl_manifest" "crb" {
yaml_body = <<-EOF
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: bridge-marker-crb
labels: ${jsonencode(local.common-labels)}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: bridge-marker-cr
subjects:
- kind: ServiceAccount
name: bridge-marker
namespace: ${var.namespace}
EOF
}
resource "kubectl_manifest" "cr" {
yaml_body = <<-EOF
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: bridge-marker-cr
labels: ${jsonencode(local.common-labels)}
rules:
- apiGroups:
- ""
resources:
- nodes
- nodes/status
verbs:
- get
- update
- patch
EOF
}