Skip to content

Commit

Permalink
ref
Browse files Browse the repository at this point in the history
  • Loading branch information
microcosmx committed Mar 10, 2018
1 parent ec0f66d commit 0b74e0c
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions k8s-cluster.txt
@@ -0,0 +1,76 @@

system:
centos7



docker:
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
yum install docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
yum install docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm

-----------Docker version 17.03.2-ce-------------

cat << EOF > /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"],
"registry-mirrors": ["http://c32b78eb.m.daocloud.io"],
"insecure-registries":["10.141.212.25:5555"]
}
EOF
service docker restart



kubeadm setup: (master)
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
setenforce 0
yum install -y kubelet kubeadm kubectl
systemctl enable kubelet && systemctl start kubelet

cat <<EOF > /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system

### export KUBECONFIG=/etc/kubernetes/admin.conf
### sysctl net.bridge.bridge-nf-call-iptables=1

sudo swapoff -a
cat <<EOF > /root/.bash_profile
export KUBECONFIG=/etc/kubernetes/admin.conf
EOF
source /root/.bash_profile

-----------------------------------------------

kubeadm init --pod-network-cidr=10.244.0.0/16
kubeadm reset

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml

kubectl get pods --all-namespaces
kubectl get nodes

------------- leave --------------

kubectl drain centos-minion-2 --delete-local-data --force --ignore-daemonsets
kubectl delete node centos-minion-2



join: (slave)
kubeadm join --token 58c15f.e98c48fa25e26132 10.141.211.171:6443 --discovery-token-ca-cert-hash sha256:46448ae9369e3a803ef7078bc4b9de9f0855d84f309f9cf25ff76fdef8538ce2
kubeadm reset


Binary file added system_architecture.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified system_architecture.pptx
Binary file not shown.

0 comments on commit 0b74e0c

Please sign in to comment.