From e1754000396f11f6d8ba0332ec8e5872704656df Mon Sep 17 00:00:00 2001 From: "Paul S. Schweigert" Date: Tue, 21 Jul 2020 23:23:43 -0400 Subject: [PATCH] Fixes #2971, adding a section to the tutorial for using minikube when running locally --- docs/tutorial.md | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/docs/tutorial.md b/docs/tutorial.md index 505ee1e73bb..73bbe465cfc 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -555,11 +555,14 @@ You can also see the statuses of the individual `TaskRuns`. ## Running this tutorial locally -This section provides guidelines for completing this tutorial on your local workstation. +This section provides guidelines for completing this tutorial on your local workstation on: -### Prerequisites +* [Docker for Desktop](#prerequisites-docker-for-desktop) +* [Minikube](#prerequisites-minikube) -Complete these prerequisites to run this tutorial locally: +### Prerequisites: Docker for Desktop + +Complete these prerequisites to run this tutorial locally using Docker for Desktop: - Install the [required tools](https://github.com/tektoncd/pipeline/blob/master/DEVELOPMENT.md#requirements). - Install [Docker for Desktop](https://www.docker.com/products/docker-desktop) and configure it to use six CPUs, @@ -594,6 +597,33 @@ You must reconfigure any `image` resource definitions in your `PipelineResources example configuration at . - To learn more about obtaining logs, see [Logs](logs.md). +### Prerequisites: Minikube + +Complete these prerequisites to run this tutorial locally using Minikube: + +- Install the [required tools](https://github.com/tektoncd/pipeline/blob/master/DEVELOPMENT.md#requirements). +- Install [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) and start a sesion as follows: +```bash +minikube start --memory 10240 --cpus 6 +``` +- Point your shell to minikube's docker-daemon by running `eval $(minikube -p minikube docker-env)` +- Set up a [registry on minikube](https://github.com/kubernetes/minikube/tree/master/deploy/addons/registry-aliases) by running `minikube addons enable registry` and `minikube addons enable registry-aliases` + +### Reconfigure `image` resources + +The `registry-aliases` addon will create several aliases for the minikube registry. You'll need to reconfigure your `image` resource definitions to use one of these aliases in your `PipelineResources` (for this tutorial, we use `example.com`; for a full list of aliases, you can run `minikube ssh -- cat /etc/hosts`. You can also configure your own alias by editing minikube's `/etc/hosts` file and the `coredns` configmap in the `kube-system` namespace). + +- Set the URL to `example.com/` +- When using `ko`, be sure to [use the `-L` flag](https://github.com/google/ko/blob/master/README.md#with-minikube) (i.e. `ko apply -L -f config/`) +- Set your applications (such as deployment definitions) to push to + `example.com/`. + +If you wish to use a different image URL, you can add the appropriate line to minikube's `/etc/hosts`. + +### Reconfigure logging + +See the information in the "Docker for Desktop" section + ## Further reading To learn more about the Tekton Pipelines entities involved in this tutorial, see the following topics: