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

more dev-env script improvements #4415

Merged
merged 1 commit into from
Aug 8, 2019
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
15 changes: 5 additions & 10 deletions build/dev-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ set -o errexit
set -o nounset
set -o pipefail

SKIP_MINIKUBE_START=${SKIP_MINIKUBE_START:-}
NAMESPACE="${NAMESPACE:-ingress-nginx}"
echo "NAMESPACE is set to ${NAMESPACE}"

Expand All @@ -34,18 +33,15 @@ export REGISTRY=${REGISTRY:-ingress-controller}

DEV_IMAGE=${REGISTRY}/nginx-ingress-controller:${TAG}

if [ -z "${SKIP_MINIKUBE_START}" ]; then
test $(minikube status | grep -c Running) -ge 2 && $(minikube status | grep -q 'Correctly Configured') || minikube start \
--extra-config=kubelet.sync-frequency=1s \
--extra-config=apiserver.authorization-mode=RBAC
test $(minikube status | grep -c Running) -ge 2 && $(minikube status | grep -q 'Correctly Configured') || minikube start \
--extra-config=kubelet.sync-frequency=1s \
--extra-config=apiserver.authorization-mode=RBAC

eval $(minikube docker-env --shell bash)
fi
eval $(minikube docker-env --shell bash)

echo "[dev-env] building container"
make build container

docker save "${DEV_IMAGE}" | (eval $(minikube docker-env --shell bash) && docker load) || true
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
Expand All @@ -72,7 +68,6 @@ if [[ ${KUBE_CLIENT_VERSION} -lt 14 ]]; then
kustomize build $ROOT | kubectl apply -f -
else
sed -i -e "s|^namespace: .*|namespace: ${NAMESPACE}|g" "${ROOT}/kustomization.yaml"
sed -i -e "s|^- name: .*|- name: quay.io/kubernetes-ingress-controller/nginx-ingress-controller=${DEV_IMAGE}|g" "${ROOT}/kustomization.yaml"

echo "[dev-env] deploying NGINX Ingress controller in namespace $NAMESPACE"
kubectl apply -k "${ROOT}"
Expand Down