-
Notifications
You must be signed in to change notification settings - Fork 80
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
deploy_minikube.sh: Adding support for Centos8 #6073
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,34 +14,67 @@ set -x | |
# NOTE: This script was originally copied from the Cojaeger-operator build | ||
# https://github.com/jaegertracing/jaeger-operator/blob/master/.travis/setupMinikube.sh | ||
|
||
# socat is needed for port forwarding | ||
sudo apt-get update && sudo apt-get install socat && sudo apt-get install conntrack | ||
|
||
export MINIKUBE_VERSION=v1.8.2 | ||
export KUBERNETES_VERSION=v1.17.3 | ||
|
||
sudo mount --make-rshared / | ||
sudo mount --make-rshared /proc | ||
sudo mount --make-rshared /sys | ||
source /etc/os-release | ||
|
||
if [ "${ID}" == "ubuntu" ] | ||
then | ||
# socat is needed for port forwarding | ||
sudo apt-get update && sudo apt-get install socat && sudo apt-get install conntrack | ||
sudo mount --make-rshared / | ||
sudo mount --make-rshared /proc | ||
sudo mount --make-rshared /sys | ||
elif [ "${ID}" == "centos" ] | ||
then | ||
dnf install -y sudo | ||
sudo dnf -y update && sudo dnf -y install socat conntrack | ||
dnf install -y dnf-plugins-core | ||
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | ||
sudo dnf install -y docker-ce docker-ce-cli containerd.io --nobest | ||
#disable SELinux | ||
SELinux_status=$(sestatus | grep "SELinux status" | awk -F ":" '{print $2}' | xargs ) | ||
if [ "${SELinux_status}" == "enabled" ] | ||
then | ||
sudo setenforce 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oy :( Why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently, kubeadm on CentOS needs SELinux to be disabled: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does that happen with podman as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I mean, somehow, magically it is working in RHEL, no?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should look into it one we can switch into podman (see previous comment #6073 (comment)) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are some locations where minikube stores executables, and these try to access configuration files. SElinux prevents that. I am not sure if the location that minikube uses is dynamic, or predictable. In the 2nd case, creating the directories in advance and setting appropriate labels might work. This obviously need some more research. Moving to Permissive mode is acceptable for the moment. |
||
fi | ||
else | ||
echo "${ID} is not supported for ${0}, Exiting." | ||
exit 1 | ||
fi | ||
|
||
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubectl && \ | ||
chmod +x kubectl && \ | ||
sudo mv kubectl /usr/local/bin/ | ||
#moving kubectl to /usr/bin/ and not /usr/local/bin/ because on Centos it fails to sudo from /usr/local/bin/ | ||
# it fails to sudo from /usr/local/bin/ even if it is the ${PATH} | ||
sudo mv kubectl /usr/bin/ | ||
|
||
curl -Lo minikube https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-amd64 && \ | ||
chmod +x minikube && \ | ||
sudo mv minikube /usr/local/bin/minikube | ||
#moving minikube to /usr/bin/ and not /usr/local/bin/ because on Centos it fails to sudo from /usr/local/bin/ | ||
# it fails to sudo from /usr/local/bin/ even if it is the ${PATH} | ||
sudo mv minikube /usr/bin/minikube | ||
liranmauda marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
mkdir "${HOME}"/.kube || true | ||
touch "${HOME}"/.kube/config | ||
|
||
# minikube config | ||
minikube config set WantUpdateNotification false | ||
minikube config set WantNoneDriverWarning false | ||
minikube config set vm-driver none | ||
|
||
cat ~/.minikube/config/config.json | ||
|
||
minikube version | ||
sudo minikube start --kubernetes-version=$KUBERNETES_VERSION #--insecure-registry="${LOCAL_IP}:5000" #TODO Remove insecure | ||
sudo chown -R travis: /home/travis/.minikube/ | ||
#sudo minikube start --kubernetes-version=$KUBERNETES_VERSION #--insecure-registry="${LOCAL_IP}:5000" #TODO Remove insecure | ||
sudo minikube start --kubernetes-version=$KUBERNETES_VERSION | ||
|
||
current_user=$(whoami) | ||
if [ "${current_user}" != "root" ] | ||
then | ||
sudo chown -R ${current_user}: /home/${current_user}/.minikube/ | ||
liranmauda marked this conversation as resolved.
Show resolved
Hide resolved
|
||
fi | ||
|
||
minikube update-context | ||
liranmauda marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why docker-ce and not podman and/or buildah?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
originally it was on deploying Ubuntu (as it for travis runs).
We can change to podman when running on Centos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the look of it, minikube support for podman is still WIP.
We can see 2 things:
We are using MINIKUBE_VERSION=v1.8.2 and KUBERNETES_VERSION=v1.17.3 due to kubernetes/minikube#7828
running with podman results in:
once podman support in minikube will be better, and we will be able to upgrade the minikube version we can switch to podman on Centos8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have opened a new issue to track this: #6075
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have seen similar problems with minikube+podman, it does not really work well yet.