From 0365a7c1728aef7c3f2e112ef97edf98df0c3e4e Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Wed, 12 Feb 2020 20:19:57 -0300 Subject: [PATCH] Remove minikube and only use kind (#5059) --- build/dev-env.sh | 89 +++++++++++-------- build/run-in-docker.sh | 8 -- build/run-ingress-controller.sh | 6 -- deploy/{minikube => kind}/kustomization.yaml | 2 + deploy/kind/service-hostport.yaml | 25 ++++++ docs/deploy/index.md | 1 - docs/development.md | 5 -- .../third-party-addons/opentracing.md | 3 +- 8 files changed, 81 insertions(+), 58 deletions(-) rename deploy/{minikube => kind}/kustomization.yaml (82%) create mode 100644 deploy/kind/service-hostport.yaml diff --git a/build/dev-env.sh b/build/dev-env.sh index e535af5c4..dba3a9052 100755 --- a/build/dev-env.sh +++ b/build/dev-env.sh @@ -22,10 +22,7 @@ set -o errexit set -o nounset set -o pipefail -NAMESPACE="${NAMESPACE:-ingress-nginx}" -echo "NAMESPACE is set to ${NAMESPACE}" - -kubectl config use-context minikube +DIR=$(cd $(dirname "${BASH_SOURCE}") && pwd -P) export TAG=dev export ARCH=amd64 @@ -33,46 +30,66 @@ export REGISTRY=${REGISTRY:-ingress-controller} DEV_IMAGE=${REGISTRY}/nginx-ingress-controller:${TAG} -{ [ "$(minikube status | grep -c Running)" -ge 2 ] && minikube status | grep -qE ': Configured$|Correctly Configured'; } \ - || minikube start \ - --extra-config=kubelet.sync-frequency=1s \ - --extra-config=apiserver.authorization-mode=RBAC +kind --version || $(echo "Please install kind.";exit 1) -# shellcheck disable=SC2046 -eval $(minikube docker-env --shell bash) +KUBE_CLIENT_VERSION=$(kubectl version --client --short | awk '{print $3}' | cut -d. -f2) || true +if [[ ${KUBE_CLIENT_VERSION} -lt 14 ]]; then + echo "[dev-env] Please update kubectl to 1.15 or higher" +fi echo "[dev-env] building container" make build container docker tag "${REGISTRY}/nginx-ingress-controller-${ARCH}:${TAG}" "${DEV_IMAGE}" -# kubectl >= 1.14 includes Kustomize via "apply -k". Makes it easier to use on Linux as well, assuming kubectl installed -KUBE_CLIENT_VERSION=$(kubectl version --client --short | awk '{print $3}' | cut -d. -f2) || true -if [[ ${KUBE_CLIENT_VERSION} -lt 14 ]]; then - for tool in kubectl kustomize; do - echo "[dev-env] installing $tool" - $tool version || brew install $tool - done -fi +export K8S_VERSION=${K8S_VERSION:-v1.17.2@sha256:59df31fc61d1da5f46e8a61ef612fa53d3f9140f82419d1ef1a6b9656c6b737c} -if ! kubectl get namespace "${NAMESPACE}"; then - kubectl create namespace "${NAMESPACE}" -fi +export DOCKER_CLI_EXPERIMENTAL=enabled -kubectl get deploy nginx-ingress-controller -n "${NAMESPACE}" && kubectl delete deploy nginx-ingress-controller -n "${NAMESPACE}" +KIND_CLUSTER_NAME="ingress-nginx-dev" -ROOT=./deploy/minikube - -if [[ ${KUBE_CLIENT_VERSION} -lt 14 ]]; then - pushd $ROOT - kustomize edit set namespace "${NAMESPACE}" - kustomize edit set image "quay.io/kubernetes-ingress-controller/nginx-ingress-controller=${DEV_IMAGE}" - popd - - echo "[dev-env] deploying NGINX Ingress controller in namespace $NAMESPACE" - kustomize build $ROOT | kubectl apply -f - +if ! kind get clusters -q | grep -q ${KIND_CLUSTER_NAME}; then +echo "[dev-env] creating Kubernetes cluster with kind" +cat <**Prequisites**: Minikube must be installed. -See [releases](https://github.com/kubernetes/minikube/releases) for installation instructions. - -If you are using **MacOS** and deploying to **minikube**, the following command will build the local nginx controller container image and deploy the ingress controller onto a minikube cluster with RBAC enabled in the namespace `ingress-nginx`: - ``` $ make dev-env ``` diff --git a/docs/user-guide/third-party-addons/opentracing.md b/docs/user-guide/third-party-addons/opentracing.md index ca7dc9890..0ced23000 100644 --- a/docs/user-guide/third-party-addons/opentracing.md +++ b/docs/user-guide/third-party-addons/opentracing.md @@ -100,8 +100,7 @@ All these options (including host) allow environment variables, such as `$HOSTNA ## Examples -The following examples show how to deploy and test different distributed tracing systems. These example can be performed -using Minikube. +The following examples show how to deploy and test different distributed tracing systems. These example can be performed using Minikube. ### Zipkin