Crcdemos
Red Hat CodeReady Containers (Minishift equivalent for OpenShift 4.2 or newer) - step-by-step demo guides
Install / Use
/learn @marcredhat/CrcdemosREADME
== Red Hat CodeReady Containers (Minishift equivalent for OpenShift 4.1 or newer)
== Draft lab guide showing how to set up
-
CodeReady Containers / OpenShift 4.1
-
Ansible Agnostic Deployer
-
OpenDataHub
-
Process Automation Manager
-
Change Data Capture with Debezium and Kafka
-
Tekton Pipelines
Youtube playlist at https://www.youtube.com/playlist?list=PLg1pvyPzFye2UtQjZTSjoXhFdqkGK6exw
Red Hat CodeReady Containers brings a minimal OpenShift 4.1 or newer cluster to your local computer (see https://code-ready.github.io/crc/)
Ansible Agnostic Deployer aka AgnosticD, is a fully automated 2 Phase deployer for building and deploying everything from basic infrastructure to fully configured running application environments running on either public Cloud Providers or OpenShift clusters.
AgnosticD is not an OpenShift Deployer, though it can and does that, it is however also a deployer that just happens to be used to deploy a lot of OpenShift and OpenShift workloads, amongst other things. See https://github.com/redhat-cop/agnosticd
Open Data Hub is a machine-learning-as-a-service platform built on Red Hat's Kubernetes-based OpenShift® Container Platform, Ceph Object Storage, and Kafka/Strimzi integrating a collection of open source projects. See https://opendatahub.io/
The instructions below cover
- installing Red Hat CodeReady Containers on a RHEL 8.1 or 8.2 physical server
(You can also use Fedora 30, please https://github.com/marcredhat/crcdemos/blob/master/fedora/README.adoc)
-
using Ansible Agnostic Deployer to deploy OpenDataHub on OpenShift 4.1 or 4.2
-
configuring SSH tunneling / port forwarding to access the OpenShift console, OpenDataHub etc from your laptop.
[marc@dell-r730-019 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.1 Beta (Ootpa)
== Install packages
su -c 'dnf -y install git wget tar qemu-kvm libvirt NetworkManager jq'
sudo systemctl start libvirtd
sudo systemctl enable libvirtd
== Install Python
See https://developers.redhat.com/blog/2019/05/07/what-no-python-in-red-hat-enterprise-linux-8/
yum install @python36
yum install @python27
When you install either (or both) you can easily make /usr/bin/python point to the right place using alternatives --config python
[root@dell-r730-019 ~]# alternatives --config python
There are 3 programs which provide 'python'.
Selection Command *+ 1 /usr/libexec/no-python 2 /usr/bin/python2 3 /usr/bin/python3
Choose 3
[marc@dell-r730-019 ansible]$ python -V
Python 3.6.8
== Add user
adduser marc
passwd marc
usermod -aG wheel marc
== Install Go
cd /home/marc
wget https://dl.google.com/go/go1.12.9.linux-amd64.tar.gz
tar -xzf go1.12.9.linux-amd64.tar.gz
Add to .bashrc:
export GOROOT=/home/marc/go
export GOPATH=/home/marc/work
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
source .bashrc
== Install CodeReady Containers
wget https://mirror.openshift.com/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz
tar -xvf crc-linux-amd64.tar.xz
cd crc-linux-1.0.0
Set the memory available to CRC according to what you have on your physical server
I’m on a physical server with around 100G of memory so I allocate 80G to CRC as follows:
./crc config set memory 81920
./crc config set cpus <cpus>
You’ll need your pull secret from https://cloud.redhat.com/openshift/install/metal/user-provisioned ./crc setup ./crc start
Increase disk size available to CodeReady Containers (see https://github.com/code-ready/crc/issues/127)
sudo dnf -y install libguestfs libguestfs-tools CRC_MACHINE_IMAGE=${HOME}/.crc/machines/crc/crc #example : CRC_MACHINE_IMAGE=/home/demouser/.crc/machines/crc/crc ./crc stop #adding 500G sudo qemu-img resize ${CRC_MACHINE_IMAGE} +500G sudo cp ${CRC_MACHINE_IMAGE} ${CRC_MACHINE_IMAGE}.ORIGINAL sudo virt-resize --expand /dev/sda3 ${CRC_MACHINE_IMAGE}.ORIGINAL ${CRC_MACHINE_IMAGE} sudo rm ${CRC_MACHINE_IMAGE}.ORIGINAL ./crc setup ./crc start ./crc status
Expected result
crc status CRC VM: Running OpenShift: Stopped Disk Usage: 33.88GB of 569.1GB (Inside the CRC VM) Cache Usage: 15.95GB Cache Directory: /home/demouser/.crc/cache
INFO Checking if NetworkManager is installed INFO Checking if NetworkManager service is running INFO Caching oc binary INFO Setting up virtualization INFO Setting up KVM INFO Installing libvirt service and dependencies INFO Adding user to libvirt group INFO Enabling libvirt INFO Starting libvirt service INFO Installing crc-driver-libvirt INFO Removing older system-wide crc-driver-libvirt INFO Setting up libvirt 'crc' network INFO Starting libvirt 'crc' network INFO Writing Network Manager config for crc INFO Writing dnsmasq config for crc INFO Unpacking bundle from the CRC binary
You'll need your pull secret from https://cloud.redhat.com/openshift/install/metal/user-provisioned
[root@dell-per640-04 crc-linux-1.0.0-beta.3-amd64]# ./crc start
INFO Checking if NetworkManager is installed INFO Checking if NetworkManager service is running INFO Checking if oc binary is cached INFO Checking if Virtualization is enabled INFO Checking if KVM is enabled INFO Checking if libvirt is installed INFO Checking if user is part of libvirt group INFO Checking if libvirt is enabled INFO Checking if libvirt daemon is running INFO Checking if crc-driver-libvirt is installed INFO Checking if libvirt 'crc' network is available INFO Checking if libvirt 'crc' network is active INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists INFO Checking if CRC bundle is cached in '$HOME/.crc' ? Image pull secret [? for help]
INFO To access the cluster using 'oc', run 'eval $(crc oc-env) && oc login -u kubeadmin -p <password> https://api.crc.testing:6443' ******INFO Access the OpenShift web-console here: https://console-openshift-console.apps-crc.testing ******************************************************** INFO Login to the console with user: kubeadmin, password: <password>
cp /root/.crc/bin/oc /usr/bin/
cp ./crc /usr/bin
eval $(crc oc-env) && oc login -u kubeadmin -p <password> https://api.crc.testing:6443
[root@dell-per640-04 crc-linux-1.0.0-beta.3-amd64]# oc get projects
NAME DISPLAY NAME STATUS default Active kube-public Active kube-system Active openshift Active openshift-apiserver Active openshift-apiserver-operator Active openshift-authentication Active openshift-authentication-operator Active openshift-cloud-credential-operator Active openshift-cluster-machine-approver Active openshift-cluster-node-tuning-operator Active openshift-cluster-samples-operator Active openshift-cluster-storage-operator Active openshift-cluster-version Active openshift-config Active openshift-config-managed Active openshift-console Active openshift-console-operator Active openshift-controller-manager Active openshift-controller-manager-operator Active openshift-dns Active openshift-dns-operator Active openshift-etcd Active openshift-image-registry Active openshift-infra Active openshift-ingress Active openshift-ingress-operator Active openshift-kube-apiserver Active openshift-kube-apiserver-operator Active openshift-kube-controller-manager Active openshift-kube-controller-manager-operator Active openshift-kube-scheduler Active openshift-kube-scheduler-operator Active openshift-machine-api Active openshift-machine-config-operator Active openshift-marketplace Active openshift-monitoring Active openshift-multus Active openshift-network-operator Active openshift-node Active openshift-operator-lifecycle-manager Active openshift-operators Active openshift-sdn Active openshift-service-ca Active openshift-service-ca-operator Active open
