title: “1. openshift preparement”
date: 2020-02-04T15:58:26
slug: 2-openshift-preparement
Instructions from here:
https://docs.openshift.com/container-platform/3.11/install/host_preparation.html
Copy ssh public key to each Node
ssh-keygen -b 2048
cat /root/.ssh/id\_rsa.pub >> /root/.ssh/authorized\_keys
set selinux to enforcing
sed "s/permissive/enforcing/g" -i /etc/selinux/config
reboot
Registering hosts
subscription-manager register --username=tomskiffb --password=v3NtPkdo7nfijV7SoZhf
subscription-manager refresh
subscription-manager list --available --matches '\*OpenShift\*'
subscription-manager attach --pool=<pool\_id>
subscription-manager repos --disable="\*"
yum repolist
yum-config-manager --disable \\*
subscription-manager repos \
--enable="rhel-7-server-rpms" \
--enable="rhel-7-server-extras-rpms" \
--enable="rhel-7-server-ose-3.11-rpms" \
--enable="rhel-7-server-ansible-2.8-rpms"
yum install -y wget git net-tools bind-utils yum-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct openshift-ansible docker-1.13.1
yum -y update
reboot
Install Docker Storage (attach second hard disc here: /dev/vdb)
cat <<EOF > /etc/sysconfig/docker-storage-setup
DEVS=/dev/vdb
VG=docker-vg
EOF
docker-storage-setup
cat /etc/sysconfig/docker-storage
DOCKER\_STORAGE\_OPTIONS="--storage-driver devicemapper --storage-opt dm.fs=xfs --storage-opt dm.thinpooldev=/dev/mapper/rhel-docker--pool --storage-opt dm.use\_deferred\_removal=true --storage-opt dm.use\_deferred\_deletion=true "
lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
docker-pool rhel twi-a-t--- 9.29g 0.00 0.12
systemctl start docker
systemctl enable docker
systemctl is-active docker
cat <<EOF > /etc/ansible/hosts
[OSEv3:children]
masters
nodes
etcd
# Set variables common for all OSEv3 hosts
[OSEv3:vars]
oreg\_auth\_user=tomskiffb
oreg\_auth\_password=v3NtPkdo7nfijV7SoZhf
openshift\_web\_console\_install=true
osm\_use\_cockpit=true
# SSH user, this user should allow ssh based auth without requiring a password
ansible\_ssh\_user=root
# If ansible\_ssh\_user is not root, ansible\_become must be set to true
#ansible\_become=true
openshift\_deployment\_type=openshift-enterprise
deployment\_subtype=registry
openshift\_hosted\_infra\_selector=""
# uncomment the following to enable htpasswd authentication; defaults to DenyAllPasswordIdentityProvider
#openshift\_master\_identity\_providers=[{'name': 'htpasswd\_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider'}]
# host group for masters
[masters]
registry.os.asanger.eu
# host group for etcd
[etcd]
registry.os.asanger.eu
# host group for nodes, includes region info
[nodes]
registry.os.asanger.eu openshift\_node\_group\_name='node-config-all-in-one'
EOF
Configure static DNS and Search Domain and disable automatic DNS configure
nmtui
Remove automatically hostname and hosts configuration by removing the lines:
- update_hostname
- update_etc_hosts
vi /etc/cloud/cloud.cfg
Set Hostname:
echo "registry.os.asanger.eu" > /etc/hostname
Update /etc/hosts
echo "127.0.0.1 localhost" > /etc/hosts
echo "::1 localhost" >> /etc/hosts
reboot
cd /usr/share/ansible/openshift-ansible
ansible-playbook playbooks/prerequisites.yml
ansible-playbook playbooks/deploy\_cluster.yml
