Skip to content

Commit fc7b5c2

Browse files
authored
Update k8-Setup_centos.txt
1 parent 3505c46 commit fc7b5c2

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

k8-Setup_centos.txt

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
kubeadm init --apiserver-advertise-address=10.46.176.28 --pod-network-cidr=192.168.1.0/16
1+
22

33
Steps to setup K8-cluster in centos Flavour (combination of worker nodes and master node is called as Kubernetes cluster)
44
========================================================================================================================
@@ -29,6 +29,12 @@ This step because all the 3 nodes should communicate each other.
2929

3030
important:
3131

32+
create a filename with firewall.sh
33+
and add the line no 35 to 57 inside the file
34+
and run the firewall.sh file
35+
with following command
36+
bash firewall.sh
37+
3238
#!/bin/bash
3339
set -x
3440
firewall-cmd --permanent --add-port=6443/tcp
@@ -56,16 +62,6 @@ set +x
5662

5763
iptables -w -P FORWARD ACCEPT
5864

59-
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
60-
br_netfilter
61-
EOF
62-
63-
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
64-
net.bridge.bridge-nf-call-ip6tables = 1
65-
net.bridge.bridge-nf-call-iptables = 1
66-
EOF
67-
sudo sysctl --system
68-
6965
modprobe overlay
7066
modprobe br_netfilter
7167
tee /etc/sysctl.d/kubernetes.conf<<EOF
@@ -91,19 +87,21 @@ EO
9187

9288
4. Firewalld package should be installed in AWS Ubuntu OS, and Disabled.
9389

94-
95-
Sudo systemctl status firewalld
96-
Sudo systemctl stop firewalld
90+
install the package firewalld
91+
yum install firewalld -y
92+
93+
systemctl status firewalld
94+
systemctl start firewalld
9795

9896
5. SWAP memory will not support for K8, because cache memory will not required.
9997

100-
sudo Free -m
101-
sudo Swappoff -a
98+
free -m
99+
swappoff -a
102100

103101
6. SeLinux is disabled
104-
sudo Sestatus
105-
sudo setenforce 0
106-
sudo Sestatus
102+
sestatus
103+
setenforce 0
104+
sestatus
107105

108106
# setenforce 0
109107
# sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
@@ -190,6 +188,6 @@ Only in Master node-Run the following commands and network add ons plugins in ma
190188

191189

192190

193-
191+
kubeadm init --apiserver-advertise-address=10.46.176.28 --pod-network-cidr=192.168.1.0/16
194192
https://phoenixnap.com/kb/how-to-install-kubernetes-on-centos
195193
https://www.tecmint.com/install-kubernetes-cluster-on-centos-7/

0 commit comments

Comments
 (0)