Skip to content

Instantly share code, notes, and snippets.

@jsanda
Created November 8, 2018 15:32
Show Gist options
  • Save jsanda/562e78b138d252879b870144cd4ca8d7 to your computer and use it in GitHub Desktop.
Save jsanda/562e78b138d252879b870144cd4ca8d7 to your computer and use it in GitHub Desktop.
initializes knative env vars for minishift/minikube
#!/bin/bash
#
# This script sets up environment variables needed for knative development. See
# https://github.com/knative/serving/blob/master/DEVELOPMENT.md for more info.
#
# Note that the script assumes that either minishift or minikube is running.
if minishift status | grep -q "Running" ; then
eval $(minishift oc-env)
eval $(minishift docker-env)
export K8S_CLUSTER_OVERRIDE=$(minishift ip | sed -e 's/\./\-/g'):8443
export K8S_USER_OVERRIDE=admin
elif minikube status | grep -q "Running"; then
eval $(minikube docker-env)
export K8S_CLUSTER_OVERRIDE=$(minikube ip | sed -e 's/\./\-/g'):8443
export K8S_USER_OVERRIDE=$USERNAME
fi
export KO_DOCKER_REPO='ko.local'
export DOCKER_REPO_OVERRIDE="${KO_DOCKER_REPO}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment