- In the below defined block, we are creating two
app
andapi
service principals. - In
app
service principal used Federated credentials ofopszero/app
repo. - In
api
service principal used Federated credentials ofopszero/api
Repo.
module "openid" {
source = "./.."
github = true
sp_name = "testing-sp-name"
repos = {
app = {
repo = "opszero/app"
entity_type = "pull_request" # for branch ref:refs/heads/<branch name>
}
api = {
repo = "opszero/api"
entity_type = "pull_request" # for branch ref:refs/heads/<branch name>
}
}
}
- Get the output of
client_id
. client_id
put it inkubelogin-cluterrole.yml
name section in subjects.
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- Run the command
kubectl apply kubelogin-cluterrole.yml