Skip to content

Instantly share code, notes, and snippets.

@siegy22
Created May 6, 2025 16:57
Show Gist options
  • Save siegy22/632d4601e66f414607eb988de64663e7 to your computer and use it in GitHub Desktop.
Save siegy22/632d4601e66f414607eb988de64663e7 to your computer and use it in GitHub Desktop.
Deploying Cisco ISE on OpenShift Virtualization/Kubevirt

Cisco ISE on OpenShift Virtualization

Ref.

Installation

kubectl scale -n openshift-cnv --replicas=0 deployment/hco-operator
kubectl edit kubevirt/kubevirt-kubevirt-hyperconverged -n openshift-cnv

Enable the Sidecar Feature gate:

kind: KubeVirt
metadata:
  name: kubevirt-kubevirt-hyperconverged
  namespace: openshift-cnv
  # ...
spec:
  # ...
  configuration:
    developerConfiguration:
      featureGates:
      - Sidecar # <-- Add this
      - ...

Add the configmap with the script to replace the product in the SMBIOS xml:

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-config-map
  namespace: ise
data:
  my_script.sh: |
    #!/bin/sh
    tempFile=`mktemp --dry-run`
    echo $4 > $tempFile
    sed -i "s|OpenShift Virtualization|KVM|" $tempFile
    cat $tempFile
EOF

Add the hook annotation in your VM under spec.template.metadata.annotations:

apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: ise
  namespace: ise
spec:
  running: true
  template:
    metadata:
      labels:
        kubevirt.io/domain: ise
      annotations:
        # Add the following annotation:
        hooks.kubevirt.io/hookSidecars: >
            [
              {
                "args": ["--version", "v1alpha2"],
                "configMap": {"name": "my-config-map", "key": "my_script.sh", "hookPath": "/usr/bin/onDefineDomain"}
              }
            ]
    spec:
      # ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment