-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix variable for ocp4 pull secret to use same as ocp4_installer role * Updated instructions Co-authored-by: Wolfgang Kulhanek <[email protected]>
- Loading branch information
Showing
2 changed files
with
45 additions
and
55 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
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,14 +1,9 @@ | ||
= Setup AgnosticD on M1 Macs for OpenShift development (non Execution Environment version) | ||
= Setup AgnosticD on macOS for OpenShift development (non Execution Environment version) | ||
|
||
[WARNING] | ||
==== | ||
This is a stop gap solution until the Ansible BU supports building execution environments on M1 Macs. | ||
==== | ||
|
||
This documents walks through how to set up AgnosticD development on a Mac (with M1 chip) for OpenShift development. | ||
This documents walks through how to set up AgnosticD development on macOS (with M1 or Intel chip) for OpenShift development. | ||
|
||
. Make sure you have Homebrew installed (https://brew.sh) | ||
. Install Python 3, Virtualenv and jq | ||
. Install prerequisites | ||
+ | ||
[source,sh] | ||
---- | ||
|
@@ -19,7 +14,6 @@ brew install python3 virtualenv jq openssl@3 rust | |
+ | ||
[source,sh] | ||
---- | ||
mkdir -p ~/Development/agnosticd | ||
mkdir -p ~/Development/agnosticd-vars | ||
mkdir -p ~/Development/agnosticd-output | ||
mkdir -p ~/Development/virtualenvs | ||
|
@@ -30,7 +24,9 @@ mkdir -p ~/Development/virtualenvs | |
[source,sh] | ||
---- | ||
cd ~/Development | ||
git clone https://github.com/redhat-cop/agnosticd | ||
|
||
# Use SSH clone, you can not push back to the repo using https | ||
git clone [email protected]:redhat-cop/agnosticd | ||
---- | ||
|
||
. Install XCode from the Mac App Store | ||
|
@@ -50,25 +46,6 @@ xcode-select --install | |
cat ~/Development/agnosticd/tools/virtualenvs/ansible2.9-python3.6-2022-07-27.txt | grep -v pyinotify > ~/Development/virtualenvs/agnosticd.txt | ||
---- | ||
|
||
.. Create requirements file for Ansible Collections (again this is mine, offial is at https://github.com/redhat-cop/agnosticd/blob/development/ansible/configs/ocp4-cluster/requirements.yml) | ||
+ | ||
~/Development/virtualenvs/collections.yaml | ||
[source,yaml] | ||
---- | ||
--- | ||
collections: | ||
- name: amazon.aws | ||
version: 2.3.0 # Do not use anything newer than 2.x | ||
- name: kubernetes.core | ||
version: 2.3.2 | ||
- name: community.general | ||
version: 5.4.0 | ||
- name: ansible.posix | ||
version: 1.4.0 | ||
- name: community.crypto | ||
version: 2.7.1 | ||
---- | ||
.. Create the virtualenv | ||
+ | ||
[source,sh] | ||
|
@@ -85,7 +62,7 @@ export LDFLAGS="-L$(brew --prefix openssl@3)/lib" | |
export CFLAGS="-Wno-error=implicit-function-declaration -I$(brew --prefix openssl@3)/include" | ||
pip install -r ~/Development/virtualenvs/agnosticd.txt | ||
ansible-galaxy install -r ~/Development/virtualenvs/collections.yaml | ||
ansible-galaxy install -r ~/Development/agnosticd/ansible/configs/ocp4-cluster/requirements.yml | ||
---- | ||
|
||
. Link the deployer scripts to you `~/bin` directory (make sure `~/bin` is in your PATH in either `.bashrc` or `.zshrc`): | ||
|
@@ -98,11 +75,28 @@ ln -s ~/Development/agnosticd/tools/deployer_scripts/* ~/bin | |
|
||
== Deploy a new OpenShift Cluster | ||
|
||
=== Setting up secrets | ||
=== Create a Key Pair | ||
|
||
In order to access the bastion VM of your cluster you need an ssh key pair. The easiest way to manage that is to store your public key on Github. | ||
|
||
. Create a new key pair (hit enter twice for no passphrase) | ||
+ | ||
[source,sh] | ||
---- | ||
# XXXXXX is your redhat ID | ||
ssh-keygen -f ~/.ssh/XXXXXXXXX-github | ||
---- | ||
|
||
. Upload your public key to Github | ||
.. Navigate to https://github.com/settings/keys | ||
.. Click *New SSH Key* | ||
.. Use a Title for you to remember what this is for e.g. `agnosticd-key` and paste your *public* key from `~/.ssh/XXXXXXXXX-github.pub` | ||
|
||
=== Set up secrets | ||
|
||
. Create a secrets file for generic secret information (RHN subscription, Pull Secret, ...) | ||
+ | ||
~/Development/agnosticd-vars/secrets.yaml | ||
.~/Development/agnosticd-vars/secrets.yaml | ||
[source,yaml] | ||
---- | ||
# Satellite | ||
|
@@ -130,7 +124,7 @@ ssh_authorized_keys: | |
|
||
. Create a second secrets file for your cloud environment. E.g. for an AWS Open Environment (from https://demo.redhat.com) | ||
+ | ||
~/Development/agnosticd-vars/secrets-sandbox.yaml | ||
.~/Development/agnosticd-vars/secrets-sandbox.yaml | ||
[source,yaml] | ||
---- | ||
# Get these values from the Open Environment | ||
|
@@ -142,23 +136,6 @@ subdomain_base_suffix: .sandboxXXXX.opentlc.com | |
agnosticd_aws_capacity_reservation_enable: false | ||
---- | ||
|
||
== Create a Key Pair | ||
In order to access the bastion VM of your cluster you need an ssh key pair. The easiest way to manage that is to store your public key on Github. | ||
. Create a new key pair (hit enter twice for no passphrase) | ||
+ | ||
[source,sh] | ||
---- | ||
# XXXXXX is your redhat ID | ||
ssh-keygen -f ~/.ssh/XXXXXXXXX-github | ||
---- | ||
. Upload your public key to Github | ||
.. Navigate to https://github.com/settings/keys | ||
.. Click *New SSH Key* | ||
.. Use a Title for you to remember what this is for e.g. `agnosticd-key` and paste your *public* key from `~/.ssh/XXXXXXXXX-github.pub` | ||
== Deploying a base cluster | ||
|
||
To start development on a workload you want to have a base OpenShift cluster available. The following variable file sets up an OpenShift cluster with Let's Encrypt certificates and HTPasswd authentication. | ||
|
@@ -193,10 +170,6 @@ aws_region: us-east-2 | |
# - us-east-2a | ||
# - us-east-2b | ||
# Use key from your Github | ||
ssh_authorized_keys: | ||
- key: https://github.com/GITHUBID.keys | ||
|
||
cloud_tags: | ||
- owner: "<< YOUR REDHAT EMAIL >>" | ||
- Purpose: development | ||
|
@@ -274,6 +247,23 @@ aad_create myguid ocp-cluster sandbox | |
aad_destroy myguid ocp-cluster sandbox | ||
---- | ||
|
||
== Connecting to your cluster | ||
|
||
Once your cluster has been created you can use either the ssh key you specified in the configuration or the ssh key that got generated during the deploy to access the bastion VM. | ||
|
||
. SSH to your bastion VM: | ||
+ | ||
[source,sh] | ||
---- | ||
# Your Key (private key matching your public key in Github) | ||
# (replace GUID with your guid and XXXX with your sandbox number) | ||
ssh -i ~/.ssh/xxxxxxxxx-github [email protected] | ||
# or using the key the deployer created | ||
# (replace GUID with your guid and XXXX with your sandbox number) | ||
ssh -i ~/Development/agnosticd-output/GUID/ssh_provision_GUID [email protected] | ||
---- | ||
|
||
== Deploying a workload on a cluster | ||
|
||
. To deploy a workload on an already provisioned base cluster create a vars file for your workload. The name of the vars file must be the same as the name of the workload role. | ||
|