Installing a cluster quickly on OCI with platform agnostic (None)
The steps below describes how to validate the OpenShift cluster installed in an agnostic installation using standard topology.
Prerequisites
- AWS Credentials used by CLI:
# AWS Credentials
AWS_ACCESS_KEY_ID="AK..."
AWS_SECRET_ACCESS_KEY="[superSecret]"
AWS_DEFAULT_REGION="${CLUSTER_REGION}"
Setup
Select the Distribution
For development releases, visit the Release Controller For OKD and OpenShift
- OpenShift:
DISTRIBUTION="ocp"
RELEASE_REPO="quay.io/openshift-release-dev/ocp-release"
VERSION="4.14.0-rc.2"
RELEASE_VERSION="${VERSION}-x86_64"
PULL_SECRET_FILE="${HOME}/.openshift/pull-secret-latest.json"
- OKD with SCOS:
DISTRIBUTION="okd"
RELEASE_REPO=quay.io/okd/scos-release
VERSION=4.13.0-0.okd-scos-2023-05-04-192252
RELEASE_VERSION=$VERSION
PULL_SECRET_FILE="{{ playbook_dir }}/../tests/config/pull-secret-okd-fake.json"
- OKD with FCOS:
DISTRIBUTION="okd"
RELEASE_REPO=quay.io/openshift/okd
VERSION=4.12.0-0.okd-2023-04-16-041331
RELEASE_VERSION=$VERSION
PULL_SECRET_FILE="{{ playbook_dir }}/../tests/config/pull-secret-okd-fake.json"
Export the emvironment variables for cloud provider
- Set the Cloud Provider Name and the Platform Type (OKD/OpenShift):
- Cluster configuration:
# Cluster Install Configuration
CLUSTER_NAME="mycluster"
CLUSTER_REGION=us-east-1
CLUSTER_DOMAIN="aws.example.com"
Create the okd-installer var file
- Create the basic configuration for okd-installer:
# okd-installer config
cat <<EOF > ${VARS_FILE}
provider: ${CONFIG_PROVIDER}
config_platform: ${CONFIG_PLATFORM}
cluster_name: ${CLUSTER_NAME}
config_cluster_region: ${CLUSTER_REGION}
config_cluster_version: ${VERSION}
version: ${VERSION}
cluster_profile: ha
destroy_bootstrap: no
config_base_domain: ${CLUSTER_DOMAIN}
config_ssh_key: "$(cat ~/.ssh/openshift-dev.pub)"
config_pull_secret_file: "${PULL_SECRET_FILE}"
EOF
- Discovery the AMI:
cat <<EOF > ${VARS_FILE}
# discovery AMI ID: ~/.ansible/okd-installer/bin/openshift-install-linux-4.14.0-rc.0 coreos print-stream-json | jq -r '.architectures.x86_64.images.aws.regions["us-east-1"].image'
custom_image_id: ami-0a4a3456fc86deabc
EOF
Install
Install the cluster
ansible-playbook mtulio.okd_installer.create_all \
-e cert_max_retries=30 \
-e cert_wait_interval_sec=60 \
-e @$VARS_FILE
Approve certificates
The create_all already trigger the certificates approval with one default timeout. If the nodes was not yet joined to the cluster (oc get nodes) or still have pending certificates (oc get csr) due the short delay for approval, you can call it again with longer timeout:
- Approve the certificates (default execution)
ansible-playbook mtulio.okd_installer.approve_certs \
-e provider=${CONFIG_PROVIDER} \
-e cluster_name=${CONFIG_CLUSTER_NAME}
- Change the intervals to check (example 5 minutes)
ansible-playbook mtulio.okd_installer.approve_certs \
-e provider=${CONFIG_PROVIDER} \
-e cluster_name=${CONFIG_CLUSTER_NAME} \
-e certs_max_retries=3 \
-e cert_wait_interval_sec=10