Opticca - CodeReady-Single Node Openshift-REHL
Opticca - CodeReady-Single Node Openshift-REHL
Red Hat CodeReady Containers (CRC) brings a minimal, preconfigured OpenShift 4.+ cluster
for development and testing purposes.
Overview
CodeReady
Single Node
OpenShift VM
REHL OS
The OpenShift presented for CRC provides a regular OpenShift Container Platform
installation with the following differences:
With this solution, you can have a non-production Openshift environment in less than 30
minutes.
Benefits for
Features and benefits to run CodeReady Container on RHEL:
using Azure
Marketplace ● Deploy one node Openshift cluster in minutes. Quickly validate the readiness of your
core applications for migration to OpenShift or to new versions.
● A low-cost Openshift environment for testing.
○ A traditional OpenShift cluster, non-production environment, would require a
minimum of 5 nodes (3 masters, 2 worker/infra) installed on separate virtual
machines.
○ Azure ARO requires 6 nodes, 3 workers, 3 workers/infra
● Self-service for developers with minimal overhead on the infrastructure team.
You can use this solution:
● If you are new to OpenShift or want to test a new OpenShift version. Get started with
an Openshift cluster with the least effort and lowest cost.
Benefits for ● Prepare and test your application to run in a non-production Openshift Cluster.
using Azure ● Application validation in the latest (target) Openshift versions.
Marketplace ● Ensure applications deployed to a Kubernetes Cluster or older OpenShift versions are
stable in the latest OpenShift versions.
Documentation:
https://www.redhat.com/sysadmin/codeready-containers
https://access.redhat.com/documentation/en-us/red_hat_openshift_local/2.4
Operating System Details
Version 8
NetworkManager 1.22.8-9.el8_2
Binary crc-linux-2.5.1-amd64
The minimum scope for Virtual Machine creation can be at a resource group level, under
which you want to deploy your virtual machine.
Deployment If you don't have an Azure subscription, create a free account before you begin.
of VM using
Marketplace SIGN IN TO AZURE
Sign in to Azure
CREATE VIRTUAL MACHINE
Deployment
of VM using
Marketplace
Image
of VM using password.
10. Under Inbound port rules > Public inbound ports, choose Allow selected ports. In
Marketplace Select inbound ports, select SSH (22) from the drop-down. This option can also be
Image carried out in Step 12.
11. Under Licensing, select Other from the drop-down.
12. Click Next.
Create Virtual Machine
Note: You can skip the Disks tab and leave all defaults.
Deployment
of VM using
Marketplace
Image
Deployment
of VM using
Marketplace
Image
Image
of VM using
Create an SSH connection with the VM.
Marketplace
Image 1. If you’re on a Mac or Linux machine, open a Bash prompt to connect using command
ssh <username>@<public ip address>
Connect to Virtual
Machine
2. If you’re on a Windows machine, open a PowerShell prompt , or if you’ve installed
putty or MobaXterm_portable, open it as shown below and connect by running the
command ssh <username>@<public ip address>:
Deployment
of VM using
Marketplace
Image
Connect to Virtual
Machine
After the creation of the VM based on the golden image, please follow these instructions:
1. Go to the Red Hat Cloud Portal and login with a valid account
a. URL: https://cloud.redhat.com
2. In the left menu bar, select Openshift > Downloads
Post
Configuration
of Azure VM
3. Under the Tokens section, download the Pull secret.
Post
Configuration
of Azure VM
4. Copy the Pull secret file to the Virtual Machine in the user home directory.
You can use your preferred method to copy the pull-secret.txt to the VM (ie. using scp
bash command):
Post
Configuration
of Azure VM
5. Connect into the Virtual Machine and check the CRC binary:
$ crc version
Configuration
6. Setup the environment:
of Azure VM a. Configure the network-mode to system:
$ crc cleanup
$ crc setup
CRC prompts you before use for optional, anonymous usage data collection to
assist with development. No personally identifiable information is collected.
Consent for usage data collection can be granted or revoked by you at any
time.
Post
Configuration Accept or deny the telemetry data collection.
of Azure VM
● For more information about collected data, see the
https://developers.redhat.com/article/tool-data-collection.
● To grant or revoke consent for usage data collection, see
https://crc.dev/crc/#configuring-usage-data-collection_gsg.
Start CRC and In the Virtual Machine, run the start script passing the pull-secret file:
Openshift SNO
~# crc start -p /home/${user}/pull-secret.txt
You can start the crc without the pull-secret.txt file, but you’ll need to
manually copy the value of your Pull secret and pass during the start
NOTE process.
Using this method, you can’t run the crc-start.sh, instead use the ‘crc
start’ command.
This process can take several minutes to complete. After the instance has started, you’ll see
the cluster details and credentials:
https://console-openshift-console.apps-crc.testing
Start CRC and
Log in as administrator:
Openshift SNO Username: kubeadmin
Log in as user:
Username: developer
Password: developer
Start CRC and INFO Waiting for kube-apiserver availability... [takes around 2min]
Openshift SNO Error waiting for apiserver: Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc
NOTE
--kubeconfig /opt/kubeconfig
err : Process exited with status 1
(x13)
Simply wait a few minutes and check the execution again by running the
command crc status.
Check the status of the Cluster:
Podman:
Accessing the The crc start command prints the password for the developer user. You
NOTE
OpenShift can also view it by running the crc console --credentials command.
Cluster
e. You can now use oc to interact with your OpenShift Container Platform cluster.
For example, to verify that the OpenShift Container Platform cluster Operators
Accessing using
are available, log in as the kubeadmin user and run the following command:
Openshift CLI (oc)
global
debug
Accessing the
OpenShift defaults
Cluster log global
mode http
Accessing using
HAPROXY timeout connect 0
timeout client 0
timeout server 0
frontend apps
bind SERVER_IP:80
bind SERVER_IP:443
option tcplog
Accessing the mode tcp
OpenShift default_backend apps
Cluster
backend apps
Accessing using
HAPROXY mode tcp
balance roundrobin
option ssl-hello-chk
bind SERVER_IP:6443
option tcplog
Cluster
backend api
Accessing using mode tcp
HAPROXY
balance roundrobin
option ssl-hello-chk
Accessing the
$ sudo sed -i "s/SERVER_IP/$SERVER_IP/g"
OpenShift /etc/haproxy/haproxy.cfg
Cluster $ sudo sed -i "s/CRC_IP/$CRC_IP/g"
/etc/haproxy/haproxy.cfg
Accessing using
HAPROXY b. Start the haproxy server:
To be able to access using the Openshift URL, you need to configure your local DNS
resolution.
You’ll need administrator permission in order to configure your local DNS resolution.
This can change depending on your operation system.
Accessing the
OpenShift To be able to complete this configuration, you need to have the Public IP
NOTE
Cluster from your Virtual Machine in Azure.
Add in the hosts file, changing the ${AZ_PUBLIC_IP} to your Public IP:
Accessing using
HAPROXY
${AZ_PUBLIC_IP}
console-openshift-console.apps-crc.testing
${AZ_PUBLIC_IP} apps-crc.testing
${AZ_PUBLIC_IP} api.crc.testing
${AZ_PUBLIC_IP} oauth-openshift.apps-crc.testing
Find the location of the hosts files for each Operation System below:
For Windows
Make sure that you have the ports open in your Network Security Group in your Azure
subscription for the Virtual Machine.
Accessing the Ports 80 and 443 were already opened when you created the Virtual Machine. Open
OpenShift port 6443 by following these steps:
Cluster
1. Open the Azure portal, http://portal.azure.com. Go to Virtual Machines and
click on the Virtual Machine.
Accessing using
HAPROXY
2. In Settings > Networking, add Inbound port rules:
Accessing the
OpenShift
Cluster
Accessing using
HAPROXY
3. Click on Add inbound port rule. In Destination port ranges, enter 6443. Set the
Priority to something higher when comparing to any Deny rule. Enter
Port_6443 as the rule Name and click Add:
Accessing the
OpenShift
Cluster
Accessing using
HAPROXY
Now that you have
Accessing the
OpenShift
Cluster
Accessing using
HAPROXY
Accessing the
OpenShift
Cluster
Accessing using
HAPROXY