Install pre-requisites
Install RHOSO pre-requisites using Ansible
1. Clone and Setup
From your bastion, nagivate to the repository:
# Clone the repository
cd ~/labrepo/ansible-playbooks
# Copy and configure inventory
cp inventory/hosts.yml.example inventory/hosts-my-guid.yml
cp credentials.yml.example credentials.yml
2. Configure Inventory
Edit inventory/hosts-my-guid.yml with your environment details:
cat << EOF > inventory/hosts-my-guid.yml
all:
vars:
# REQUIRED: Lab Environment Configuration
lab_guid: "my-guid" # Replace with your actual lab GUID
bastion_user: "lab-user" # User account on bastion host
# REQUIRED: Red Hat Customer Portal Credentials
# Your login credentials for https://access.redhat.com
# Red Hat Registry credentials (required)
registry_username: "" # Add your Red Hat registry service account username
registry_password: "" # Add your Red Hat registry service account password/token
# Subscription Manager credentials (required)
rhc_username: "" # Add your Red Hat Customer Portal username
rhc_password: "" # Add your Red Hat Customer Portal password
# OPTIONAL: Internal lab hostnames (usually defaults work)
nfs_server_hostname: "nfsserver" # Internal NFS server hostname
compute_hostname: "compute01" # Internal compute node hostname
# OPTIONAL: External IP configuration for OpenShift worker nodes
# These IPs are used to configure the external network interfaces on OCP worker nodes
rhoso_external_ip_worker_1: "{rhoso_external_ip_worker_1}" # External IP for worker node 1
rhoso_external_ip_worker_2: "{rhoso_external_ip_worker_2}" # External IP for worker node 2
rhoso_external_ip_worker_3: "{rhoso_external_ip_worker_3}" # External IP for worker node 3
# OPTIONAL: Network configuration (usually defaults work)
rhoso_external_ip_bastion: "{rhoso_external_ip_bastion}" # External IP for bastion
# Bastion host (localhost when running directly from bastion)
bastion:
hosts:
localhost:
ansible_connection: local
ansible_python_interpreter: "/usr/bin/python3.11"
# NFS server operations (direct SSH from bastion)
nfsserver:
hosts:
nfs-server:
ansible_host: "{{ nfs_server_hostname }}"
ansible_user: "cloud-user"
ansible_ssh_private_key_file: "/home/lab-user/.ssh/{{ lab_guid }}key.pem"
ansible_ssh_common_args: "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
# Compute node operations (direct SSH from bastion)
compute_nodes:
hosts:
compute01:
ansible_host: "{{ compute_hostname }}"
ansible_user: "cloud-user"
ansible_ssh_private_key_file: "/home/lab-user/.ssh/{{ lab_guid }}key.pem"
ansible_ssh_common_args: "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
EOF
How to access the OpenShift Gitops console
Extract the password from the admin user Secret:
argoPass=$(oc get secret/openshift-gitops-cluster -n openshift-gitops -o jsonpath='{.data.admin\.password}' | base64 -d)
echo $argoPass
Get the Route for the OpenShift Gitops/OpenShift GitOps server:
argoURL=$(oc get route openshift-gitops-server -n openshift-gitops -o jsonpath='{.spec.host}{"\n"}')
echo $argoURL
Install kustomize
In the bastion, execute:
wget https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.6.0/kustomize_v5.6.0_linux_amd64.tar.gz
tar -xvzf kustomize_v5.6.0_linux_amd64.tar.gz
sudo cp kustomize /usr/local/bin/.
Verify operators are correctly installed (Optional)
NMState Operator
The NMState Operator in OpenShift is a Kubernetes Operator that provides a declarative way to manage node network configurations across an OpenShift cluster. It utilizes the Node Network Configuration Policy (NNCP) to drive the desired network state across cluster nodes, leveraging the NMState project under the hood. It’s mainly used when configuring OpenShift nodes to configure network isolation for the OpenStack services networks. It can also very used to configure networking in the Compute Nodes.
Verify that NMstate pods are up and running by entering the following command:
oc get pods -n openshift-nmstate
NAME READY STATUS RESTARTS AGE nmstate-cert-manager-5c5c74ff7-ncx2j 1/1 Running 0 51m nmstate-handler-6nh4g 1/1 Running 0 51m nmstate-handler-9vsbf 1/1 Running 0 51m nmstate-handler-dw62t 1/1 Running 0 51m nmstate-handler-lj5dq 1/1 Running 0 51m nmstate-handler-nx76q 1/1 Running 0 51m nmstate-handler-v4t89 1/1 Running 0 51m nmstate-operator-59dfc7f98c-9srbg 1/1 Running 0 53m nmstate-webhook-6b86f95fc4-4pxkg 1/1 Running 0 51m nmstate-webhook-6b86f95fc4-rgq9j 1/1 Running 0 51m
MetalLB Operator
MetalLB is a load balancer implementation for bare metal Kubernetes clusters, providing a network load balancing solution that integrates with standard network equipment. In environments where external load balancers like those provided by cloud providers (AWS ELB, Google Cloud Load Balancer, etc.) are unavailable, MetalLB fills that gap by offering load-balancing services.
In RHOSO, we use the L2 layer mode. In this mode, MetalLB responds to Address Resolution Protocol (ARP) requests for the IP address of the Service, essentially "claiming" the IP address on the local network. When a client sends traffic to that IP address, MetalLB forwards the traffic to one of the Service’s Pods.
Verify that MetalLB pods are up and running by entering the following command:
oc get pods -n metallb-system
NAME READY STATUS RESTARTS AGE controller-5569b49c6c-9sxgk 2/2 Running 0 52m metallb-operator-controller-manager-68b9b6478c-mhzdk 1/1 Running 0 54m metallb-operator-webhook-server-77865bcffc-b55dq 1/1 Running 0 54m speaker-g969f 6/6 Running 0 52m speaker-p9fxh 6/6 Running 0 52m speaker-r9xsv 6/6 Running 0 52m
Cert-Manager Operator
With cert-manager, a Kubernetes add-on automates the management and issuance of TLS certificates within Kubernetes clusters. It simplifies the process of obtaining, renewing, and using SSL/TLS certificates from various certificate authorities (CAs), including public ones like Let’s Encrypt, as well as private CAs. cert-manager enables users to ensure their applications are securely served over HTTPS without manually managing certificate lifecycles. We use cert-manager in RHOSO to issue and manage the SSL/TLS certicates to enable SSL/TLS on the OpenStack endpoints, called TLS everywhere (TLS-e)
Verify that cert-manager pods are up and running by entering the following command:
oc get pods -n cert-manager
NAME READY STATUS RESTARTS AGE cert-manager-85dfdd4f8b-g9jrh 1/1 Running 0 54m cert-manager-cainjector-56b774cdf8-nr97k 1/1 Running 0 55m cert-manager-webhook-8f694d645-9586v 1/1 Running 0 55m