Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OpenShift's required-scc annotation on components #1931

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/kubemacpool/kubemacpool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ spec:
type: Recreate
template:
metadata:
annotations:
openshift.io/required-scc: restricted-v2
labels:
app: kubemacpool
control-plane: cert-manager
Expand Down Expand Up @@ -228,6 +230,7 @@ spec:
metadata:
annotations:
description: KubeMacPool manages MAC allocation to Pods and VMs
openshift.io/required-scc: restricted-v2
labels:
app: kubemacpool
control-plane: mac-controller-manager
Expand Down
3 changes: 3 additions & 0 deletions data/kubevirt-ipam-controller/001-kubevirtipamcontroller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ spec:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
{{ if .IsOpenshift }}
openshift.io/required-scc: "restricted-v2"
{{ end }}
labels:
app: ipam-virt-workloads
control-plane: manager
Expand Down
3 changes: 3 additions & 0 deletions data/kubevirt-ipam-controller/003-passtbindingcni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ spec:
app: passt-binding-cni
annotations:
description: passt-binding-cni installs passt binding CNI on cluster nodes
{{ if .EnableSCC }}
openshift.io/required-scc: "passt-binding-cni"
{{ end }}
spec:
priorityClassName: system-cluster-critical
{{ if .EnableSCC }}
Expand Down
3 changes: 3 additions & 0 deletions data/linux-bridge/002-linux-bridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ spec:
tier: node
app: cni-plugins
annotations:
{{ if .EnableSCC }}
openshift.io/required-scc: "linux-bridge"
{{ end }}
description: LinuxBridge installs 'bridge' CNI on cluster nodes, so it can be later used to attach Pods/VMs to Linux bridges
spec:
{{ if .EnableSCC }}
Expand Down
1 change: 1 addition & 0 deletions data/linux-bridge/003-bridge-marker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
name: bridge-marker
annotations:
description: Bridge marker exposes network bridges available on nodes as node resources
openshift.io/required-scc: "bridge-marker"
spec:
serviceAccountName: bridge-marker
hostNetwork: true
Expand Down
1 change: 1 addition & 0 deletions hack/components/bump-bridge-marker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function __parametize_by_object() {
yaml-utils::update_param ${f} spec.template.spec.containers[0].imagePullPolicy '{{ .ImagePullPolicy }}'
yaml-utils::update_param ${f} spec.template.spec.nodeSelector '{{ toYaml .Placement.NodeSelector | nindent 8 }}'
yaml-utils::set_param ${f} spec.template.spec.affinity '{{ toYaml .Placement.Affinity | nindent 8 }}'
yaml-utils::set_param ${f} 'spec.template.metadata.annotations."openshift.io/required-scc"' '"bridge-marker"'
yaml-utils::update_param ${f} spec.template.spec.tolerations '{{ toYaml .Placement.Tolerations | nindent 8 }}'
yaml-utils::remove_single_quotes_from_yaml ${f}
;;
Expand Down
6 changes: 6 additions & 0 deletions hack/components/bump-kubemacpool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ metadata:
namespace: system
spec:
template:
metadata:
annotations:
openshift.io/required-scc: "restricted-v2"
spec:
containers:
- image: "{{ .KubeMacPoolImage }}"
Expand All @@ -95,6 +98,9 @@ metadata:
namespace: system
spec:
template:
metadata:
annotations:
openshift.io/required-scc: "restricted-v2"
spec:
containers:
- image: "{{ .KubeMacPoolImage }}"
Expand Down
8 changes: 8 additions & 0 deletions hack/components/bump-kubevirt-ipam-controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ echo 'Adjust kubevirt-ipam-controller to CNAO'
service.beta.openshift.io/serving-cert-secret-name: kubevirt-ipam-controller-webhook-service\
{{ end }}' Service_kubevirt-ipam-controller-webhook-service.yaml

sed -i '/ kubectl.kubernetes.io\/default-container: manager/a\{{ if .IsOpenshift }}\
maiqueb marked this conversation as resolved.
Show resolved Hide resolved
openshift.io/required-scc: "restricted-v2"\
{{ end }}' Deployment_kubevirt-ipam-controller-manager.yaml

echo 'rejoin sub-manifests to a final manifest'
cat Namespace_kubevirt-ipam-controller-system.yaml \
ServiceAccount_kubevirt-ipam-controller-manager.yaml \
Expand All @@ -144,6 +148,10 @@ echo 'Adjust kubevirt-ipam-controller to CNAO'
sed -i '/containers:/i\{{ if .EnableSCC }}\
serviceAccountName: passt-binding-cni\
{{ end }}' 003-passtbindingcni.yaml

sed -i '/ description: passt-binding-cni installs passt binding CNI on cluster nodes/a\{{ if .EnableSCC }}\
openshift.io/required-scc: "passt-binding-cni"\
{{ end }}' 003-passtbindingcni.yaml
)

echo 'Copy manifests'
Expand Down
Loading