Skip to content

Commit ca3b112

Browse files
authored
NO-JIRA: docs: devel: create platform external cluster (#175)
**What this PR does / why we need it**: Add devel document fragment to be used as a helper to deploy platform external clusters (reusing from CI scripts) to manipulate opct and test tooling. **Which issue(s) this PR fixes** *(optional, use `fixes #<issue_number>(, fixes #<issue_number>, ...)` format, where issue_number might be a GitHub issue, or a Jira story*: Fixes # **Checklist** - [x] Subject and description added to both, commit and PR. - [x] Relevant issues have been referenced. - [x] This change includes docs. - [ ] This change includes unit tests.
1 parent 7f80683 commit ca3b112

File tree

2 files changed

+155
-0
lines changed

2 files changed

+155
-0
lines changed

docs/devel/create-cluster-external.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Create OpenShift Cluster Platform Type External
2+
3+
!!! warn "Development Reference"
4+
This guide is intended for developers/builders who want to quickly install OpenShift clusters using a configuration commonly employed for provider validation: the platform-agnostic installation method.
5+
6+
This document explains how to create a cluster using platform type `External`
7+
for your development environment to quickly test OPCT with OpenShift
8+
clusters using the platform-agnostic installation method.
9+
10+
OpenShift cluster installations with platform type `External`
11+
are the primary use case for the OPCT tool, as it validates standalone
12+
installations to ensure that non-integrated providers
13+
are correctly setting up the infrastructure required for OpenShift/OKD.
14+
15+
The platform type `External` is based on platform-agnostic installations.
16+
You can find more details in the
17+
[Installing a cluster with Platform External](https://docs.providers.openshift.org/platform-external/installing/) documentation.
18+
19+
Platform-agnostic installations require the user to provide the infrastructure,
20+
with no infrastructure automation by the `openshift-install` program. The
21+
steps in this guide reuse the infrastructure automation created for OpenShift CI (hosted in the `release` repository).
22+
The `release-devenv` project reproduces workflows from the `release` repository locally,
23+
saving time during the installation process.
24+
25+
This guide uses AWS as the provider to install an OpenShift cluster with platform
26+
type `External`, leveraging existing automation described in the docs.providers documentation to prepare the cluster.
27+
28+
Here is how this document is organized:
29+
30+
- Section 1: Install OpenShift cluster with platform type `External`
31+
- Section 2: Run OPCT
32+
33+
## Section 1: Install OpenShift Cluster
34+
35+
### Prerequisites
36+
37+
Create the AWS credentials to `${HOME}/.aws/opct`. Make sure it will use the default profile, such as:
38+
39+
```sh
40+
$ cat ${HOME}/.aws/opct
41+
[opct]
42+
aws_access_key_id = <access id>
43+
aws_secret_access_key = <access key>
44+
```
45+
46+
Setup release-devenv project:
47+
48+
> See the docs for more information: https://github.com/openshift-splat-team/release-devenv/blob/main/docs/examples/openshift-e2e-external-aws.md
49+
50+
```sh
51+
export AWS_REGION='us-west-2'
52+
export CLUSTER_BASE_DOMAIN="opct.devcluster.openshift.com"
53+
54+
export WORKDIR="${HOME}/openshift-labs/external-opct"
55+
export RELEASE_REPO_PATH="${WORKDIR}/release"
56+
export RELEASE_DEV_REPO_PATH="${WORKDIR}/release-devenv"
57+
58+
export OCP_RELEASE=4.18
59+
export OCP_VERSION=4.18.5
60+
61+
# Clone required repos
62+
git clone [email protected]:openshift/release ${RELEASE_REPO_PATH}
63+
git clone [email protected]:openshift-splat-team/release-devenv ${RELEASE_DEV_REPO_PATH}
64+
65+
# Install devenv dependencies
66+
python -m venv ${WORKDIR}/venv && source ${WORKDIR}/venv/bin/activate
67+
pip install -r ${RELEASE_DEV_REPO_PATH}/requirements.txt
68+
69+
# Create environment variables for release-devenv
70+
cat << EOF > ${RELEASE_DEV_REPO_PATH}/.env
71+
# Required by runner
72+
PULL_SECRET_FILE = ${PULL_SECRET_FILE}
73+
RELEASE_REPO_PATH = ${RELEASE_REPO_PATH}
74+
SSH_PRIVATE_KEY = '${HOME}/.ssh/id_rsa'
75+
SSH_PUBLIC_KEY = '${HOME}/.ssh/id_rsa.pub'
76+
AWS_CREDENTIAL_PATH = '${HOME}/.aws/opct'
77+
78+
SKIP_STEPS=ipi-install-rbac,openshift-cluster-bot-rbac
79+
80+
## Required by runner to simulate workflows
81+
CLUSTER_NAME = ${USER}-ext-opct2
82+
BASE_DOMAIN = ${CLUSTER_BASE_DOMAIN}
83+
LEASED_RESOURCE = $AWS_REGION
84+
JOB_NAME = 'periodic-ci-openshift-release-master-nightly-${OCP_RELEASE}-e2e-external-aws-ccm'
85+
CLUSTER_TYPE = 'aws'
86+
PERSISTENT_MONITORING = 'no'
87+
OCP_ARCH = 'amd64'
88+
89+
# Override globals
90+
RELEASE_IMAGE = 'quay.io/openshift-release-dev/ocp-release:${OCP_VERSION}-x86_64'
91+
RELEASE_IMAGE_LATEST = 'quay.io/openshift-release-dev/ocp-release:${OCP_VERSION}-x86_64'
92+
OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE = 'quay.io/openshift-release-dev/ocp-release:${OCP_VERSION}-x86_64'
93+
94+
# Required by workflow/chain/step
95+
AWS_REGION = ${AWS_REGION}
96+
PROVIDER_NAME = 'aws'
97+
PLATFORM_EXTERNAL_CCM_ENABLED = 'yes'
98+
99+
REGISTRY_AUTH_FILE = ${RELEASE_DEV_REPO_PATH}/volumes/__runtime__/shared/pull-secret-with-ci
100+
AWS_SHARED_CREDENTIALS_FILE = ${RELEASE_DEV_REPO_PATH}/volumes/cluster-profile/.awscred
101+
EOF
102+
103+
# ensure .env is created with all variables
104+
```
105+
106+
### Run the Installation steps
107+
108+
The installation steps are defined on [platform-external-cluster-aws-pre](https://steps.ci.openshift.org/chain/platform-external-cluster-aws-pre)
109+
110+
```sh
111+
cd ${RELEASE_DEV_REPO_PATH}
112+
./ci-runner.py --init --run-chain platform-external-cluster-aws-pre
113+
```
114+
115+
## Section 2: Explore conformance test tooling
116+
117+
Prerequisites:
118+
119+
- OpenShift cluster installed
120+
- opct installed
121+
122+
123+
### Explore OPCT
124+
125+
Sample/simple steps to schedule conformance workflows/jobs to the target cluster using OPCT:
126+
127+
```sh
128+
opct adm dedicated-node setup
129+
opct run -w
130+
opct retrieve
131+
opct report -s ./results *.tar.gz
132+
```
133+
134+
### Explore openshift-tests
135+
136+
Steps to perform individual tests using the `openshift-tests` utility:
137+
138+
- Set up a dedicated node
139+
- Extract `openshift-tests`
140+
- Create the test list
141+
- Run the test
142+
143+
```sh
144+
# Extract openshift-tests https://docs.providers.openshift.org/platform-external/e2e-testing/#openshift-tests-utility
145+
146+
# Run
147+
test_id=OCPBUGS
148+
variant=ext-ctrl
149+
./openshift-tests run \
150+
-f test-${test_id}.txt \
151+
--monitor="etcd-log-analyzer" \
152+
--junit-dir=./test-${test_id}_${variant} \
153+
| tee -a test-${test_id}_${variant}.txt
154+
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ nav:
8686
- BYO Plugin: devel/byo-plugin.md
8787
#- Repositories: devel/repositories.md
8888
- Architectures: devel/arch-support.md
89+
- "Devel Guide: Creating cluster with platform type External": devel/create-cluster-external.md
8990
- Release Notes:
9091
# TODO: Create release note file document with summary updates by release.
9192
- CHANGELOG.md

0 commit comments

Comments
 (0)