Minor fixes to minikube startup script

- Set back ownership of ~/.kube and ~/.minikube to current user
- Remove not needed -E flag to sudo commands
- Remove unused etcd data directory
- Uplift minikube to latest stable release

This merely copies over the following Vino change:
https://review.opendev.org/c/airship/vino/+/782880

Signed-off-by: Sean Eagan <seaneagan1@gmail.com>
Change-Id: Iadf605b9028811f645262aa1b6354ed574f212ba
This commit is contained in:
Sean Eagan 2021-04-22 10:29:45 -05:00
parent 068afe5bb9
commit e4081ba421
1 changed files with 10 additions and 12 deletions

View File

@ -2,8 +2,8 @@
set -ex
: ${KUBE_VERSION:="v1.19.2"}
: ${MINIKUBE_VERSION:="v1.16.0"}
: ${KUBE_VERSION:="v1.20.2"}
: ${MINIKUBE_VERSION:="v1.18.1"}
: ${UPSTREAM_DNS_SERVER:="8.8.4.4"}
: ${DNS_DOMAIN:="cluster.local"}
: ${CALICO_VERSION:="v3.17"}
@ -13,7 +13,6 @@ export DEBCONF_NONINTERACTIVE_SEEN=true
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update
sudo -E apt-get install -y \
socat \
jq \
@ -24,10 +23,6 @@ sudo -E apt-get install -y \
conntrack \
libffi-dev
# Prepare tmpfs for etcd
sudo mkdir -p /data
sudo mount -t tmpfs -o size=512m tmpfs /data
# Download calico manifest
if [ ! -f "$CNI_MANIFEST_PATH" ]; then
curl -Ss https://docs.projectcalico.org/"${CALICO_VERSION}"/manifests/calico.yaml -o ${CNI_MANIFEST_PATH}
@ -37,19 +32,19 @@ fi
URL="https://storage.googleapis.com"
sudo -E curl -sSLo /usr/local/bin/minikube "${URL}"/minikube/releases/"${MINIKUBE_VERSION}"/minikube-linux-amd64
sudo -E curl -sSLo /usr/local/bin/kubectl "${URL}"/kubernetes-release/release/"${KUBE_VERSION}"/bin/linux/amd64/kubectl
sudo -E chmod +x /usr/local/bin/minikube
sudo -E chmod +x /usr/local/bin/kubectl
sudo chmod +x /usr/local/bin/minikube
sudo chmod +x /usr/local/bin/kubectl
export CHANGE_MINIKUBE_NONE_USER=true
export MINIKUBE_IN_STYLE=false
sudo -E minikube start \
--kubernetes-version="${KUBE_VERSION}" \
--embed-certs=true \
--interactive=false \
--driver=none \
--wait=apiserver,system_pods,node_ready \
--wait-timeout=6m0s \
--wait-timeout=15m0s \
--network-plugin=cni \
--cni=${CNI_MANIFEST_PATH} \
--extra-config=kube-proxy.mode=ipvs \
@ -58,6 +53,8 @@ sudo -E minikube start \
--extra-config=kubeadm.pod-network-cidr=192.168.0.0/16 \
--extra-config=kubelet.resolv-conf=/run/systemd/resolve/resolv.conf
sudo chown -R "${USER}:${USER}" "${HOME}/.kube" "${HOME}/.minikube"
kubectl get nodes -o wide
kubectl get pod -A
@ -91,4 +88,5 @@ metadata:
namespace: kube-system
EOF
kubectl wait --for=condition=Ready pods --all -A --timeout=180s
kubectl wait --for=condition=Ready pods --all -A --timeout=180s