-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSteps.txt
200 lines (135 loc) · 6.91 KB
/
Steps.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
Deploying OpenShift 3.11 Cluster on CentOs
###########################################
infra1structure Setup:
----------------------
Hostname IP Address CPUs RAM HDD OS Role
master.slopenshift.dns-cloud.net 64.225.53.100 2 2 GB /dev/sda (100 GB) CentOS7.X Master Node
node01.slopenshift.dns-cloud.net 165.227.74.214 2 2 GB /dev/sda (100 GB) CentOS7.X Worker Node
infra.slopenshift.dns-cloud.net 64.225.53.104 2 2 GB /dev/sda (100 GB) CentOS7.X infra1 Node
---------------------------------------------------------------------------------------------------------
You can create your own free DNS zone at www.cloudns.net. Please add DNS record as below with your domain
*********************************************************************************************************
infra.slopenshift.dns-cloud.net A 64.225.53.104
master.slopenshift.dns-cloud.net A 64.225.53.100
node01.slopenshift.dns-cloud.net A 165.227.74.214
app.infra.slopenshift.dns-cloud.net A 64.225.53.104
*.app.infra.slopenshift.dns-cloud.net CNAME app.infra.slopenshift.dns-cloud.net
console.app.infra.slopenshift.dns-cloud.net A 64.225.53.104
Step 1: Install Openshift Packages on Master,Compute,Infra
**********************************************************
yum -y update
yum install vim -y
yum install -y wget git nano net-tools docker-1.13.1 bind-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct openssl-devel httpd-tools NetworkManager python-cryptography python-devel python-passlib java-1.8.0-openjdk-headless "@Development Tools"
Step 2: Modify 'NetworkManager.conf' file on Master,Compute,Infra
*****************************************************************
vim /etc/NetworkManager/NetworkManager.conf
[main]
#plugins=ifcfg-rh,ibft
dns=none
wq!
-------------------------------------------
vim /etc/sysconfig/network-scripts/ifcfg-eth0 (ifcfg-eth0 is my ethernet) add below records
PEERDNS=yes
DNS1=8.8.8.8
wq!
step 3 : Modify 'resolv.conf' file on Master,Compute,Infra
**********************************************************
vim /etc/resolv.conf
search slopenshift.dns-cloud.net ( add your custom domain)
nameserver 8.8.8.8
systemctl restart NetworkManager
step 4: Reboot Master,Compute,Infra
***********************************
reboot
step 5: Install and enable epel 7 on Master,Compute,Infra
*********************************************************
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sed -i -e "s/^enabled=1/enabled=0/" /etc/yum.repos.d/epel.repo
step 6: Install docker on Master,Compute,Infra
**********************************************
yum install docker-1.13.1
docker version
Enable docker & start service on Master,Compute,Infra
systemctl enable docker.service --now
systemctl status docker.service
step 7:Install ansible on Master machine
****************************************
yum install ansible
yum remove ansible ( If ansible version is less than 2.4 or 2.8 then remove, install ansible 2.7 from package)
rpm -Uvh https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.7.10-1.el7.ans.noarch.rpm
ansible --version
step 8: Makesure ssh enable all VMs
***********************************
vim /etc/ssh/sshd_config
PasswordAuthentication yes
PubkeyAuthentication yes
systemctl restart sshd
passwd root ( set the root pw)
step 9: set the hostname
************************
hostnamectl set-hostname master.slopenshift.dns-cloud.net (master node)
hostnamectl set-hostname infra.slopenshift.dns-cloud.net (infra node)
hostnamectl set-hostname node01.slopenshift.dns-cloud.net (worker node)
step 10: Generate SSH Key on master machine and copy key on Compute and Infra
*****************************************************************************
ssh-keygen (master node)
ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected]
ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected]
ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected]
step 11: create inventory.ini file in master home directory.Then add below config details.
******************************************************************************************
# Create an OSEv3 group that contains the masters, nodes, and etcd groups
[OSEv3:children]
masters
nodes
etcd
# Set variables common for all OSEv3 hosts
[OSEv3:vars]
# 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_master_default_subdomain=app.infra.slopenshift.dns-cloud.net
deployment_type=origin
[nodes:vars]
openshift_disable_check=disk_availability,memory_availability,docker_storage
[masters:vars]
openshift_disable_check=disk_availability,memory_availability,docker_storage
# 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]
master.slopenshift.dns-cloud.net
# host group for etcd
[etcd]
master.slopenshift.dns-cloud.net
# host group for nodes, includes region info
[nodes]
master.slopenshift.dns-cloud.net openshift_node_group_name='node-config-master'
node01.slopenshift.dns-cloud.net openshift_node_group_name='node-config-compute'
infra.slopenshift.dns-cloud.net openshift_node_group_name='node-config-infra'
step 12 : Clone Openshift Origin source code
********************************************
git clone https://github.com/openshift/openshift-ansible.git
step 13 : Checkout Origin 3.11 release
**************************************
cd openshift-ansible && git fetch && git checkout release-3.11 && cd ..
step 14: confirm selinux setting on Master,Compute,Infra
********************************************************
vi /etc/selinux/config
SELINUX=enforcing
SELINUXTYPE=targeted
step 15: Execute playbook on master machine
******************************************
ansible-playbook -i inventory.ini openshift-ansible/playbooks/prerequisites.yml
ansible-playbook -i inventory.ini openshift-ansible/playbooks/deploy_cluster.yml
step 16: Reset password of system admin on master machine
*********************************************************
htpasswd -c /etc/origin/master/htpasswd admin
step 17: add cluster admin role to the user
*******************************************
oc adm policy add-cluster-role-to-user cluster-admin admin
Step 18 : you can login to the gui as below
*******************************************
oc login -u system:admin
then it will show you the URL as : https://master.slopenshift.dns-cloud.net:8443