Skip to content

Commit

Permalink
Merge pull request #842 from IBM/doc-code-block
Browse files Browse the repository at this point in the history
#841 Enable copy code in documentation - HOTFIX
  • Loading branch information
fketelaars authored Nov 24, 2024
2 parents d53ad50 + e61bd60 commit 8f2a29c
Show file tree
Hide file tree
Showing 30 changed files with 275 additions and 269 deletions.
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ theme:
titles_only: True
features:
- navigation.expand
- content.code.copy

extra_css:
- css/extra.css
Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
## The following requirements were added by mkdocs-get-deps
markdown-blockdiag
mkdocs
mkdocs-awesome-pages-plugin
mkdocs-material
Expand Down
16 changes: 8 additions & 8 deletions docs/src/05-install/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ Once the guest operating system is set up, log in as root. VirtualBox supports p
### Install on Linux

On Red Hat Enterprise Linux of CentOS, run the following commands:
```
``` { .bash .copy }
yum install -y podman git
yum clean all
```

On MacOS, run the following commands:
```
``` { .bash .copy }
brew install podman git
podman machine create
podman machine init
```

On Ubuntu, debian Based :
```
``` { .bash .copy }
apt-get -y install podman
podman machine create
podman machine init
Expand All @@ -44,19 +44,19 @@ Generally, adhere to the instructions provided to install either podman or docke
If you clone the repository from the command line, you will need to enter a token when you run the `git clone` command. You can retrieve your token as follows:

Go to a directory where you want to download the Git repo.
```
``` { .bash .copy }
git clone --depth=1 https://github.com/IBM/cloud-pak-deployer.git
```

## Build the image

First go to the directory where you cloned the GitHub repository, for example `~/cloud-pak-deployer`.
```
``` { .bash .copy }
cd cloud-pak-deployer
```

Then run the following command to build the container image.
```
``` { .bash .copy }
./cp-deploy.sh build
```

Expand All @@ -66,7 +66,7 @@ This process will take 5-10 minutes to complete and it will install all the pre-

To download the Cloud Pak Deployer image from the Quay.io registry, you can use the Docker command-line interface (CLI) or Podman.

```bash
``` { .bash .copy }
podman pull quay.io/cloud-pak-deployer/cloud-pak-deployer
```

Expand All @@ -76,7 +76,7 @@ This command pulls the latest version of the Cloud Pak Deployer image from the Q

By default, the above command pulls the latest version of the Cloud Pak Deployer image. If you want to specify a particular version or tag, you can append it to the image name. For example:

```bash
``` { .bash .copy }
podman pull quay.io/cloud-pak-deployer/cloud-pak-deployer:<tag_or_version>
```

Expand Down
28 changes: 14 additions & 14 deletions docs/src/10-use-deployer/3-run/aws-rosa.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Deployer reads the configuration from a directory you set in the `CONFIG_DIR` en
You can find OpenShift and Cloud Pak sample configuration (yaml) files here: [sample configuration](https://github.com/IBM/cloud-pak-deployer/tree/main/sample-configurations/sample-dynamic/config-samples). For ROSA installations, copy one of `ocp-aws-rosa-*.yaml` files into the `$CONFIG_DIR/config` directory. If you also want to install a Cloud Pak, copy one of the `cp4*.yaml` files.

Example:
```
``` { .bash .copy }
mkdir -p $HOME/cpd-config/config
cp sample-configurations/sample-dynamic/config-samples/ocp-aws-rosa-elastic.yaml $HOME/cpd-config/config/
cp sample-configurations/sample-dynamic/config-samples/cp4d-471.yaml $HOME/cpd-config/config/
Expand All @@ -34,7 +34,7 @@ cp sample-configurations/sample-dynamic/config-samples/cp4d-471.yaml $HOME/cpd-c
### Set configuration and status directories environment variables
Cloud Pak Deployer uses the status directory to log its activities and also to keep track of its running state. For a given environment you're provisioning or destroying, you should always specify the same status directory to avoid contention between different deploy runs.

```
``` { .bash .copy }
export CONFIG_DIR=$HOME/cpd-config
export STATUS_DIR=$HOME/cpd-status
```
Expand Down Expand Up @@ -79,7 +79,7 @@ For more information about using temporary security credentials, see https://doc
The temporary credentials must be issued for an IAM role that has sufficient permissions to provision the infrastructure and all other components. More information about required permissions for ROSA cluster can be found here: https://docs.openshift.com/rosa/rosa_planning/rosa-sts-aws-prereqs.html#rosa-sts-aws-prereqs.

