Skip to content

Commit 1e392e3

Browse files
Remove PodSecurityPolicy in Installer
1 parent 62153d3 commit 1e392e3

File tree

15 files changed

+8
-299
lines changed

15 files changed

+8
-299
lines changed

installer/pkg/components/alertmanager/role.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"k8s.io/apimachinery/pkg/runtime"
77

88
"github.com/gitpod-io/observability/installer/pkg/common"
9-
"github.com/gitpod-io/observability/installer/pkg/components/shared"
109
)
1110

1211
func role(ctx *common.RenderContext) ([]runtime.Object, error) {
@@ -21,14 +20,7 @@ func role(ctx *common.RenderContext) ([]runtime.Object, error) {
2120
Namespace: Namespace,
2221
Labels: common.Labels(Name, Component, App, Version),
2322
},
24-
Rules: []rbacv1.PolicyRule{
25-
{
26-
APIGroups: []string{"policy"},
27-
Resources: []string{"podsecuritypolicies"},
28-
Verbs: []string{"use"},
29-
ResourceNames: []string{shared.RestrictedPodsecurityPolicyName()},
30-
},
31-
},
23+
Rules: []rbacv1.PolicyRule{},
3224
},
3325
}, nil
3426
}

installer/pkg/components/components.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/gitpod-io/observability/installer/pkg/components/prometheus"
1313
prometheusoperator "github.com/gitpod-io/observability/installer/pkg/components/prometheus-operator"
1414
"github.com/gitpod-io/observability/installer/pkg/components/pyrra"
15-
"github.com/gitpod-io/observability/installer/pkg/components/shared"
1615
"github.com/gitpod-io/observability/installer/pkg/components/werft"
1716
)
1817

@@ -33,6 +32,5 @@ func MonitoringSatelliteObjects(ctx *common.RenderContext) common.RenderFunc {
3332
gitpod.Objects(ctx),
3433
certmanager.Objects(ctx),
3534
kubernetes.Objects,
36-
shared.Objects,
3735
)
3836
}

installer/pkg/components/kubestate-metrics/clusterrole.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,6 @@ func clusterRole(ctx *common.RenderContext) ([]runtime.Object, error) {
126126
Resources: []string{"subjectaccessreviews"},
127127
Verbs: []string{"create"},
128128
},
129-
{
130-
APIGroups: []string{"policy"},
131-
Resources: []string{"podsecuritypolicies"},
132-
Verbs: []string{"use"},
133-
ResourceNames: []string{Name},
134-
},
135129
},
136130
},
137131
}, nil

installer/pkg/components/kubestate-metrics/objects.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ var Objects = common.CompositeRenderFunc(
88
clusterRole,
99
clusterRoleBinding,
1010
deployment,
11-
podsecuritypolicy,
1211
service,
1312
serviceAccount,
1413
serviceMonitor,

installer/pkg/components/kubestate-metrics/podsecuritypolicy.go

Lines changed: 0 additions & 60 deletions
This file was deleted.

installer/pkg/components/node-exporter/clusterrole.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ func clusterRole(ctx *common.RenderContext) ([]runtime.Object, error) {
3030
Resources: []string{"subjectaccessreviews"},
3131
Verbs: []string{"create"},
3232
},
33-
{
34-
APIGroups: []string{"policy"},
35-
Resources: []string{"podsecuritypolicies"},
36-
Verbs: []string{"use"},
37-
ResourceNames: []string{Name},
38-
},
3933
},
4034
},
4135
}, nil

installer/pkg/components/node-exporter/objects.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ var Objects = common.CompositeRenderFunc(
88
clusterRole,
99
clusterRoleBinding,
1010
daemonset,
11-
podsecuritypolicy,
1211
service,
1312
serviceAccount,
1413
serviceMonitor,

installer/pkg/components/node-exporter/podsecuritypolicy.go

Lines changed: 0 additions & 79 deletions
This file was deleted.

installer/pkg/components/otel-collector/clusterrole.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,7 @@ func clusterRole(ctx *common.RenderContext) ([]runtime.Object, error) {
1919
Name: Name,
2020
Labels: common.Labels(Name, Component, App, Version),
2121
},
22-
Rules: []rbacv1.PolicyRule{
23-
{
24-
APIGroups: []string{"policy"},
25-
Resources: []string{"podsecuritypolicies"},
26-
Verbs: []string{"use"},
27-
ResourceNames: []string{Name},
28-
},
29-
},
22+
Rules: []rbacv1.PolicyRule{},
3023
},
3124
}, nil
3225
}

installer/pkg/components/otel-collector/objects.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ func Objects(ctx *common.RenderContext) common.RenderFunc {
2121
clusterRoleBinding,
2222
configMap,
2323
deployment,
24-
podsecuritypolicy,
2524
service,
2625
serviceAccount,
2726
serviceMonitor,

installer/pkg/components/otel-collector/podsecuritypolicy.go

Lines changed: 0 additions & 40 deletions
This file was deleted.

installer/pkg/components/prometheus-operator/clusterrole.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"k8s.io/apimachinery/pkg/runtime"
77

88
"github.com/gitpod-io/observability/installer/pkg/common"
9-
"github.com/gitpod-io/observability/installer/pkg/components/shared"
109
)
1110

1211
func clusterRole(ctx *common.RenderContext) ([]runtime.Object, error) {
@@ -84,12 +83,12 @@ func clusterRole(ctx *common.RenderContext) ([]runtime.Object, error) {
8483
Resources: []string{"subjectaccessreviews"},
8584
Verbs: []string{"create"},
8685
},
87-
{
88-
APIGroups: []string{"policy"},
89-
Resources: []string{"podsecuritypolicies"},
90-
Verbs: []string{"use"},
91-
ResourceNames: []string{shared.RestrictedPodsecurityPolicyName()},
92-
},
86+
// {
87+
// APIGroups: []string{"policy"},
88+
// Resources: []string{"podsecuritypolicies"},
89+
// Verbs: []string{"use"},
90+
// ResourceNames: []string{shared.RestrictedPodsecurityPolicyName()},
91+
// },
9392
},
9493
},
9594
}, nil

installer/pkg/components/prometheus/clusterrole.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"k8s.io/apimachinery/pkg/runtime"
77

88
"github.com/gitpod-io/observability/installer/pkg/common"
9-
"github.com/gitpod-io/observability/installer/pkg/components/shared"
109
)
1110

1211
func clusterRole(ctx *common.RenderContext) ([]runtime.Object, error) {
@@ -40,12 +39,6 @@ func clusterRole(ctx *common.RenderContext) ([]runtime.Object, error) {
4039

4140
Verbs: []string{"get"},
4241
},
43-
{
44-
APIGroups: []string{"policy"},
45-
Resources: []string{"podsecuritypolicies"},
46-
Verbs: []string{"use"},
47-
ResourceNames: []string{shared.RestrictedPodsecurityPolicyName()},
48-
},
4942
},
5043
},
5144
}, nil

installer/pkg/components/shared/objects.go

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)