Skip to content

Commit

Permalink
Updates to docs and scripts (#5637)
Browse files Browse the repository at this point in the history
Co-authored-by: Wolfgang Kulhanek <WolfgangKulhanek@gmail.com>
  • Loading branch information
wkulhanek and Wolfgang Kulhanek committed Nov 15, 2022
1 parent 782781e commit b301e68
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 56 deletions.
79 changes: 25 additions & 54 deletions docs/Setup AgnosticD on Mac.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ websocket-client==1.2.1
---
collections:
- name: amazon.aws
version: 2.3.0
# version: 3.2.0, do not use anything newer than 2.x
version: 2.3.0 # Do not use anything newer than 2.x
- name: kubernetes.core
version: 2.3.2
- name: community.general
Expand All @@ -113,60 +112,14 @@ pip install -r ~/Development/virtualenvs/agnosticd.txt
ansible-galaxy install -r ~/Development/virtualenvs/collections.yaml
----
. Once the PR is merged you can just link the script (make sure ~/bin is in your PATH):
. Link the deployer scripts to you `~/bin` directory (make sure `~/bin` is in your PATH in either `.bashrc` or `.zshrc`):
+
[source,sh]
----
mkdir ~/bin
ln -s ~/Development/agnosticd/tools/deployer_scripts/* ~/bin
----
. Create deployer shell scripts (not necessary if you linked the scripts):
.. Create environment (make sure ~/bin is in your PATH)
+
~/bin/aad_create
[source,sh]
----
#!/bin/bash
# Args:
# aad_create guid config_name <secret_name>
# Example:
# aad_create wkaws aws_sno aws
# Note:
# config_name uses a file `<config_name>.yaml`
# secret_name uses a file `secret-<secret_name>.yaml`

rm -rf ${HOME}/Development/agnosticd-output/$1

ansible-playbook ./ansible/main.yml \
-e guid=$1 \
-e @${HOME}/Development/agnosticd-vars/$2.yaml \
-e @${HOME}/Development/agnosticd-vars/secrets.yaml \
-e @${HOME}/Development/agnosticd-vars/secrets-$3.yaml \
-e output_dir=${HOME}/Development/agnosticd-output/$1
----
~/bin/aad_destroy
+
[source,sh]
----
#!/bin/bash
# Args:
# aad_destroy guid <config_name> <secret_name>
# Example:
# aad_destroy wkaws aws_sno aws
# Note:
# config_name uses a file `<config_name>.yaml`
# secret_name uses a file `secret_<secret_name>.yaml`

ansible-playbook ./ansible/destroy.yml \
-e guid=$1 \
-e @${HOME}/Development/agnosticd-vars/$2.yaml \
-e @${HOME}/Development/agnosticd-vars/secrets.yaml \
-e @${HOME}/Development/agnosticd-vars/secrets-$3.yaml \
-e output_dir=${HOME}/Development/agnosticd-output/$1
----
== Deploy a new OpenShift Cluster
=== Setting up secrets
Expand All @@ -188,8 +141,8 @@ set_repositories_satellite_activationkey: "<< ASK >>"
# rhel_subscription_user: "<< rhel subscription user >>"
# rhel_subscription_pass: "<< rhel subscription password >>"

ocp4_token: "<< Your OCP Pull Secret >>"
ocp4_pull_secret: "{{ ocp4_token }}" # for backwards compability
# Pull secret from https://console.redhat.com
ocp4_pull_secret: "<< Your OCP Pull Secret >>"

email: "<< Your Red Hat e-mail>>"

Expand All @@ -212,8 +165,27 @@ 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.
. Create a variable file for your cluster:
+
~/Development/agnosticd-vars/ocp-cluster.yaml
Expand All @@ -239,14 +211,14 @@ purpose: development
# -------------------------------------------------------------------
# Cloud config
# -------------------------------------------------------------------
aws_region: us-west-2
aws_region: us-east-2
# aws_zones:
# - us-east-2a
# - us-east-2b

# Use key from your Github
ssh_authorized_keys:
- key: https://github.com/xxxxxxxx.keys
- key: https://github.com/GITHUBID.keys

cloud_tags:
- owner: "<< YOUR REDHAT EMAIL >>"
Expand Down Expand Up @@ -274,7 +246,6 @@ student_name: lab-user
# OpenShift Installer Version
# -------------------------------------------------------------------
# Latest stable 4.11 release (in quotes!)
install_ocp4: true
ocp4_installer_version: "4.11"
ocp4_installer_root_url: http://mirror.openshift.com/pub/openshift-v4/clients

Expand Down
2 changes: 1 addition & 1 deletion tools/deployer_scripts/aad_create
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

rm -rf ${HOME}/Development/agnosticd-output/$1

ansible-playbook ./ansible/main.yml \
ansible-playbook ${HOME}/Development/agnosticd/ansible/main.yml \
-e guid=$1 \
-e @${HOME}/Development/agnosticd-vars/$2.yaml \
-e @${HOME}/Development/agnosticd-vars/secrets.yaml \
Expand Down
2 changes: 1 addition & 1 deletion tools/deployer_scripts/aad_destroy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# config_name uses a file `<config_name>.yaml`
# secret_name uses a file `secret_<secret_name>.yaml`

ansible-playbook ./ansible/destroy.yml \
ansible-playbook ${HOME}/Development/agnosticd/ansible/destroy.yml \
-e guid=$1 \
-e @${HOME}/Development/agnosticd-vars/$2.yaml \
-e @${HOME}/Development/agnosticd-vars/secrets.yaml \
Expand Down

0 comments on commit b301e68

Please sign in to comment.