Skip to content

Commit ef7ce5f

Browse files
authored
Merge pull request #414 from dmitchsplunk/main
Adding a workshop for Cisco AI PODs
2 parents 722f1a9 + b90aa46 commit ef7ce5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4828
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: AWS Setup
3+
linkTitle: 1. AWS Setup
4+
weight: 1
5+
time: 10 minutes
6+
---
7+
8+
## Enable the Red Hat OpenShift Service in AWS
9+
10+
To deploy OpenShift in your AWS account, we'll need to first enable the
11+
Red Hat OpenShift service using the [AWS console](https://us-east-1.console.aws.amazon.com/rosa/home?region=us-east-1#/).
12+
13+
Next, follow the instructions to connect your AWS account with your Red Hat account.
14+
15+
## Provision an EC2 Instance
16+
17+
Let's provision an EC2 instance that we'll use to deploy the Red Hat cluster. This avoids
18+
the limitations running the ROSA command-line interface on Mac OS.
19+
20+
We used a t3.xlarge instance type using Ubuntu 24.04 LTS while creating the workshop,
21+
but a smaller instance type can also be used.
22+
23+
ssh into the instance once it's up and running.
24+
25+
26+
## Clone the GitHub Repository
27+
28+
Clone the GitHub repository to your EC2 instance:
29+
30+
``` bash
31+
git clone https://github.com/splunk/observability-workshop.git
32+
33+
cd observability-workshop/workshop/cisco-ai-pods
34+
```
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Cleanup
3+
linkTitle: 10. Cleanup
4+
weight: 10
5+
time: 5 minutes
6+
---
7+
8+
Follow the steps in this section to uninstall the OpenShift cluster.
9+
10+
Get the cluster ID, the Amazon Resource Names (ARNs) for the cluster-specific Operator roles,
11+
and the endpoint URL for the OIDC provider by running the following command:
12+
13+
``` bash
14+
rosa describe cluster --cluster=$CLUSTER_NAME
15+
```
16+
17+
Delete the cluster using the following command
18+
19+
``` bash
20+
rosa delete cluster --cluster=$CLUSTER_NAME --watch
21+
```
22+
23+
Delete the cluster-specific Operator IAM roles:
24+
25+
``` bash
26+
rosa delete operator-roles --prefix $OPERATOR_ROLES_PREFIX
27+
```
28+
29+
Delete the OIDC provider:
30+
31+
``` bash
32+
rosa delete oidc-provider --oidc-config-id $OIDC_ID
33+
```
34+
35+
Refer to [OpenShift documentation](https://docs.redhat.com/en/documentation/red_hat_openshift_service_on_aws/4/html/install_clusters/rosa-hcp-deleting-cluster)
36+
if you'd like to completely remove the Red Hat OpenShift Service from your AWS account.
37+
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
---
2+
title: OpenShift Prerequisites
3+
linkTitle: 2. OpenShift Prerequisites
4+
weight: 2
5+
time: 15 minutes
6+
---
7+
8+
The steps below are required before deploying the OpenShift cluster in AWS.
9+
10+
## Create a Red Hat Login
11+
12+
The first thing we'll need to do is create an account with Red Hat, which we can do by
13+
filling out the form
14+
[here](https://www.redhat.com/wapps/ugc/register.html?_flowId=register-flow&_flowExecutionKey=e1s1).
15+
16+
## Install the AWS CLI
17+
18+
To install the AWS CLI on the EC2 instance provisioned previously, run the following commands:
19+
20+
``` bash
21+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
22+
sudo apt install unzip
23+
unzip awscliv2.zip
24+
sudo ./aws/install
25+
```
26+
27+
Use the following command to ensure it was installed successfully:
28+
29+
``` bash
30+
aws --version
31+
```
32+
33+
It should return something like the following:
34+
35+
````
36+
aws-cli/2.30.5 Python/3.13.7 Linux/6.14.0-1011-aws exe/x86_64.ubuntu.24
37+
````
38+
39+
Login to your AWS account using your preferred method. Refer to the
40+
[documentation](https://docs.aws.amazon.com/signin/latest/userguide/command-line-sign-in.html)
41+
for guidance. For example, you can login by running the `aws configure` command.
42+
43+
Confirm you're logged in successfully by running a command such as `aws ec2 describe-instances`.
44+
45+
Then, verify your account identity with:
46+
47+
``` bash
48+
aws sts get-caller-identity
49+
```
50+
51+
Check whether the service role for ELB (Elastic Load Balancing) exists:
52+
53+
``` bash
54+
aws iam get-role --role-name "AWSServiceRoleForElasticLoadBalancing"
55+
```
56+
57+
If the role does not exist, create it by running the following command:
58+
59+
``` bash
60+
aws iam create-service-linked-role --aws-service-name "elasticloadbalancing.amazonaws.com"
61+
```
62+
63+
## Install the ROSA CLI
64+
65+
We'll use the ROSA command-line interface (CLI) for the deployment. The instructions are
66+
based on [Red Hat documentation](https://docs.redhat.com/en/documentation/red_hat_openshift_service_on_aws_classic_architecture/4/html-single/install_rosa_classic_clusters/index#rosa-installing-and-configuring-the-rosa-cli_rosa-installing-cli).
67+
68+
You can download the latest release of the ROSA CLI for your operating system
69+
[here](https://console.redhat.com/openshift/downloads).
70+
71+
Alternatively, we can use the following command to download the CLI binary directly
72+
to our EC2 instance:
73+
74+
````
75+
curl -L -O https://mirror.openshift.com/pub/cgw/rosa/latest/rosa-linux.tar.gz
76+
````
77+
78+
Extract the contents:
79+
80+
````
81+
tar -xvzf rosa-linux.tar.gz
82+
````
83+
84+
Move the resulting file (`rosa`) to a location that's included as part of your path. For example:
85+
86+
``` bash
87+
sudo mv rosa /usr/local/bin/rosa
88+
```
89+
90+
Log in to your Red Hat account by running the command below, then follow the instructions
91+
in the command output:
92+
93+
````
94+
rosa login --use-device-code
95+
````
96+
97+
## Install the OpenShift CLI (oc)
98+
99+
We can use the following command to download the OpenShift CLI binary directly
100+
to our EC2 instance:
101+
102+
````
103+
curl -L -O https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz
104+
````
105+
106+
Extract the contents:
107+
108+
````
109+
tar -xvzf openshift-client-linux.tar.gz
110+
````
111+
112+
Move the resulting files (`oc` and `kubectl`) to a location that's included as part of your path. For example:
113+
114+
``` bash
115+
sudo mv oc /usr/local/bin/oc
116+
sudo mv kubectl /usr/local/bin/kubectl
117+
```
118+
119+
## Create Account-Wide Roles and Policies
120+
121+
Use the following command to create the necessary account-wide roles and policies:
122+
123+
``` bash
124+
rosa create account-roles --mode auto
125+
```
126+
127+
## Create an AWS VPC for ROSA HCP
128+
129+
We're going to use the Hosted Control Plane (HCP) deployment option to
130+
deploy our OpenShift cluster. To do this, we'll need to
131+
create a new VPC in our AWS account using the following command:
132+
133+
> Note: update the region as appropriate for your environment.
134+
135+
``` bash
136+
rosa create network --param Region=us-east-2
137+
```
138+
139+
> Important: make note of the subnet ids created as a result of this command
140+
> as you'll need them when creating the cluster.
141+
142+
> Note: by default, each AWS region is limited to 5 elastic IP addresses.
143+
> If you receive the following error:
144+
> "The maximum number of addresses has been reached."
145+
> then you'll need to contact AWS to request an increase to this limit,
146+
> or choose another AWS region to create the VPC for ROSA.
147+
148+
## Create an OpenID Connect configuration
149+
150+
Before creating a Red Hat OpenShift Service on AWS cluster, let's create the OpenID Connect (OIDC)
151+
configuration with the following command:
152+
153+
``` bash
154+
rosa create oidc-config --mode=auto --yes
155+
```
156+
157+
> Important: make note of the oidc-provider id that is created.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: Deploy OpenShift Cluster in AWS
3+
linkTitle: 3. Deploy OpenShift Cluster in AWS
4+
weight: 3
5+
time: 25 minutes
6+
---
7+
8+
## Deploy an OpenShift Cluster
9+
10+
We'll use the ROSA CLI to deploy an OpenShift Cluster.
11+
12+
First, we'll need to set a few environment variables:
13+
14+
> Note: be sure to fill in the Subnet IDs and OIDC ID before running the EXPORT commands
15+
16+
``` bash
17+
export CLUSTER_NAME=rosa-test
18+
export AWS_REGION=us-east-2
19+
export AWS_INSTANCE_TYPE=g5.2xlarge
20+
export SUBNET_IDS=<comma separated list of subnet IDs from earlier rosa create network command>
21+
export OIDC_ID=<the oidc-provider id returned from the rosa create oidc-config command>
22+
export OPERATOR_ROLES_PREFIX=rosa-test-a6x9
23+
```
24+
25+
Create operator roles for the OIDC configuration using the following command:
26+
27+
``` bash
28+
rosa create operator-roles --hosted-cp --prefix $OPERATOR_ROLES_PREFIX --oidc-config-id $OIDC_ID
29+
```
30+
31+
Then we can create the cluster as follows:
32+
33+
``` bash
34+
rosa create cluster \
35+
--cluster-name $CLUSTER_NAME \
36+
--mode auto \
37+
--hosted-cp \
38+
--sts \
39+
--create-admin-user \
40+
--operator-roles-prefix $OPERATOR_ROLES_PREFIX \
41+
--oidc-config-id $OIDC_ID \
42+
--subnet-ids $SUBNET_IDS \
43+
--compute-machine-type $AWS_INSTANCE_TYPE \
44+
--replicas 2 \
45+
--region $AWS_REGION
46+
```
47+
48+
> Note that we've specified the `g5.2xlarge` instance type, which includes NVIDIA
49+
> GPUs that we'll be using later in the workshop. This instance type is relatively expensive,
50+
> about $1.21 per hour at the time of writing, and we've requested 2 replicas,
51+
> so be mindful of how long your cluster is running for, as costs will accumulate quickly.
52+
53+
To determine when your cluster is Ready, run:
54+
55+
``` bash
56+
rosa describe cluster -c $CLUSTER_NAME
57+
```
58+
59+
To watch your cluster installation logs, run:
60+
61+
``` bash
62+
rosa logs install -c $CLUSTER_NAME --watch
63+
```
64+
65+
## Connect to the OpenShift Cluster
66+
67+
Use the command below to connect the oc CLI to your OpenShift cluster:
68+
69+
> Note: Run the `rosa describe cluster -c $CLUSTER_NAME` command and substitute the
70+
> resulting API Server URL into the command below before running it. For example,
71+
> the server name might be something like `https://api.rosa-test.aaa.bb.openshiftapps.com:443`.
72+
73+
``` bash
74+
oc login <API Server URL> -u cluster-admin
75+
```
76+
77+
Once connected to your cluster, confirm that the nodes are up and running:
78+
79+
``` bash
80+
oc get nodes
81+
82+
NAME STATUS ROLES AGE VERSION
83+
ip-10-0-1-184.us-east-2.compute.internal Ready worker 14m v1.31.11
84+
ip-10-0-1-50.us-east-2.compute.internal Ready worker 20m v1.31.11
85+
```
86+

0 commit comments

Comments
 (0)