Step: ipi-conf-kubevirt

This step configures an install-config.yaml file to depoloy to the KUBEVIRT project. An existing install-config.yaml file should already exist in the shared directory. The file is modified to configure the cluster to run in the KUBEVIRT project. The resulting file remains in the shared directory for future consumption.

Container image used for this step: origin/centos:8

origin/centos:8 resolves to an image imported from the specified imagestream tag on the build farm (documentation).

Environment

Step exposes no environmental variables except the defaults.

Source Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

# ensure LEASED_RESOURCE is set
if [[ -z "${LEASED_RESOURCE}" ]]; then
  echo "Failed to acquire lease"
  exit 1
fi

echo "Tenant cluster: ${LEASED_RESOURCE}"

HOME=/tmp
CONFIG="${SHARED_DIR}/install-config.yaml"

KUBEVIRT_BASE_DOMAIN="ci.ocpcnv.ovirt.org"
KUBEVIRT_API_VIP=$(<"${HOME}/secret-kube/${LEASED_RESOURCE}-api-vip")
KUBEVIRT_INGRESS_VIP=$(<"${HOME}/secret-kube/${LEASED_RESOURCE}-ingress-vip")
KUBEVIRT_CIDR="10.123.124.0/24"
CLUSTER_NETWORK_CIDR="10.128.0.0/14"
SERVICE_NETWORK_CIDR="172.30.0.0/16"
KUBEVIRT_NAMESPACE=ipi-ci
KUBEVIRT_TENANT_CLUSTER_NAME=$(<"${HOME}/secret-kube/${LEASED_RESOURCE}-cluster-name")
KUBEVIRT_NETWORK_NAME=mynet
KUBEVIRT_VOLUME_ACCESS_MODE=ReadWriteOnce

cat >> "${CONFIG}" << EOF
apiVersion: v1
baseDomain: ${KUBEVIRT_BASE_DOMAIN}
metadata:
  name: ${KUBEVIRT_TENANT_CLUSTER_NAME}
networking:
  clusterNetwork:
  - cidr: ${CLUSTER_NETWORK_CIDR}
    hostPrefix: 23
  machineNetwork:
  - cidr: ${KUBEVIRT_CIDR}
  serviceNetwork:
  - ${SERVICE_NETWORK_CIDR}
platform:
  kubevirt:
    # TODO this section is WIP - see the installer PR
    ingressVIP: ${KUBEVIRT_INGRESS_VIP}
    apiVIP: ${KUBEVIRT_API_VIP}
    namespace: ${KUBEVIRT_NAMESPACE}
    networkName: ${KUBEVIRT_NETWORK_NAME}
    persistentVolumeAccessMode: ${KUBEVIRT_VOLUME_ACCESS_MODE}
EOF

Properties

Property Value Description
Resource requests (cpu) 10m Used in .resources.requests of the pod running this step.
Resource requests (memory) 100Mi Used in .resources.requests of the pod running this step.

GitHub Link:

https://github.com/openshift/release/blob/master/ci-operator/step-registry/ipi/conf/kubevirt/ipi-conf-kubevirt-ref.yaml

Owners:

Approvers:

Source code for this page located on GitHub