Openshift Container Platform - OCP
Red Hat OpenShift is a unified platform to build, modernize, and deploy applications at scale. Work smarter and faster with a complete set of services for bringing apps to market on your choice of infrastructure.
Red Hat OpenShift Container Platforms leverages Kubernetes to provide business features that deliver a better user experience and a broader set of tools for enterprise needs.
RHOCP extends the features of Kubernetes by adding robust networking solutions, platform security, authentication, a full web console, an integrated image registry, as well as several other key functions to container-based workflows (templates, routes, projects ...)
- Openshift Container Platform Overview
- Installation Overview
- Single Node Openshift (SNO): a documentation to install OpenShift on a single node.
OCP IPI: Installer Provisioned Infrastrucure
-
Download the installer binary(will install the latest OCP version) and the pull-secret.txt from Redhat Console:
https://console.redhat.com/openshift/install/vsphere/installer-provisioned
-
To be able to install a specific version of OCP, use: Mirror Openshift
-
Documentations that can help
https://github.com/openshift/installer/blob/master/docs/user/vsphere/
https://docs.openshift.com/container-platform/4.13/installing/installing_vsphere/installing-vsphere-installer-provisioned-customizations.html
Customize Machine Pools
By default: 4 CPU - 16Go memory
- Customize the CPU, corePerSocker, memory of machines pools
- https://github.com/openshift/installer/blob/master/docs/user/vsphere/customization.md#custom-machine-pools
within the platform
key in your existing install-confile
file, you can add custom values for CPU and memory before creating the cluster
apiVersion: v1
baseDomain: example.com
controlPlane:
name: master
# platform: {}
platform:
# here
vsphere:
cpus: 8
coresPerSocket: 2
memoryMB: 24576
osDisk:
diskSizeGB: 512
replicas: 3
compute:
- name: worker
# platform: {}
platform:
# here
vsphere:
cpus: 8
coresPerSocket: 2
memoryMB: 24576
osDisk:
diskSizeGB: 512
replicas: 5
Create Openshift Cluster Using IPI - vSphere
Installation parameters:
-
Network: myntework_1= 192.168.213.x
-
Datastore: ssd-000404
-
VIP API: 192.168.213.4
-
VIP Ingress: 192.168.213.5
-
Base domain: hp.example.com
- Cluster name: mycluster
# working dir
cd ~/workspace/ocp
tar -zvxf openshift-install-linux-4.13.21.tar.gz
#openshift-install-linux.tar.gz
# generate a dedicated SSH keys for your cluster
ssh-keygen -t rsa -b 4096 -C "mycluster" -f ~/.ssh/mycluster-id_rsa
# create the cluster folder
mkdir mycluster
# create config file
./openshift-install --dir=./mycluster create install-config
## select ~/.ssh/mycluster-id_rsa as ssh key
# check config file
cat mycluster/install-config.yaml
# DNS registration
## vip url should be registered in DNS
## api.<cluster-name>.<base-domain> API VIP
## *.apps.<cluster-name>.<base-domain> Ingress VIP
##
## If you plan to do it later, you should ATLEAST add in your /etc/hosts: API_VIP api.<cluster-name>.<base-domain>
## to avoid the install failure during the API UP check: https://API_VIP api.<cluster-name>.<base-domain>:6443
# create a cluster
./openshift-install --dir=./mycluster create cluster
INFO Consuming Install Config from target directory
INFO Obtaining RHCOS image file from 'https://rhcos.mirror.openshift.com/art/storage/prod/streams/4.13-9.2/builds/413.92.202307260246-0/x86_64/rhcos-413.92.202307260246-0-vmware.x86_64.ova?sha256=4b2caacc4d5dc69aabe3733a86e0a5ac0b41bbe1c090034c4fa33faf582a0476'
INFO The file was found in cache: /home/xxx/.cache/openshift-installer/image_cache/rhcos-413.92.202307260246-0-vmware.x86_64.ova. Reusing...
INFO Creating infrastructure resources...
INFO Waiting up to 20m0s (until 3:58PM) for the Kubernetes API at https://api.mycluster.hp.example.com:6443...
INFO API v1.26.9+636f2be up
INFO Waiting up to 1h0m0s (until 4:38PM) for bootstrapping to complete...
INFO Destroying the bootstrap resources...
INFO Waiting up to 40m0s (until 4:34PM) for the cluster at https://api.mycluster.hp.example.com:6443 to initialize...
INFO Checking to see if there is a route at openshift-console/console...
INFO Install complete!
INFO To access the cluster as the system:admin user when using 'oc', run 'export KUBECONFIG=/home/xx/workspace/ocp/mycluster/auth/kubeconfig'
INFO Access the OpenShift web-console here: https://console-openshift-console.apps.mycluster.hp.example.com
INFO Login to the console with user: "kubeadmin", and password: "xxx"
INFO Time elapsed: 50m58s
install-config template
install-config
template
additionalTrustBundlePolicy: Proxyonly
apiVersion: v1
baseDomain: hp.example.com
compute:
- architecture: amd64
hyperthreading: Enabled
name: worker
platform: {}
replicas: 3
controlPlane:
architecture: amd64
hyperthreading: Enabled
name: master
platform: {}
replicas: 3
metadata:
creationTimestamp: null
name: mycluster
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:
vsphere:
apiVIPs:
- 192.168.213.4
failureDomains:
- name: generated-failure-domain
region: generated-region
server: pcc-zz-xzy-xx-yy.exmaple.com
topology:
computeCluster: /pcc-xx-xx_datacenterYYY/host/Cluster1
datacenter: pcc-xx-xx_datacenterYYY
datastore: /pcc-xx-xx_datacenterYYY/datastore/Shared Storages/ssd-000404
networks:
- HP-EXPLOIT_213
resourcePool: /pcc-xx-xx_datacenterYYY/host/Cluster1//Resources
zone: generated-zone
ingressVIPs:
- 192.168.213.5
vcenters:
- datacenters:
- pcc-xx-xx_datacenterYYY
password: xxxx
port: 443
server: xxxx
user: xxxx
publish: External
pullSecret: '{"auths":{"cloud.openshift.com":{"auth":"b3BNWFVSVA==","email":"xxx@example.com"},"quay.io":{"auth":"b3BlbnNRTFVSVA==","email":"xxx@example.com"},"registry.connect.redhat.com":{"auth":"fHVoYQ==","email":"xxx@example.com"}}}'
sshKey: |
ssh-rsa AAAiQ3F1aqpQ3VIYeQ== mycluster