initial commit
This commit is contained in:
11
deploy/calico_setup.sh
Normal file
11
deploy/calico_setup.sh
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Initialize Kubernetes
|
||||
kubeadm init --ignore-preflight-errors=SystemVerification --pod-network-cidr=192.168.0.0/16
|
||||
mkdir -p $HOME/.kube
|
||||
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
|
||||
chown $(id -u):$(id -g) $HOME/.kube/config
|
||||
|
||||
## Apply Calico CNI plugin
|
||||
kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
|
||||
kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml
|
10
deploy/cilium_setup.sh
Normal file
10
deploy/cilium_setup.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Initialize Kubernetes
|
||||
kubeadm init --ignore-preflight-errors=SystemVerification
|
||||
mkdir -p $HOME/.kube
|
||||
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
|
||||
chown $(id -u):$(id -g) $HOME/.kube/config
|
||||
|
||||
## Apply Cilium CNI plugin
|
||||
kubectl create -f https://raw.githubusercontent.com/cilium/cilium/v1.4/examples/kubernetes/1.13/cilium.yaml
|
7
deploy/docker_registry_setup.sh
Normal file
7
deploy/docker_registry_setup.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
IP=$1
|
||||
sed "/ExecStart/ s/$/ --insecure-registry=$IP/" /lib/systemd/system/docker.service > /lib/systemd/system/tmp
|
||||
mv /lib/systemd/system/tmp /lib/systemd/system/docker.service
|
||||
systemctl daemon-reload
|
||||
systemctl restart docker.service
|
||||
docker run -d -p 5000:5000 --restart=always --name registry registry:2
|
10
deploy/flannel_setup.sh
Normal file
10
deploy/flannel_setup.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Initialize Kubernetes
|
||||
kubeadm init --ignore-preflight-errors=SystemVerification --pod-network-cidr=10.244.0.0/16
|
||||
mkdir -p $HOME/.kube
|
||||
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
|
||||
chown $(id -u):$(id -g) $HOME/.kube/config
|
||||
|
||||
## Apply Flannel CNI plugin
|
||||
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
|
5
deploy/kubeless_setup.sh
Normal file
5
deploy/kubeless_setup.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
RELEASE=$(curl -s https://api.github.com/repos/kubeless/kubeless/releases/latest | grep tag_name | cut -d '"' -f 4)
|
||||
kubectl create ns kubeless
|
||||
kubectl create -f https://github.com/kubeless/kubeless/releases/download/$RELEASE/kubeless-$RELEASE.yaml
|
||||
#kubectl create -f https://github.com/kubeless/kubeless/releases/download/$RELEASE/kubeless-non-rbac-$RELEASE.yaml
|
54
deploy/kubernetes_install.sh
Normal file
54
deploy/kubernetes_install.sh
Normal file
@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
CLIENT=$1
|
||||
IP=$2
|
||||
TOKEN=$3
|
||||
HASH=$4
|
||||
|
||||
|
||||
#Installing Docker
|
||||
DOCKER_INSTALLED=$(which docker)
|
||||
if [ "$DOCKER_INSTALLED" = "" ]
|
||||
then
|
||||
apt-get remove docker docker-engine docker.io
|
||||
apt-get update
|
||||
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
|
||||
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||
apt-get update
|
||||
apt-get install -y docker-ce
|
||||
fi
|
||||
|
||||
|
||||
#Installing Kubernetes
|
||||
KUBERNETES_INSTALLED=$(which kubeadm)
|
||||
if [ "$KUBERNETES_INSTALLED" = "" ]
|
||||
then
|
||||
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
|
||||
touch /etc/apt/sources.list.d/kubernetes.list
|
||||
chmod 666 /etc/apt/sources.list.d/kubernetes.list
|
||||
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
|
||||
apt-get update
|
||||
apt-get install -y kubelet kubeadm kubectl kubernetes-cni
|
||||
fi
|
||||
|
||||
#Disabling swap for Kubernetes
|
||||
sysctl net.bridge.bridge-nf-call-iptables=1 > /dev/null
|
||||
swapoff -a
|
||||
|
||||
if [ -z "$CLIENT" ]
|
||||
then
|
||||
# kubeadm init --ignore-preflight-errors=SystemVerification
|
||||
# mkdir -p $HOME/.kube
|
||||
# cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
|
||||
# chown $(id -u):$(id -g) $HOME/.kube/config
|
||||
:
|
||||
|
||||
elif [ "$CLIENT" = "true" ]
|
||||
then
|
||||
kubeadm join $IP --token $TOKEN --discovery-token-ca-cert-hash $HASH --ignore-preflight-errors=SystemVerification
|
||||
echo "Client ($IP) joined to Master"
|
||||
else
|
||||
echo "Invalid argument"
|
||||
fi
|
||||
|
10
deploy/weavenet_setup.sh
Normal file
10
deploy/weavenet_setup.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Initialize Kubernetes
|
||||
kubeadm init --ignore-preflight-errors=SystemVerification
|
||||
mkdir -p $HOME/.kube
|
||||
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
|
||||
chown $(id -u):$(id -g) $HOME/.kube/config
|
||||
|
||||
## Apply WeaveNet CNI plugin
|
||||
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
|
Reference in New Issue
Block a user