2021-01-19 22:23:06 +00:00
|
|
|
#! Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
|
2020-10-06 00:28:19 +00:00
|
|
|
#! SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
#@ load("@ytt:data", "data")
|
2021-01-19 22:23:06 +00:00
|
|
|
#@ load("helpers.lib.yaml", "labels", "namespace", "defaultResourceName", "defaultResourceNameWithSuffix", "pinnipedDevAPIGroupWithPrefix")
|
2020-10-06 00:28:19 +00:00
|
|
|
|
|
|
|
#! Give permission to various objects within the app's own namespace
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: Role
|
|
|
|
metadata:
|
2020-10-14 22:05:42 +00:00
|
|
|
name: #@ defaultResourceName()
|
|
|
|
namespace: #@ namespace()
|
|
|
|
labels: #@ labels()
|
2020-10-06 00:28:19 +00:00
|
|
|
rules:
|
2020-10-14 13:47:34 +00:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources: [secrets]
|
|
|
|
verbs: [create, get, list, patch, update, watch, delete]
|
2021-01-19 22:23:06 +00:00
|
|
|
- apiGroups:
|
|
|
|
- #@ pinnipedDevAPIGroupWithPrefix("config.supervisor")
|
2020-12-16 22:27:09 +00:00
|
|
|
resources: [federationdomains]
|
2021-02-10 23:02:18 +00:00
|
|
|
verbs: [get, list, watch]
|
|
|
|
- apiGroups:
|
|
|
|
- #@ pinnipedDevAPIGroupWithPrefix("config.supervisor")
|
|
|
|
resources: [federationdomains/status]
|
|
|
|
verbs: [get, patch, update]
|
2021-01-19 22:23:06 +00:00
|
|
|
- apiGroups:
|
|
|
|
- #@ pinnipedDevAPIGroupWithPrefix("idp.supervisor")
|
2020-12-16 22:27:09 +00:00
|
|
|
resources: [oidcidentityproviders]
|
2020-10-23 02:03:46 +00:00
|
|
|
verbs: [get, list, watch]
|
2021-01-19 22:23:06 +00:00
|
|
|
- apiGroups:
|
|
|
|
- #@ pinnipedDevAPIGroupWithPrefix("idp.supervisor")
|
2020-12-16 22:27:09 +00:00
|
|
|
resources: [oidcidentityproviders/status]
|
2020-10-23 02:03:46 +00:00
|
|
|
verbs: [get, patch, update]
|
2021-04-14 00:26:53 +00:00
|
|
|
- apiGroups:
|
|
|
|
- #@ pinnipedDevAPIGroupWithPrefix("idp.supervisor")
|
|
|
|
resources: [ldapidentityproviders]
|
|
|
|
verbs: [get, list, watch]
|
|
|
|
- apiGroups:
|
|
|
|
- #@ pinnipedDevAPIGroupWithPrefix("idp.supervisor")
|
|
|
|
resources: [ldapidentityproviders/status]
|
|
|
|
verbs: [get, patch, update]
|
2020-12-11 16:11:49 +00:00
|
|
|
#! We want to be able to read pods/replicasets/deployment so we can learn who our deployment is to set
|
|
|
|
#! as an owner reference.
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: [pods]
|
|
|
|
verbs: [get]
|
|
|
|
- apiGroups: [apps]
|
|
|
|
resources: [replicasets,deployments]
|
|
|
|
verbs: [get]
|
2021-08-18 04:14:38 +00:00
|
|
|
- apiGroups: [ coordination.k8s.io ]
|
|
|
|
resources: [ leases ]
|
|
|
|
verbs: [ create, get, update ]
|
2020-10-06 00:28:19 +00:00
|
|
|
---
|
|
|
|
kind: RoleBinding
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
metadata:
|
2020-10-14 22:05:42 +00:00
|
|
|
name: #@ defaultResourceName()
|
|
|
|
namespace: #@ namespace()
|
|
|
|
labels: #@ labels()
|
2020-10-06 00:28:19 +00:00
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
2020-10-14 22:05:42 +00:00
|
|
|
name: #@ defaultResourceName()
|
|
|
|
namespace: #@ namespace()
|
2020-10-06 00:28:19 +00:00
|
|
|
roleRef:
|
|
|
|
kind: Role
|
2020-10-14 22:05:42 +00:00
|
|
|
name: #@ defaultResourceName()
|
2020-10-06 00:28:19 +00:00
|
|
|
apiGroup: rbac.authorization.k8s.io
|