Step: openstack-conf-creatednsrecords

This steps creates the required dns records for the ingress and api FIPS. Expects the following to exist ${SHARED_DIR}/API_IP, ${SHARED_DIR}/INGRESS_IP, and ${SHARED_DIR}/CLUSTER_NAME. Creates ${SHARED_DIR}/api-record.json and ${SHARED_DIR}/ingress-record.json.

Container image used for this step: openstack-installer

openstack-installer resolves to an image built or imported by the ci-operator configuration (documentation).

Environment

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

Variable Name Type Variable Content
BASE_DOMAIN Parameter[?]
CONFIG_TYPE Parameter[?] The type of config for the environment to deploy. * 'minimal' - Configure the install-config with the minimal options to make it work on our tests, which requires the usage of floating IPs. This config type doesn't require a proxy server to be deployed. * 'byon' - Configure the install-config to use a pre-created network (BYON) so it wouln't require the usage of floating IPs. This config type will require a proxy server to be deployed. * 'proxy' - Configure the install-config to use a pre-created restricted network (BYON) and a Cluster Proxy.

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
#!/usr/bin/env bash

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

export AWS_SHARED_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/.awscred"

export AWS_DEFAULT_REGION=us-east-1
export AWS_DEFAULT_OUTPUT=json
export AWS_PROFILE=profile

CLUSTER_NAME=$(<"${SHARED_DIR}"/CLUSTER_NAME)
API_IP=$(<"${SHARED_DIR}"/API_IP)
INGRESS_IP=$(<"${SHARED_DIR}"/INGRESS_IP)
HOSTED_ZONE_ID=$(aws route53 list-hosted-zones-by-name --dns-name "${BASE_DOMAIN}" | python -c '
import json,sys;
print(json.load(sys.stdin)["HostedZones"][0]["Id"].split("/")[-1])'
)

echo "Creating DNS record for api.$CLUSTER_NAME.$BASE_DOMAIN. -> $API_IP"
cat > ${SHARED_DIR}/api-record.json <<EOF
{
"Comment": "Create the public OpenShift API record",
"Changes": [{
      "Action": "UPSERT",
      "ResourceRecordSet": {
        "Name": "api.${CLUSTER_NAME}.${BASE_DOMAIN}.",
        "Type": "A",
        "TTL": 300,
        "ResourceRecords": [{"Value": "${API_IP}"}]
      }
}]}
EOF
cp ${SHARED_DIR}/api-record.json ${ARTIFACT_DIR}/api-record.json
aws route53 change-resource-record-sets --hosted-zone-id "$HOSTED_ZONE_ID" --change-batch file://${SHARED_DIR}/api-record.json

echo "Creating DNS record for *.apps.$CLUSTER_NAME.$BASE_DOMAIN. -> $INGRESS_IP"
cat > ${SHARED_DIR}/ingress-record.json <<EOF
{
"Comment": "Create the public OpenShift Ingress record",
"Changes": [{
  "Action": "UPSERT",
  "ResourceRecordSet": {
    "Name": "*.apps.${CLUSTER_NAME}.${BASE_DOMAIN}.",
    "Type": "A",
    "TTL": 300,
    "ResourceRecords": [{"Value": "${INGRESS_IP}"}]
    }
}]}
EOF
cp ${SHARED_DIR}/ingress-record.json ${ARTIFACT_DIR}/ingress-record.json
aws route53 change-resource-record-sets --hosted-zone-id "$HOSTED_ZONE_ID" --change-batch file://${SHARED_DIR}/ingress-record.json

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/openstack/conf/creatednsrecords/openstack-conf-creatednsrecords-ref.yaml

Owners:

Approvers:

Reviewers:

Source code for this page located on GitHub