Step: ipi-conf-azure-arcconformance-region

Patch region of the Arc Enabled Kubernetes Validation Program[1] suite. [1] https://github.com/Azure/azure-arc-validation.

Container image used for this step: azure/ci-base:latest

azure/ci-base:latest resolves to an image imported from the specified imagestream tag on the build farm (documentation).

Environment

In addition to the default environment, the step exposes the following:

Variable Name Type Variable Content
AZURE_ARC_REGIONS Parameter[?] (default: eastus westcentralus southcentralus southeastasia uksouth australiaeast eastus2 westeurope westus2 northeurope)

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
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
set -o nounset
set -o errexit
set -o pipefail

# TODO remove this step once Arc is available in more regions.

if [[ -z ${LEASED_RESOURCE:-} ]]; then
    echo "LEASED_RESOURCE is undefined"
    exit 1
fi

# If an Azure region is provided, check to see if that region matches the lease.
if [[ ! -z ${AZURE_REGION:-} ]]; then    
    if [[ "$LEASED_RESOURCE" != "$AZURE_REGION" ]]; then
        echo Intended AZURE_REGION $AZURE_REGION does not match LEASED_RESOURCE $LEASED_RESOURCE   
        exit 0 
    fi
fi

# If not, check to see if there is an allowed region list to check
if [[ ! -z ${AZURE_ARC_REGIONS:-} ]]; then    
    IFS=" " read -r -a AZURE_ARC_REGIONS <<< "$AZURE_ARC_REGIONS"   

    for ALLOWED_REGION in "${AZURE_ARC_REGIONS[@]}"; do        
        if [ $ALLOWED_REGION == $LEASED_RESOURCE ]; then
            echo "Leased region $LEASED_RESOURCE is enabled for ARC. Allowing use of that lease."
            AZURE_REGION=$LEASED_RESOURCE
            break
        fi        
    done

    if [[ -z ${AZURE_REGION:-} ]]; then
        # Select a region at random since the LEASED_RESOURCE is not allowed
        AZURE_REGION=${AZURE_ARC_REGIONS[$RANDOM % ${#AZURE_ARC_REGIONS[@]}]}
        echo "================================================"
        echo "Azure Arc-enabled Kubernetes clusters are not" 
        echo "available in ${LEASED_RESOURCE}."
        echo "Patching region to ${AZURE_REGION}..."
        echo "================================================"
    fi
fi

if [[ -z ${AZURE_REGION:-} ]]; then
    # Nothing to do.
    exit 0
fi

CONFIG="${SHARED_DIR}/install-config.yaml"
COMPUTE_NODE_TYPE="Standard_D4s_v3"
cat >> "${CONFIG}" << EOF
baseDomain: ci.azure.devcluster.openshift.com
compute:
- name: worker
  platform:
    azure:
      type: ${COMPUTE_NODE_TYPE}
platform:
  azure:
    baseDomainResourceGroupName: os4-common
    region: ${AZURE_REGION}
EOF

Properties

Property Value Description
Resource requests (cpu) 100m 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/azure/arcconformance/region/ipi-conf-azure-arcconformance-region-ref.yaml

Owners:

Approvers:

Source code for this page located on GitHub