Skip to content

Instantly share code, notes, and snippets.

@jclaret
Last active May 10, 2020 14:18
Show Gist options
  • Save jclaret/3e87da31add964910ef7fbfba5c85f4c to your computer and use it in GitHub Desktop.
Save jclaret/3e87da31add964910ef7fbfba5c85f4c to your computer and use it in GitHub Desktop.
# OCP 4 Installation
RHV: https://medium.com/@daein/ocp4-3-installation-on-rhv-4-3-with-bare-metal-method-653186c6de63
Static IP: https://medium.com/@zhimin.wen/static-ip-for-ocp4-d2e4c1da5de
https://access.redhat.com/solutions/4799921[Adding worker nodes to the OCP 4 UPI cluster existing 24+ hours]
subscription-manager register
subscription-manager attach --auto
subscription-manager repos --enable rhel-7-server-extras-rpms --enable rhel-7-server-ansible-2.9-rpms
yum install git vim ansible
git clone https://github.com/RedHatOfficial/ocp4-helpernode.git
cd ocp4-helpernode/
cp docs/examples/vars.yaml .
vim vars.yaml
ansible-playbook -e @vars.yaml tasks/main.yml
/usr/local/bin/helpernodecheck install-info
mkdir ~/ocp4
cd ~/ocp4
mkdir -p ~/.openshift
vi /root/.openshift/pull-secret
cat <<EOF > install-config.yaml
apiVersion: v1
baseDomain: example.com
compute:
- hyperthreading: Enabled
name: worker
replicas: 0
controlPlane:
hyperthreading: Enabled
name: master
replicas: 3
metadata:
name: ocp4
networking:
clusterNetworks:
- cidr: 10.254.0.0/16
hostPrefix: 24
networkType: OpenShiftSDN
serviceNetwork:
- 172.30.0.0/16
platform:
none: {}
pullSecret: '$(< ~/.openshift/pull-secret)'
sshKey: '$(< ~/.ssh/helper_rsa.pub)'
EOF
openshift-install create manifests
sed -i 's/mastersSchedulable: true/mastersSchedulable: false/g' manifests/cluster-scheduler-02-config.yml
openshift-install create ignition-configs
cp ~/ocp4/*.ign /var/www/html/ignition/
restorecon -vR /var/www/html/
chmod o+r /var/www/html/ignition/*.ign
rndc flush
rndc dumpdb
rndc reload
virt-install --name ocp4_bootstrap \
--disk size=50 --ram 16000 --cpu host --vcpus 4 \
--os-type linux --os-variant rhel7 \
--network network=ocp4 --noreboot --noautoconsole \
--location http://10.0.1.230:8080/install \
--graphics vnc \
--mac="XXX" \
--extra-args "ip=dhcp nomodeset rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda coreos.inst.image_url=http://10.0.1.230:8080/install/bios.raw.gz coreos.inst.ignition_url=http://10.0.1.230:8080/ignition/bootstrap.ign"
virt-install --name ocp4_master01 \
--disk size=50 --ram 16000 --cpu host --vcpus 4 \
--os-type linux --os-variant rhel7 \
--network network=ocp4 --noreboot --noautoconsole \
--location http://10.0.1.230:8080/install \
--graphics vnc \
--mac="XXX" \
--extra-args "ip=dhcp nomodeset rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda coreos.inst.image_url=http://10.0.1.230:8080/install/bios.raw.gz coreos.inst.ignition_url=http://10.0.1.230:8080/ignition/master.ign"
virt-install --name ocp4_worker01 \
--disk size=50 --ram 16000 --cpu host --vcpus 4 \
--os-type linux --os-variant rhel7 \
--network network=ocp4 --noreboot --noautoconsole \
--location http://10.0.1.230:8080/install \
--graphics vnc \
--mac="XXX" \
--extra-args "ip=dhcp nomodeset rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda coreos.inst.image_url=http://10.0.1.230:8080/install/bios.raw.gz coreos.inst.ignition_url=http://10.0.1.230:8080/ignition/worker.ign"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment