4.9 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	OpenShift Advanced Cluster Management Observability
- Introduction
 - Pre-requisites
 - 1 - Logging into aws locally
 - 2 - Creating s3 bucket
 - 3 - Install openshift clusters
 
Introduction
This document captures the environment setup steps for a ~30 minute live demo of the Red Hat Advanced Cluster Management observability feature for Openshift.
Pre-requisites
This guide assumes you:
- Have access to an Amazon Web Services account with permissions to be able to create resources including 
s3buckets andec2instances. In my case I have an AWS Blank Open Environment provisioned through the Red Hat demo system. - Already have the 
awsandoccli utilities installed. - Have registered for a Red Hat account (required for obtaining an OpenShift install image pull secret).
 
1 - Logging into aws locally
Our first step is to login to our aws account locally via the aws cli which will prompt for four values:
aws configure
2 - Creating s3 bucket
After logging into aws lets confirm our permissions are working by creating the s3 bucket we will need later on.
aws s3 mb "s3://open-cluster-management-observability" --region "$(aws configure get region)"
3 - Install openshift clusters
With our aws credentials working let's move on to deploying the hub and single node openshift cluster required for the live demo.
3.1 Download installer tools
Our first step will be to ensure we have the openshift-install cli tool. We can download it as follows:
# Download the installer
wget "https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-install-linux.tar.gz"
# Extract the archive
tar xf openshift-install-linux.tar.gz
3.2 Obtain install pull secret
Next we have a manual step to login to the Red Hat Hybrid Cloud Console and obtain our Pull Secret which will be required for our installation configuration.
Open the Console and click Download pull secret. This will download a file called pull-secret.txt which will be used later on.
3.3 Create ssh key
For access to our soon to be created clusters we need an ssh key, let's generate those now via ssh-keygen.
ssh-keygen -t rsa -b 4096 -f ~/.ssh/hubkey -q -N ""
ssh-keygen -t rsa -b 4096 -f ~/.ssh/snokey -q -N ""
3.3 Initiate the hub cluster install
Once our install tooling is available let's kick off the installation of our hub cluster by creating a configuration file and then running openshift-install.
cat << EOF > hub/install-config.yaml
additionalTrustBundlePolicy: Proxyonly
apiVersion: v1
baseDomain: $(aws route53 list-hosted-zones | jq '.HostedZones[].Name' -r | sed 's/.$//')
compute:
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  platform: {}
  replicas: 3
controlPlane:
  architecture: amd64
  hyperthreading: Enabled
  name: master
  platform: {}
  replicas: 3
metadata:
  creationTimestamp: null
  name: hub
networking:
  clusterNetwork:
  - cidr: 10.128.0.0/14
    hostPrefix: 23
  machineNetwork:
  - cidr: 10.0.0.0/16
  networkType: OVNKubernetes
  serviceNetwork:
  - 172.30.0.0/16
platform:
  aws:
    region: $(aws configure get region)
publish: External
pullSecret: |
  $(cat pull-secret.txt)
sshKey: |
  $(cat ~/.ssh/hubkey.pub)
EOF
Once the configuration file is created we can kick off the install with openshift-install as follows:
./openshift-install create cluster --dir hub --log-level info
3.4 Initiate the sno cluster install
We can run our single node openshift cluster install at the same time in a separate terminal to speed things up.  The process is the same we will first create an install-config.yaml file, then run openshift-install.
cat << EOF > sno/install-config.yaml
additionalTrustBundlePolicy: Proxyonly
apiVersion: v1
baseDomain: $(aws route53 list-hosted-zones | jq '.HostedZones[].Name' -r | sed 's/.$//')
compute:
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  platform: {}
  replicas: 0
controlPlane:
  architecture: amd64
  hyperthreading: Enabled
  name: master
  platform: {}
  replicas: 1
metadata:
  creationTimestamp: null
  name: sno
networking:
  clusterNetwork:
  - cidr: 10.128.0.0/14
    hostPrefix: 23
  machineNetwork:
  - cidr: 10.0.0.0/16
  networkType: OVNKubernetes
  serviceNetwork:
  - 172.30.0.0/16
platform:
  aws:
    region: $(aws configure get region)
publish: External
pullSecret: |
  $(cat pull-secret.txt)
sshKey: |
  $(cat ~/.ssh/snokey.pub)
EOF
Once the configuration file is created we can kick off the install with openshift-install as follows:
./openshift-install create cluster --dir sno --log-level info