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

Kustomize openshift #91

Open
wants to merge 1 commit 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
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oshoval / @qinqon should this be openshift-cnv ??

I don't think so, since this method of installation is just for testing this works without having to grab the whole CNV bundle (i.e. smoke tests, assert this deploys, etc).

Copy link
Collaborator

@oshoval oshoval Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you can just do whatever ns you want
less kustomize = better imho (no kustomize at all = best)

if it helps, this worked for me i think
https://gist.github.com/oshoval/d5db815ebea60eb1777a838bee0530b9#file-gistfile1-txt-L14

might just need to add the scc fix for 4.19


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"
Loading