Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable RBAC in Minikube - Closes #287 #343

Merged
merged 3 commits into from
Apr 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions .travis/setup-kubernetes.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
#!/bin/bash

rm ~/.kube/config
rm -rf ~/.kube

function install_kubectl {
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl
sudo cp kubectl /usr/bin
}

function wait_for_minikube {
i="0"

while [ $i -lt 60 ]
do
kubectl cluster-info &> /dev/null
if [ $? -ne 0 ]
then
sleep 1
else
return 0
fi
i=$[$i+1]
done

return 1
}

if [ "$TEST_CLUSTER" = "minikube" ]; then
install_kubectl
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube
Expand All @@ -22,8 +40,22 @@ if [ "$TEST_CLUSTER" = "minikube" ]; then
docker run -d -p 5000:5000 registry

export KUBECONFIG=$HOME/.kube/config
sudo -E minikube start --vm-driver=none --insecure-registry localhost:5000
sudo -E minikube start --vm-driver=none --insecure-registry localhost:5000 --extra-config=apiserver.Authorization.Mode=RBAC
sudo -E minikube addons enable default-storageclass

wait_for_minikube

if [ $? -ne 0 ]
then
echo "Minikube failed to start"
exit 1
else
# The role needs to be added because Minikube is not fully prepared for RBAC.
# Without adding the cluster-admin rights to the default service account in kube-system
# some components would be crashing (such as KubeDNS). This should have no impact on
# RBAC for Strimzi during the system tests.
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
fi
elif [ "$TEST_CLUSTER" = "minishift" ]; then
#install_kubectl
MS_VERSION=1.13.1
Expand Down