An example on how to retrieve the temporary credentials for a user-defined role:
```
``` { .bash .copy }
printf "\nexport AWS_ACCESS_KEY_ID=%s\nexport AWS_SECRET_ACCESS_KEY=%s\nexport AWS_SESSION_TOKEN=%s\n" $(aws sts assume-role \
--role-arn arn:aws:iam::678256850452:role/ocp-sts-role \
--role-session-name OCPInstall \
Expand Down Expand Up @@ -111,7 +111,7 @@ This scenario is supported. To enable this feature, please ensure that you take
1. Include the environment ID in the infrastrucure definition `{{ env_id }}` to match existing cluster
2. Create "cluster-admin " password token using the following command:

```bash
``` { .bash .copy }
$ ./cp-deploy.sh vault set -vs={{env_id}}-cluster-admin-password=[YOUR PASSWORD]
```

Expand All @@ -130,15 +130,15 @@ If you want to pull the Cloud Pak images from the entitled registry (i.e. an onl
## 4. Set environment variables and secrets
```
``` { .bash .copy }
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_access_key
export ROSA_LOGIN_TOKEN="your_rosa_login_token"
export CP_ENTITLEMENT_KEY=your_cp_entitlement_key
```
Optional: If your user does not have permanent administrator access but using temporary credentials, you can set the `AWS_SESSION_TOKEN` to be used for the AWS CLI.
```
``` { .bash .copy }
export AWS_SESSION_TOKEN=your_session_token
```
Expand All @@ -154,7 +154,7 @@ export AWS_SESSION_TOKEN=your_session_token
### Optional: Set the GitHub Personal Access Token (PAT)
In some cases, download of the `cloudctl` and `cpd-cli` clients from https://github.com/IBM will fail because GitHub limits the number of API calls from non-authenticated clients. You can remediate this issue by creating a [Personal Access Token on github.com](https://github.com/settings/tokens) and creating a secret in the vault.
```
``` { .bash .copy }
./cp-deploy.sh vault set -vs github-ibm-pat=<your PAT>
```
Expand All @@ -166,15 +166,15 @@ Alternatively, you can set the secret by adding `-vs github-ibm-pat=<your PAT>`
If you only want to validate the configuration, you can run the dpeloyer with the `--check-only` argument. This will run the first stage to validate variables and vault secrets and then execute the generators.
```
``` { .bash .copy }
./cp-deploy.sh env apply --check-only --accept-all-licenses
```
### Run the Cloud Pak Deployer
To run the container using a local configuration input directory and a data directory where temporary and state is kept, use the example below. If you don't specify the status directory, the deployer will automatically create a temporary directory. Please note that the status directory will also hold secrets if you have configured a flat file vault. If you lose the directory, you will not be able to make changes to the configuration and adjust the deployment. It is best to specify a permanent directory that you can reuse later. If you specify an existing directory the current user **must** be the owner of the directory. Failing to do so may cause the container to fail with insufficient permissions.

```
``` { .bash .copy }
./cp-deploy.sh env apply --accept-all-licenses
```
Expand All @@ -186,15 +186,15 @@ When running the command, the container will start as a daemon and the command w
You can return to view the logs as follows:
```
``` { .bash .copy }
./cp-deploy.sh env logs
```
Deploying the infrastructure, preparing OpenShift and installing the Cloud Pak will take a long time, typically between 1-5 hours,dependent on which Cloud Pak cartridges you configured. For estimated duration of the steps, refer to [Timings](../../30-reference/timings).
If you need to interrupt the automation, use CTRL-C to stop the logging output and then use:
```
``` { .bash .copy }
./cp-deploy.sh env kill
```
Expand All @@ -208,7 +208,7 @@ Once the process has finished, it will output the URLs by which you can access t
To retrieve the Cloud Pak URL(s):
```
``` { .bash .copy }
cat $STATUS_DIR/cloud-paks/*
```
Expand All @@ -223,7 +223,7 @@ The `admin` password can be retrieved from the vault as follows:
List the secrets in the vault:
```
``` { .bash .copy }
./cp-deploy.sh vault list
```
Expand All @@ -242,7 +242,7 @@ Secret list for group sample:
You can then retrieve the Cloud Pak for Data admin password like this:
```
``` { .bash .copy }
./cp-deploy.sh vault get --vault-secret cp4d_admin_zen_40_pluto_01
```
Expand Down
32 changes: 16 additions & 16 deletions docs/src/10-use-deployer/3-run/aws-self-managed.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Deployer reads the configuration from a directory you set in the `CONFIG_DIR` en
You can find OpenShift and Cloud Pak sample configuration (yaml) files here: [sample configuration](https://github.com/IBM/cloud-pak-deployer/tree/main/sample-configurations/sample-dynamic/config-samples). For self-managed OpenShift installations, copy one of `ocp-aws-self-managed-*.yaml` files into the `$CONFIG_DIR/config` directory. If you also want to install a Cloud Pak, copy one of the `cp4*.yaml` files.

Example:
```
``` { .bash .copy }
mkdir -p $HOME/cpd-config/config
cp sample-configurations/sample-dynamic/config-samples/ocp-aws-self-managed-elastic.yaml $HOME/cpd-config/config/
cp sample-configurations/sample-dynamic/config-samples/cp4d-471.yaml $HOME/cpd-config/config/
Expand All @@ -43,7 +43,7 @@ cp sample-configurations/sample-dynamic/config-samples/cp4d-471.yaml $HOME/cpd-c
### Set configuration and status directories environment variables
Cloud Pak Deployer uses the status directory to log its activities and also to keep track of its running state. For a given environment you're provisioning or destroying, you should always specify the same status directory to avoid contention between different deploy runs.

```
``` { .bash .copy }
export CONFIG_DIR=$HOME/cpd-config
export STATUS_DIR=$HOME/cpd-status
```
Expand Down Expand Up @@ -84,7 +84,7 @@ For more information about using temporary security credentials, see https://doc
The temporary credentials must be issued for an IAM role that has sufficient permissions to provision the infrastructure and all other components. More information about required permissions can be found here: https://docs.openshift.com/container-platform/4.10/authentication/managing_cloud_provider_credentials/cco-mode-sts.html#sts-mode-create-aws-resources-ccoctl.

An example on how to retrieve the temporary credentials for a user-defined role:
```
``` { .bash .copy }
printf "\nexport AWS_ACCESS_KEY_ID=%s\nexport AWS_SECRET_ACCESS_KEY=%s\nexport AWS_SESSION_TOKEN=%s\n" $(aws sts assume-role \
--role-arn arn:aws:iam::678256850452:role/ocp-sts-role \
--role-session-name OCPInstall \
Expand Down Expand Up @@ -128,20 +128,20 @@ To obtain access to the OpenShift nodes post-installation, you will need to spec
### Set the Cloud Pak entitlement key
If you want the Cloud Pak images to be pulled from the entitled registry, set the Cloud Pak entitlement key.

```
``` { .bash .copy }
export CP_ENTITLEMENT_KEY=your_cp_entitlement_key
```

- `CP_ENTITLEMENT_KEY`: This is the entitlement key you acquired as per the instructions above, this is a 80+ character string. **You don't need to set this environment variable when you install the Cloud Pak(s) from a private registry**

### Set the environment variables for AWS self-managed OpenShift deployment
```
``` { .bash .copy }
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_access_key
```

Optional: If your user does not have permanent administrator access but using temporary credentials, you can set the `AWS_SESSION_TOKEN` to be used for the AWS CLI.
```
``` { .bash .copy }
export AWS_SESSION_TOKEN=your_session_token
```

Expand All @@ -156,7 +156,7 @@ export AWS_SESSION_TOKEN=your_session_token

You need to store the below credentials in the vault so that the deployer has access to them when installing self-managed OpenShift cluster on AWS.

```
``` { .bash .copy }
./cp-deploy.sh vault set \
--vault-secret ocp-pullsecret \
--vault-secret-file /tmp/ocp_pullsecret.json
Expand All @@ -165,7 +165,7 @@ You need to store the below credentials in the vault so that the deployer has ac
### Optional: Create secret for public SSH key

If you want to use your SSH key to access nodes in the cluster, set the Vault secret with the public SSH key.
```
``` { .bash .copy }
./cp-deploy.sh vault set \
--vault-secret ocp-ssh-pub-key \
--vault-secret-file ~/.ssh/id_rsa.pub
Expand All @@ -174,7 +174,7 @@ If you want to use your SSH key to access nodes in the cluster, set the Vault se
### Optional: Set the GitHub Personal Access Token (PAT)
In some cases, download of the `cloudctl` and `cpd-cli` clients from https://github.com/IBM will fail because GitHub limits the number of API calls from non-authenticated clients. You can remediate this issue by creating a [Personal Access Token on github.com](https://github.com/settings/tokens) and creating a secret in the vault.

```
``` { .bash .copy }
./cp-deploy.sh vault set -vs github-ibm-pat=<your PAT>
```

Expand All @@ -186,15 +186,15 @@ Alternatively, you can set the secret by adding `-vs github-ibm-pat=<your PAT>`

If you only want to validate the configuration, you can run the dpeloyer with the `--check-only` argument. This will run the first stage to validate variables and vault secrets and then execute the generators.

```
``` { .bash .copy }
./cp-deploy.sh env apply --check-only --accept-all-licenses
```

### Run the Cloud Pak Deployer

To run the container using a local configuration input directory and a data directory where temporary and state is kept, use the example below. If you don't specify the status directory, the deployer will automatically create a temporary directory. Please note that the status directory will also hold secrets if you have configured a flat file vault. If you lose the directory, you will not be able to make changes to the configuration and adjust the deployment. It is best to specify a permanent directory that you can reuse later. If you specify an existing directory the current user **must** be the owner of the directory. Failing to do so may cause the container to fail with insufficient permissions.

```
``` { .bash .copy }
./cp-deploy.sh env apply --accept-all-licenses
```

Expand All @@ -206,15 +206,15 @@ When running the command, the container will start as a daemon and the command w

You can return to view the logs as follows:

```
``` { .bash .copy }
./cp-deploy.sh env logs
```

Deploying the infrastructure, preparing OpenShift and installing the Cloud Pak will take a long time, typically between 1-5 hours,dependent on which Cloud Pak cartridges you configured. For estimated duration of the steps, refer to [Timings](../../../30-reference/timings).

If you need to interrupt the automation, use CTRL-C to stop the logging output and then use:

```
``` { .bash .copy }
./cp-deploy.sh env kill
```

Expand All @@ -228,7 +228,7 @@ Once the process has finished, it will output the URLs by which you can access t

To retrieve the Cloud Pak URL(s):

```
``` { .bash .copy }
cat $STATUS_DIR/cloud-paks/*
```

Expand All @@ -243,7 +243,7 @@ The `admin` password can be retrieved from the vault as follows:

List the secrets in the vault:

```
``` { .bash .copy }
./cp-deploy.sh vault list
```

Expand All @@ -263,7 +263,7 @@ Secret list for group sample:

You can then retrieve the Cloud Pak for Data admin password like this:

```
``` { .bash .copy }
./cp-deploy.sh vault get --vault-secret cp4d_admin_zen_40_pluto_01
```

Expand Down
Loading

0 comments on commit 8f2a29c

Please sign in to comment.