Skip to content

Commit

Permalink
Merge pull request #2335 from liouk/required-scc
Browse files Browse the repository at this point in the history
AUTH-482: set required-scc for openshift workloads
  • Loading branch information
openshift-merge-bot[bot] committed May 3, 2024
2 parents 77f948e + bb1c14f commit f7eb1eb
Show file tree
Hide file tree
Showing 30 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/admission-webhook/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
metadata:
annotations:
kubectl.kubernetes.io/default-container: prometheus-operator-admission-webhook
openshift.io/required-scc: restricted-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
Expand Down
1 change: 1 addition & 0 deletions assets/alertmanager/alertmanager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ spec:
kubernetes.io/os: linux
podMetadata:
annotations:
openshift.io/required-scc: nonroot
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: alert-router
Expand Down
1 change: 1 addition & 0 deletions assets/kube-state-metrics/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
metadata:
annotations:
kubectl.kubernetes.io/default-container: kube-state-metrics
openshift.io/required-scc: restricted-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: exporter
Expand Down
1 change: 1 addition & 0 deletions assets/monitoring-plugin/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
template:
metadata:
annotations:
openshift.io/required-scc: restricted-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: monitoring-plugin
Expand Down
1 change: 1 addition & 0 deletions assets/node-exporter/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
metadata:
annotations:
kubectl.kubernetes.io/default-container: node-exporter
openshift.io/required-scc: node-exporter
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: exporter
Expand Down
1 change: 1 addition & 0 deletions assets/openshift-state-metrics/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
template:
metadata:
annotations:
openshift.io/required-scc: restricted-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: exporter
Expand Down
1 change: 1 addition & 0 deletions assets/prometheus-adapter/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
metadata:
annotations:
checksum.config/md5: c7fb4696aad1a53eaad3f90f16b9905b
openshift.io/required-scc: restricted-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: metrics-adapter
Expand Down
1 change: 1 addition & 0 deletions assets/prometheus-k8s/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ spec:
kubernetes.io/os: linux
podMetadata:
annotations:
openshift.io/required-scc: nonroot
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: prometheus
Expand Down
1 change: 1 addition & 0 deletions assets/prometheus-operator-user-workload/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
metadata:
annotations:
kubectl.kubernetes.io/default-container: prometheus-operator
openshift.io/required-scc: restricted-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: controller
Expand Down
1 change: 1 addition & 0 deletions assets/prometheus-operator/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
metadata:
annotations:
kubectl.kubernetes.io/default-container: prometheus-operator
openshift.io/required-scc: restricted-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: controller
Expand Down
1 change: 1 addition & 0 deletions assets/prometheus-user-workload/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ spec:
overrideHonorTimestamps: true
podMetadata:
annotations:
openshift.io/required-scc: nonroot-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: prometheus
Expand Down
1 change: 1 addition & 0 deletions assets/telemeter-client/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
template:
metadata:
annotations:
openshift.io/required-scc: restricted-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: telemetry-metrics-collector
Expand Down
1 change: 1 addition & 0 deletions assets/thanos-querier/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spec:
template:
metadata:
annotations:
openshift.io/required-scc: restricted-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app.kubernetes.io/component: query-layer
Expand Down
1 change: 1 addition & 0 deletions assets/thanos-ruler/thanos-ruler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ spec:
listenLocal: true
podMetadata:
annotations:
openshift.io/required-scc: nonroot-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
priorityClassName: openshift-user-critical
queryConfig:
Expand Down
3 changes: 3 additions & 0 deletions jsonnet/components/admission-webhook.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ function(params)
labels+: {
'app.kubernetes.io/managed-by': 'cluster-monitoring-operator',
},
annotations+: {
'openshift.io/required-scc': 'restricted-v2',
},
},
spec+: {
// TODO(simonpasquier): configure client certificate authority to
Expand Down
5 changes: 5 additions & 0 deletions jsonnet/components/alertmanager.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ function(params)
},
},
spec+: {
podMetadata+: {
annotations+: {
'openshift.io/required-scc': 'nonroot',
},
},
securityContext: {
fsGroup: 65534,
runAsNonRoot: true,
Expand Down
3 changes: 3 additions & 0 deletions jsonnet/components/kube-state-metrics.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ function(params)
labels+: {
'app.kubernetes.io/managed-by': 'cluster-monitoring-operator',
},
annotations+: {
'openshift.io/required-scc': 'restricted-v2',
},
},
spec+: {
containers:
Expand Down
1 change: 1 addition & 0 deletions jsonnet/components/monitoring-plugin.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ function(params)
metadata: $.metadata(noName=true, noNamespace=true) + {
annotations: {
'target.workload.openshift.io/management': '{"effect": "PreferredDuringScheduling"}',
'openshift.io/required-scc': 'restricted-v2',
},
},
spec: {
Expand Down
3 changes: 3 additions & 0 deletions jsonnet/components/node-exporter.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ function(params)
labels+: {
'app.kubernetes.io/managed-by': 'cluster-monitoring-operator',
},
annotations+: {
'openshift.io/required-scc': 'node-exporter',
},
},
spec+: {
initContainers+: [
Expand Down
3 changes: 3 additions & 0 deletions jsonnet/components/openshift-state-metrics.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function(params) {
labels+: {
'app.kubernetes.io/managed-by': 'cluster-monitoring-operator',
} + cfg.commonLabels,
annotations+: {
'openshift.io/required-scc': 'restricted-v2',
},
},
spec+: {
containers:
Expand Down
3 changes: 3 additions & 0 deletions jsonnet/components/prometheus-adapter.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ function(params)
labels+: {
'app.kubernetes.io/managed-by': 'cluster-monitoring-operator',
},
annotations+: {
'openshift.io/required-scc': 'restricted-v2',
},
},
spec+: {
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ function(params)
labels+: {
'app.kubernetes.io/managed-by': 'cluster-monitoring-operator',
},
annotations+: {
'openshift.io/required-scc': 'restricted-v2',
},
},
spec+: {
nodeSelector+: {
Expand Down
3 changes: 3 additions & 0 deletions jsonnet/components/prometheus-operator.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ function(params)
labels+: {
'app.kubernetes.io/managed-by': 'cluster-monitoring-operator',
},
annotations+: {
'openshift.io/required-scc': 'restricted-v2',
},
},
spec+: {
nodeSelector+: {
Expand Down
5 changes: 5 additions & 0 deletions jsonnet/components/prometheus-user-workload.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ function(params)
super.alertmanagers,
),
},
podMetadata+: {
annotations+: {
'openshift.io/required-scc': 'nonroot-v2',
},
},
securityContext: {
fsGroup: 65534,
runAsNonRoot: true,
Expand Down
5 changes: 5 additions & 0 deletions jsonnet/components/prometheus.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ function(params)
},
},
},
podMetadata+: {
annotations+: {
'openshift.io/required-scc': 'nonroot',
},
},
securityContext: {
fsGroup: 65534,
runAsNonRoot: true,
Expand Down
3 changes: 3 additions & 0 deletions jsonnet/components/telemeter-client.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ function(params) {
labels+: {
'app.kubernetes.io/managed-by': 'cluster-monitoring-operator',
} + cfg.commonLabels,
annotations+: {
'openshift.io/required-scc': 'restricted-v2',
},
},
spec+: {
containers:
Expand Down
3 changes: 3 additions & 0 deletions jsonnet/components/thanos-querier.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ function(params)
labels+: {
'app.kubernetes.io/managed-by': 'cluster-monitoring-operator',
},
annotations+: {
'openshift.io/required-scc': 'restricted-v2',
},
},
spec+: {
// TODO(slashpai): remove once new kube-thanos is released which has this change
Expand Down
5 changes: 5 additions & 0 deletions jsonnet/components/thanos-ruler.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ function(params)
}],
},
},
podMetadata+: {
annotations+: {
'openshift.io/required-scc': 'nonroot-v2',
},
},
securityContext: {
fsGroup: 65534,
runAsNonRoot: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spec:
template:
metadata:
annotations:
openshift.io/required-scc: restricted-v2
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app: cluster-monitoring-operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
app.kubernetes.io/name: cluster-monitoring-operator
annotations:
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
openshift.io/required-scc: restricted-v2
spec:
serviceAccountName: cluster-monitoring-operator
nodeSelector:
Expand Down

0 comments on commit f7eb1eb

Please sign in to comment.