Skip to content

Commit

Permalink
deploy, kustomize: provide an OpenShift overlay
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Duarte Barroso <[email protected]>
  • Loading branch information
maiqueb committed Feb 4, 2025
1 parent 05b47ce commit 2b0a02e
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
36 changes: 36 additions & 0 deletions config/openshift/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Adds namespace to all resources.
namespace: openshift-kubevirt-ipam-controller-system

labels:
- includeSelectors: true
pairs:
app: ipam-virt-workloads

resources:
- ../rbac
- ../manager
- ../webhook

patches:
- path: manager_webhook_patch.yaml
- path: webhookcainjection_patch.yaml
- patch: |-
- op: add
path: /webhooks/0/objectSelector
value:
matchLabels:
kubevirt.io: virt-launcher
target:
kind: MutatingWebhookConfiguration
group: admissionregistration.k8s.io
version: v1
name: mutating-webhook-configuration
- patch: |-
- op: add
path: /metadata/annotations
value:
service.beta.openshift.io/serving-cert-secret-name: webhook-service
target:
kind: Service
version: v1
name: webhook-service
28 changes: 28 additions & 0 deletions config/openshift/manager_webhook_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
annotations:
openshift.io/required-scc: "restricted-v2"
spec:
template:
spec:
containers:
- name: manager
args:
- --leader-elect
- --certificates-dir=/etc/ipam-controller/certificates
ports:
- containerPort: 9443
name: webhook-server
protocol: TCP
volumeMounts:
- mountPath: /etc/ipam-controller/certificates
name: cert
readOnly: true
volumes:
- name: cert
secret:
defaultMode: 420
secretName: webhook-server-cert
16 changes: 16 additions & 0 deletions config/openshift/webhookcainjection_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This patch add annotation to admission webhook config and
# CERTIFICATE_NAMESPACE and CERTIFICATE_NAME will be substituted by kustomize
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
labels:
app.kubernetes.io/name: mutatingwebhookconfiguration
app.kubernetes.io/instance: mutating-webhook-configuration
app.kubernetes.io/component: webhook
app.kubernetes.io/created-by: kubevirt-ipam-controller
app.kubernetes.io/part-of: kubevirt-ipam-controller
app.kubernetes.io/managed-by: kustomize
name: mutating-webhook-configuration
namespace: openshift-kubevirt-ipam-controller-system
annotations:
service.beta.openshift.io/inject-cabundle: "true"

0 comments on commit 2b0a02e

Please sign in to comment.