Skip to content

Instantly share code, notes, and snippets.

@oazabir
Created August 13, 2018 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oazabir/26ad7d609e82a92f8aea9cb55605a0a6 to your computer and use it in GitHub Desktop.
Save oazabir/26ad7d609e82a92f8aea9cb55605a0a6 to your computer and use it in GitHub Desktop.
Install kubernetes on OEL7
source fixproxy.sh
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
exclude=kube*
EOF
setenforce 0
yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
systemctl enable kubelet && systemctl start kubelet
setenforce 0
cat <<EOF > /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system
systemctl daemon-reload
systemctl restart kubelet
swapoff -a
rm -rf /var/lib/etcd/
kubeadm config images pull
kubeadm init --pod-network-cidr=10.96.0.0/12
export KUBECONFIG=/etc/kubernetes/admin.conf
kubectl config current-context
# install kube network
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
kubectl taint nodes --all node-role.kubernetes.io/master-
kubectl get pods --all-namespaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment