Add ko local flag to kube cluster instructions (#1546)

* Add ko local flag to kube cluster instructions

* Address feedback

* Comments
This commit is contained in:
jonjohnsonjr 2018-07-09 18:33:33 -07:00 committed by Google Prow Robot
parent f27c719d2e
commit 1f4b8af54c
1 changed files with 39 additions and 1 deletions

View File

@ -165,7 +165,14 @@ To use a k8s cluster running in GKE:
[to setup access to GCR](#minikube-with-gcr).
1. Deploy the rest of Knative:
```bash
ko apply -f config/
# Use the minikube docker daemon (among other things)
eval $(minikube docker-env)
# Switch the current kubectl context to minikube
kubectl config use-context minikube
# Deploy to minikube w/o registry.
ko apply -L -f config/
```
1. [Enable log and metric collection](../DEVELOPMENT.md#enable-log-and-metric-collection)
@ -187,6 +194,37 @@ docker pull gcr.io/knative-samples/primer:latest
docker tag gcr.io/knative-samples/primer:latest dev.local/knative-samples/primer:v1
```
### Minikube locally with `ko`
You can instruct `ko` to sideload images into your Docker daemon instead of
publishing them to a registry via the `-L` (local) flag:
```shell
# Use the minikube docker daemon (among other things)
eval $(minikube docker-env)
# Switch the current kubectl context to minikube
kubectl config use-context minikube
# Deploy to minikube w/o registry.
ko apply -L -f config/
```
Alternatively (if you don't like flags), set `KO_DOCKER_REPO` to `ko.local`:
```shell
# Use the minikube docker daemon (among other things)
eval $(minikube docker-env)
# Switch the current kubectl context to minikube
kubectl config use-context minikube
# Set KO_DOCKER_REPO to a sentinel value for ko to sideload into the daemon.
export KO_DOCKER_REPO="ko.local"
# Deploy to minikube w/o registry.
ko apply -f config/
```
### Minikube with GCR