Skip to content

Single Node OpenShift on OpenShift Virtualization

DNS Records

Create DNS Records to VM IP

  • api-int.cluster-name.baseDomain
  • api.cluster-name.baseDomain
  • *.apps.cluster-name.baseDomain

Installations

Official documentation: https://docs.openshift.com/container-platform/latest/installing/installing_sno/install-sno-installing-sno.html

apiVersion: v1
baseDomain: coe.muc.redhat.com
compute:
  - name: worker
    replicas: 0
controlPlane:
  name: master
  replicas: 1
metadata:
  name: sno-on-ocpv
networking:
  clusterNetwork:
    - cidr: 10.132.0.0/14
      hostPrefix: 23
  machineNetwork:
    - cidr: 10.128.0.0/14
  networkType: OVNKubernetes
  serviceNetwork:
    - 172.31.0.0/16
platform:
  none: {}
bootstrapInPlace:
  installationDisk: /dev/vda
pullSecret: |
  {"auths":{"cloud.openshift.com":{"auth":"b3BlbnNoaWZ0LXJlbGVhc2UtZGV2K3Jib2huZTFlY3hxbWhwamQ4bnU0cWk1NmNtc200NGh2ejpRUzlTNDM4TU5LVk1JSlhGR0xSVzZBSFZTMjdLTzBSV05NU0ZaSkRPUFVOQVkxR04xM0JDRzY0RUYzU1dGTVQx","email":"rbohne@redhat.com"},"quay.io":{"auth":"b3BlbnNoaWZ0LXJlbGVhc2UtZGV2K3Jib2huZTFlY3hxbWhwamQ4bnU0cWk1NmNtc200NGh2ejpRUzlTNDM4TU5LVk1JSlhGR0xSVzZBSFZTMjdLTzBSV05NU0ZaSkRPUFVOQVkxR04xM0JDRzY0RUYzU1dGTVQx","email":"rbohne@redhat.com"},"registry.connect.redhat.com":{"auth":"NTIxNzMzNzZ8dWhjLTFFQ3hxTUhQSkQ4TnU0cWk1NkNNU000NGh2ejpleUpoYkdjaU9pSlNVelV4TWlKOS5leUp6ZFdJaU9pSmhZV001T0RKbVkyTm1PRFUwT1RaaFlUSTVaRFl6WkdFd1pUSmtaRFZoTmlKOS5sRy1DVmpLd2xKQUczMzFCY3F5dVloRXg3cHF6V2FDT1ZmdnBOSW45OGp1eDhXQXdPT0dzSGVvdlBrZU13RjJIOFd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ohne@redhat.com
curl -L -O https://examples.openshift.pub/cluster-installation/sno-on-ocpv//install-config.yaml

Create ignition config & Upload it

openshift-install --dir=ocp create single-node-ignition-config

Preare installation ISO

curl -L -O https://mirror.openshift.com/pub/openshift-v4/x86_64/dependencies/rhcos/4.14/4.14.0/rhcos-4.14.0-x86_64-live.x86_64.iso

alias coreos-installer='podman run --privileged --pull always --rm -v /dev:/dev -v /run/udev:/run/udev -v $PWD:/data -w /data quay.io/coreos/coreos-installer:release'

coreos-installer iso ignition embed -fi ocp/bootstrap-in-place-for-live-iso.ign rhcos-4.14.0-x86_64-live.x86_64.iso

virtctl image-upload pvc live-iso-sno  \
  --size 2Gi --storage-class ocs-storagecluster-ceph-rbd \
  --access-mode ReadWriteOnce \
  --image-path rhcos-4.14.0-x86_64-live.x86_64.iso

Create VM

apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  annotations:
  labels:
    app: sno1-rbohne-demo
  name: sno1-rbohne-demo
spec:
  dataVolumeTemplates:
    - metadata:
        name: sno1-rbohne-demo-root
      spec:
        storage:
          accessModes:
            - ReadWriteMany
          storageClassName: ocs-storagecluster-ceph-rbd-virtualization
          resources:
            requests:
              storage: 120Gi
        source:
          blank: {}
  running: true
  template:
    metadata:
      labels:
        kubevirt.io/domain: sno1-rbohne-demo
    spec:
      volumes:
        - name: cdrom
          persistentVolumeClaim:
            claimName: live-iso-sno
        - name: root
          dataVolume:
            name: sno1-rbohne-demo-root
      networks:
        - name: coe
          multus:
            networkName: coe-bridge
      domain:
        cpu:
          cores: 8
        memory:
          guest: 64Gi
        resources:
          requests:
            memory: 64Gi
        devices:
          disks:
            - name: root
              bootOrder: 1
              disk:
                bus: virtio
            - name: cdrom
              bootOrder: 2
              cdrom:
                bus: sata
          interfaces:
            - bridge: {}
              model: virtio
              name: coe
oc apply -f https://examples.openshift.pub/cluster-installation/sno-on-ocpv//vm.yaml

2024-01-04 2024-01-04 Contributors: Robert Bohne