-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat/provider-oci: add full-stack creation
- Loading branch information
Showing
10 changed files
with
698 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
# Install OKD/OCP on OCI using agnostic method | ||
|
||
> This document is under development. | ||
Install OCP/OKD Cluster on Oracle Cloud Infrastructure using agnostic installation/UPI. | ||
|
||
## Prerequisites | ||
|
||
|
||
### Setup Ansible project | ||
|
||
> This steps should be made only when OCI provider is under development - not merged to `main` branch. Then the normal install flow should be used. | ||
- Setup your ansible workdir (optional, you can use the defaults) | ||
|
||
```bash | ||
|
@@ -41,7 +44,7 @@ wget https://raw.githubusercontent.com/mtulio/ansible-collection-okd-installer/m | |
|
||
- Update with OCI requirements | ||
|
||
``` | ||
```bash | ||
cat <<EOF >> requirements.txt | ||
# Oracle Cloud Infrastructure | ||
|
@@ -59,19 +62,21 @@ EOF | |
|
||
- Install ansible and dependencies | ||
|
||
``` | ||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
- Install the collections | ||
- Install the Collections | ||
|
||
``` | ||
```bash | ||
ansible-galaxy collection install -r requirements.yml | ||
``` | ||
|
||
- Get the latest (under development) okd-installer for OCI | ||
|
||
``` | ||
> https://github.com/mtulio/ansible-collection-okd-installer/pull/26 | ||
```bash | ||
git clone -b feat-add-provider-oci --recursive \ | ||
[email protected]:mtulio/ansible-collection-okd-installer.git \ | ||
collections/ansible_collections/mtulio/okd_installer | ||
|
@@ -80,7 +85,7 @@ git clone -b feat-add-provider-oci --recursive \ | |
- Check if the collection is present | ||
|
||
|
||
``` | ||
```bash | ||
$ ansible-galaxy collection list |egrep "(okd_installer|^oracle)" | ||
mtulio.okd_installer 0.0.0-latest | ||
oracle.oci 4.11.0 | ||
|
@@ -110,19 +115,19 @@ ansible localhost \ | |
|
||
You must be able to collect the user information. | ||
|
||
## okd-installer | ||
## OCP Cluster Setup on OCI | ||
|
||
### Generate the vars file | ||
|
||
```bash | ||
cat <<EOF > ~/.oci/env | ||
OCI_COMPARTMENT_ID="<CHANGE_ME:ocid1.compartment.oc1.UUID>" | ||
EOF | ||
|
||
source ~/.oci/env | ||
|
||
cat <<EOF > ./vars-oci-ha.yaml | ||
provider: oci | ||
cluster_name: ocp-oci | ||
cluster_name: mrb | ||
config_cluster_region: us-sanjose-1 | ||
oci_compartment_id: ${OCI_COMPARTMENT_ID} | ||
|
@@ -144,7 +149,9 @@ compute_instance_spec: | |
cpu_count: 8 | ||
memory_gb: 16 | ||
#> TODO extract from stream file | ||
# https://rhcos.mirror.openshift.com/art/storage/prod/streams/4.12/builds/412.86.202212081411-0/aarch64/rhcos-412.86.202212081411-0-openstack.aarch64.qcow2.gz | ||
# $ jq -r '.architectures["x86_64"].artifacts.openstack.formats["qcow2.gz"].disk.location' ~/.ansible/okd-installer/clusters/ocp-oci/coreos-stream.json` | ||
custom_image_id: rhcos-412.86.202212081411-0-openstack.aarch64.qcow2.gz | ||
EOF | ||
``` | ||
|
@@ -192,14 +199,72 @@ ansible-playbook mtulio.okd_installer.stack_loadbalancer \ | |
### Compute Stack | ||
- Bootstrap | ||
TODO | ||
#### Bootstrap | ||
- Mirror image (Ansible Role+Playbook Not implemented) | ||
- Control Plane | ||
> TODO: config to mirror from openstack image to OCI | ||
TODO | ||
> Currently the image is download manually, and added to the OCI Console as a image. | ||
- Compute | ||
TODO | ||
Steps to mirror: | ||
- Get the artifact URL from stream-json | ||
- Create Bucket for images, if not exits | ||
- Upload the image qcow2.gz | ||
- Get the signed URL for the image object | ||
- Create an image from signed URL | ||
- Get the image ID, and set the global var `custom_image_id` | ||
> `$ jq -r '.architectures["x86_64"].artifacts.openstack.formats["qcow2.gz"].disk.location' ~/.ansible/okd-installer/clusters/ocp-oci/coreos-stream.json` | ||
```bash | ||
os_mirror: yes | ||
os_mirror_src: stream | ||
os_mirror_stream: | ||
architecture: x86_64 | ||
platform: openstack | ||
format: qcow2.gz | ||
os_mirror_dest_provider: oci | ||
os_mirror_dest_oci: | ||
compartment_id: | ||
bucket: | ||
``` | ||
- Upload the bootstrap ignition to blob and Create the Bootstrap Instance | ||
```bash | ||
ansible-playbook mtulio.okd_installer.create_node \ | ||
-e node_role=bootstrap \ | ||
-e @./vars-oci-ha.yaml | ||
``` | ||
- Create the Control Plane nodes | ||
```bash | ||
ansible-playbook mtulio.okd_installer.create_node \ | ||
-e node_role=controlplane \ | ||
-e @./vars-oci-ha.yaml | ||
``` | ||
- Create the Compute nodes | ||
> TODO: create instance Pool | ||
> TODO: Approve certificates (bash loop or use existing playbook) | ||
``` | ||
oc adm certificate approve $(oc get csr -o json |jq -r '.items[] | select(.status.certificate == null).metadata.name') | ||
``` | ||
## Review the cluster | ||
```bash | ||
export KUBECONFIG=${HOME}/.ansible/okd-installer/clusters/${cluster_name}/auth/kubeconfig | ||
oc get nodes | ||
oc get co | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.