forked from openebs/openebs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openebs#1238 from yudaykiran/Fix-for-Issue#1043
Fix-for-Issue#1043: CentOS-based test bed for kubernetes cluster
- Loading branch information
Showing
14 changed files
with
738 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
kubeversion=`kubectl version --short | grep 'Server Version' | awk {'print $3'}` | ||
kuberegex='^v1[.][0-8][.][0-9][0-9]?$' | ||
|
||
function patch_kube_proxy(){ | ||
kubectl -n kube-system get ds -l 'k8s-app=kube-proxy' -o json \ | ||
| jq '.items[0].spec.template.spec.containers[0].command |= .+ ["--proxy-mode=userspace"]' \ | ||
| kubectl apply -f - \ | ||
&& kubectl -n kube-system delete pods -l 'k8s-app=kube-proxy' | ||
} | ||
|
||
function setup_k8s_weave() { | ||
kubectl apply -f $HOME/setup/cni/weave/weave-daemonset-k8s-1.6.yaml | ||
|
||
if [[ $? -ne 0 ]]; then | ||
|
||
kubectl delete -f $HOME/setup/cni/weave/weave-daemonset-k8s-1.6.yaml | ||
export kubever=$(kubectl version | base64 | tr -d '\n') | ||
kubectl apply -f https://cloud.weave.works/k8s/net?k8s-version=$kubever | ||
|
||
if [[ $? -ne 0 ]]; then | ||
"Unable to apply the Pod Network. SSH into the master and apply a Pod Network for your Cluster." | ||
fi | ||
|
||
fi | ||
} | ||
|
||
function setup_k8s_flannel() { | ||
|
||
cat $HOME/setup/cni/flannel/kube-flannel.yml | ||
|
||
kubectl apply -f $HOME/setup/cni/flannel/kube-flannel.yml | ||
|
||
if [[ $? -ne 0 ]]; then | ||
|
||
kubectl delete -f $HOME/setup/cni/flannel/kube-flannel.yml | ||
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml | ||
|
||
if [[ $? -ne 0 ]]; then | ||
echo "Unable to apply the Pod Network. SSH into the master and apply a Pod Network for your Cluster." | ||
fi | ||
|
||
fi | ||
|
||
} | ||
|
||
#Patching kube-proxy to run with --proxy-mode=userspace | ||
echo Patching the kube-proxy for CNI Networks... | ||
patch_kube_proxy | ||
|
||
[[ $kubeversion =~ $kuberegex ]] | ||
|
||
if [[ $? -eq 1 ]]; then | ||
echo Configure Pod Network with flannel | ||
setup_k8s_flannel | ||
else | ||
echo Configure Pod Network with Weave | ||
setup_k8s_weave | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#!/bin/bash | ||
distribution=${1:-"ubuntu"} | ||
|
||
sudo docker pull gcr.io/google_containers/kubernetes-dashboard-amd64:v1.6.3 | ||
|
||
mkdir -p /home/ubuntu/setup/dashboard | ||
cp /vagrant/boxes/k8s-dashboard/external/kubernetes-dashboard-1.6.3.yaml /home/ubuntu/setup/dashboard/ | ||
if [ "$distribution" = "ubuntu" ]; then | ||
mkdir -p /home/ubuntu/setup/dashboard | ||
cp /vagrant/boxes/k8s-dashboard/external/kubernetes-dashboard-1.6.3.yaml /home/ubuntu/setup/dashboard/ | ||
else | ||
mkdir -p /home/vagrant/setup/dashboard | ||
cp /vagrant/boxes/k8s-dashboard/external/kubernetes-dashboard-1.6.3.yaml /home/vagrant/setup/dashboard/ | ||
fi |
Oops, something went wrong.