Path: blob/main/install/installer/pkg/components/cluster/clusterrole.go
2501 views
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package cluster56import (7"fmt"89"github.com/gitpod-io/gitpod/installer/pkg/common"10v1 "k8s.io/api/rbac/v1"11metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"12"k8s.io/apimachinery/pkg/runtime"13)1415func clusterrole(ctx *common.RenderContext) ([]runtime.Object, error) {16resources := []runtime.Object{17&v1.ClusterRole{18TypeMeta: common.TypeMetaClusterRole,19ObjectMeta: metav1.ObjectMeta{20Name: fmt.Sprintf("%s-kube-rbac-proxy", ctx.Namespace),21},22Rules: []v1.PolicyRule{23{24APIGroups: []string{"authentication.k8s.io"},25Resources: []string{"tokenreviews"},26Verbs: []string{"create"},27},28{29APIGroups: []string{"authorization.k8s.io"},30Resources: []string{"subjectaccessreviews"},31Verbs: []string{"create"},32},33},34},35}3637return resources, nil38}394041