You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Note** Tekton uses [Go Modules](https://golang.org/doc/modules/gomod-ref) (i.e., `go mod`) for package management so you may clone the repository to a location of your choosing.
149
+
> **Note**: Tekton uses [Go Modules](https://golang.org/doc/modules/gomod-ref) (i.e., `go mod`) for package management so you may clone the repository to a location of your choosing.
149
150
150
151
1. Configure `git` remote repositories
151
152
@@ -286,12 +287,9 @@ The recommended minimum development configuration is:
286
287
--cluster-version=1.18
287
288
```
288
289
289
-
> **Note** The recommended [GCE machine type](https://cloud.google.com/compute/docs/machine-types) is `n1-standard-4`
290
-
> **Note** that
291
-
[the `--scopes` argument to `gcloud container cluster create`](https://cloud.google.com/sdk/gcloud/reference/container/clusters/create#--scopes)
292
-
controls what GCP resources the cluster's default service account has access
293
-
to;for example to give the default service account full access to your GCR
294
-
registry, you can add `storage-full` to your `--scopes` arg. See [Authenticating to GCP](https://cloud.google.com/kubernetes-engine/docs/tutorials/authenticating-to-cloud-platform) for more details.
290
+
> **Note**: The recommended [GCE machine type](https://cloud.google.com/compute/docs/machine-types) is `'n1-standard-4'`.
291
+
292
+
> **Note**: [The `'--scopes'` argument](https://cloud.google.com/sdk/gcloud/reference/container/clusters/create#--scopes) on the `'gcloud container cluster create'` command controls what GCP resources the cluster's default service account has access to;for example, to give the default service account full access to your GCR registry, you can add `'storage-full'` to the `--scopes` arg. See [Authenticating to GCP](https://cloud.google.com/kubernetes-engine/docs/tutorials/authenticating-to-cloud-platform) for more details.
295
293
296
294
1. Grant cluster-admin permissions to the current user:
297
295
@@ -312,9 +310,9 @@ While iterating on code changes to the project, you may need to:
1. [Verify installation](#verify-installation) and make sure there are no errors by [accessing the logs](#accessing-logs)
314
312
1. Use various development scripts, as needed, in the ['hack' directory](https://github.com/tektoncd/pipeline/tree/main/hack), For example:
315
-
- Update your (external) dependencies with: `./hack/update-deps.sh`.
316
-
- Update your type definitions with: `./hack/update-codegen.sh`.
317
-
- Update your OpenAPI specs with: `./hack/update-openapigen.sh`.
313
+
- Update your (external) dependencies with: `./hack/update-deps.sh`
314
+
- Update your type definitions with: `./hack/update-codegen.sh`
315
+
- Update your OpenAPI specs with: `./hack/update-openapigen.sh`
318
316
1. Update or [add new CRD types](#adding-new-types) as needed
319
317
1. Update, [add and run tests](./test/README.md#tests)
320
318
@@ -325,6 +323,8 @@ To make changes to these CRDs, you will probably interact with:
325
323
- The clients are in [./pkg/client](./pkg/client) (these are generated by
326
324
`./hack/update-codegen.sh`)
327
325
326
+
---
327
+
328
328
### Managing Tekton Objects using `ko`
329
329
330
330
The `ko`command is the preferred method to manage (i.e., create, modify or delete) Tekton Objects in Kubernetes from your local fork of the project. Some common operations include:
@@ -361,7 +361,7 @@ As you make changes to the code, you can redeploy your controller with:
361
361
ko apply -f config/controller.yaml
362
362
```
363
363
364
-
#### Install in custom namespace
364
+
#### Installing into custom namespaces
365
365
366
366
When managing different development branches of code (with changed Tekton objects and controllers) in the same K8s instance, it may be helpful to install them into a custom (non-default) namespace. The ability to map a code branch to a corresponding namespace may make it easier to identify and manage the objects as a group as well as isolate log output.
- Change (resolve) all `namespace` values in K8s configuration files within the `config/` subdirectory to be updated to a name of your choosing.
385
386
- Builds and push images with the new namespace to your container registry and
386
387
- Update all Tekton Objects in K8s using these images
387
388
388
389
It will also update the default system namespace used for K8s `deployments` to the new value for all subsequent `kubectl` commands.
389
390
391
+
---
392
+
393
+
### Standing up a K8s cluster with Tekton using the `kind` tool
394
+
395
+
An alternative to standing up your own K8s cluster and installing Tekton using `ko` is by using the [kind](https://kind.sigs.k8s.io/) tool. It was designed to help create and run local, Kubernetes clusters in Docker to assist in local development and testing.
396
+
397
+
The [Tekton "plumbing" project](https://github.com/tektoncd/plumbing) provides a convenience script, named ['tekton_in_kind.sh'](https://github.com/tektoncd/plumbing/blob/main/hack/tekton_in_kind.sh), that leverages `kind` to create a cluster and then deploy Tekton Pipeline, [Tekton Triggers](https://github.com/tektoncd/triggers) and [Tekton Dashboard](https://github.com/tektoncd/dashboard) components into it.
398
+
399
+
See Tekton Plumbing's [DEVELOPMENT.md](https://github.com/tektoncd/plumbing/blob/main/DEVELOPMENT.md) for more details on this and other helpful scripts and tools.
400
+
401
+
#### Installation and prerequisites
402
+
403
+
- Clone the [Tekton Plumbing](https://github.com/tektoncd/plumbing) repository which has the ['tekton_in_kind.sh'](https://github.com/tektoncd/plumbing/blob/main/hack/tekton_in_kind.sh) and other helpful scripts.
404
+
- `kind`: Install using its ["quick start"](https://kind.sigs.k8s.io/docs/user/quick-start/) documentation.
405
+
- `Docker`: `kind` also requires Docker to be installed and running locally. Use the [Get Docker](https://docs.docker.com/get-docker/) instructions.
406
+
407
+
#### Create a cluster with Tekton components
408
+
409
+
Change into the Tekton plumbing repository you cloned and invoke the script:
410
+
411
+
```shell
412
+
cd plumbing
413
+
./hack/tekton_in_kind.sh
414
+
```
415
+
416
+
The script, after using `kind` to create the K8s cluster, uses `kubectl` to install the `latest` released versions of Tekton components. After successful completion, the script will have:
417
+
418
+
- Created a K8s cluster named `tekton`
419
+
- Created a `cluster-context`for`kubectl` named `'kind-tekton'` and set it as the `current-context`
420
+
- Deployed the latest Tekton Pipeline, Trigger and Dashboard components
421
+
- Made Tekton Dashboard available at `http://localhost:9097`
422
+
423
+
After the Tekton components are installed using this script, you can than use the `ko` tool to build and apply your development changes to the cluster for testing.
424
+
425
+
##### Using a different cluster name and Tekton versions
426
+
427
+
You can also specify a different cluster name and released versions of components you want installed:
0 commit comments