Skip to content

Commit

Permalink
Installer for the rbac resources
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgraeff committed Feb 25, 2025
1 parent 478d168 commit 883b083
Show file tree
Hide file tree
Showing 18 changed files with 618 additions and 341 deletions.
76 changes: 0 additions & 76 deletions installer/helmdeployer/clusterrole.go

This file was deleted.

51 changes: 0 additions & 51 deletions installer/helmdeployer/clusterrolebinding.go

This file was deleted.

69 changes: 69 additions & 0 deletions installer/helmdeployer/rbac.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package helmdeployer

import (
"github.com/gardener/landscaper/installer/resources"
core "k8s.io/api/core/v1"
rbac "k8s.io/api/rbac/v1"
)

func newServiceAccountMutator(h *valuesHelper) resources.Mutator[*core.ServiceAccount] {
return &resources.ServiceAccountMutator{
Name: h.deployerFullName(),
Namespace: h.hostNamespace(),
Labels: h.deployerLabels(),
}
}

func newClusterRoleBindingMutator(h *valuesHelper) resources.Mutator[*rbac.ClusterRoleBinding] {
return &resources.ClusterRoleBindingMutator{
ClusterRoleBindingName: h.clusterRoleName(),
ClusterRoleName: h.clusterRoleName(),
ServiceAccountName: h.deployerFullName(),
ServiceAccountNamespace: h.hostNamespace(),
Labels: h.deployerLabels(),
}
}

func newClusterRoleMutator(h *valuesHelper) resources.Mutator[*rbac.ClusterRole] {
return &resources.ClusterRoleMutator{
Name: h.clusterRoleName(),
Labels: h.deployerLabels(),
Rules: []rbac.PolicyRule{
{
APIGroups: []string{"landscaper.gardener.cloud"},
Resources: []string{"deployitems", "deployitems/status"},
Verbs: []string{"get", "list", "watch", "update"},
},
{
APIGroups: []string{"landscaper.gardener.cloud"},
Resources: []string{"targets", "contexts"},
Verbs: []string{"get", "list", "watch"},
},
{
APIGroups: []string{"landscaper.gardener.cloud"},
Resources: []string{"syncobjects", "criticalproblems"},
Verbs: []string{"*"},
},
{
APIGroups: []string{""},
Resources: []string{"namespaces", "pods", "configmaps"},
Verbs: []string{"get", "list", "watch"},
},
{
APIGroups: []string{""},
Resources: []string{"secrets"},
Verbs: []string{"get", "list", "watch", "create", "update", "delete"},
},
{
APIGroups: []string{""},
Resources: []string{"serviceaccounts/token"},
Verbs: []string{"create"},
},
{
APIGroups: []string{""},
Resources: []string{"events"},
Verbs: []string{"get", "watch", "create", "update", "patch"},
},
},
}
}
40 changes: 0 additions & 40 deletions installer/helmdeployer/serviceaccount.go

This file was deleted.

76 changes: 0 additions & 76 deletions installer/manifestdeployer/clusterrole.go

This file was deleted.

51 changes: 0 additions & 51 deletions installer/manifestdeployer/clusterrolebinding.go

This file was deleted.

Loading

0 comments on commit 883b083

Please sign in to comment.