Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garethr/knt
knt is a simple utility for working with Knative Build.
https://github.com/garethr/knt
knative knative-build python python3
Last synced: 2 days ago
JSON representation
knt is a simple utility for working with Knative Build.
- Host: GitHub
- URL: https://github.com/garethr/knt
- Owner: garethr
- License: other
- Created: 2018-11-15T15:11:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T01:18:17.000Z (about 2 years ago)
- Last Synced: 2024-12-19T17:33:30.295Z (4 days ago)
- Topics: knative, knative-build, python, python3
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KNT
`knt` is a simple utility for working with [Knative Build](https://github.com/knative/build). Specifically it helps with understanding and installing the various `BuildTemplates` currently available.
The tool maintains a list of known BuildTemplates (this is in lieu of a proper index or discovery mechanism) and makes referencing those templates by short name easy. For other templates you'll need to provide a full URL to the resource definition. You can list known templates with `knt list`:
```console
$ knt list
---------- ----------------------------------------------------------------------------------------------
buildah https://raw.githubusercontent.com/knative/build-templates/master/buildah/buildah.yaml
kaniko https://raw.githubusercontent.com/knative/build-templates/master/kaniko/kaniko.yaml
buildpack https://raw.githubusercontent.com/knative/build-templates/master/buildpack/buildpack.yaml
bazel https://raw.githubusercontent.com/knative/build-templates/master/bazel/bazel.yaml
jib-maven https://raw.githubusercontent.com/knative/build-templates/master/jib/jib-maven.yaml
jib-gradle https://raw.githubusercontent.com/knative/build-templates/master/jib/jib-gradle.yaml
buildkit https://raw.githubusercontent.com/knative/build-templates/master/buildkit/1-buildtemplate.yaml
---------- ----------------------------------------------------------------------------------------------
```You're now probably wondering what the user interface for those templates is. `knt inspect` will produce a human readable summary:
```console
$ knt inspect buildah
buildah
https://raw.githubusercontent.com/knative/build-templates/master/buildah/buildah.yamlParameters (4) Description Default
---------------- ----------------------------------------------------------------------------- ------------
BUILDER_IMAGE The location of the buildah builder image.
IMAGE The name of the image to push.
DOCKERFILE Path to the Dockerfile to build. ./Dockerfile
TLSVERIFY Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry) trueSteps (2) Image Command Args
----------- ---------------- --------- -------------------------
build ${BUILDER_IMAGE} bud
--tls-verify=${TLSVERIFY}
--layers
-f
${DOCKERFILE}
-t
${IMAGE}
.
push ${BUILDER_IMAGE} push
--tls-verify=${TLSVERIFY}
${IMAGE}
docker://${IMAGE}
```If you're now happy to install that template look no further than `knt install`:
```console
$ knt install kaniko
buildtemplate.build.knative.dev "kaniko" configured
```## Docker
`knt` is also available as a Docker Image. Note that `install` will require you to mount your Kubernetes credentials and to for the container to have network access to the Kubernetes cluster.
```console
$ docker run --rm garethr/knt list
---------- ----------------------------------------------------------------------------------------------
buildah https://raw.githubusercontent.com/knative/build-templates/master/buildah/buildah.yaml
kaniko https://raw.githubusercontent.com/knative/build-templates/master/kaniko/kaniko.yaml
buildpack https://raw.githubusercontent.com/knative/build-templates/master/buildpack/buildpack.yaml
bazel https://raw.githubusercontent.com/knative/build-templates/master/bazel/bazel.yaml
jib-maven https://raw.githubusercontent.com/knative/build-templates/master/jib/jib-maven.yaml
jib-gradle https://raw.githubusercontent.com/knative/build-templates/master/jib/jib-gradle.yaml
buildkit https://raw.githubusercontent.com/knative/build-templates/master/buildkit/1-buildtemplate.yaml
---------- ----------------------------------------------------------------------------------------------
```## Usage
```console
Usage: command.py [OPTIONS] COMMAND [ARGS]...knt provides a number of tools for working with Knative Build Templates.
Options:
--help Show this message and exit.Commands:
inspect Inspect a BuildTemplate by name or URL.
install Install a BuildTempate based on short name or URL.
list List known BuildTemplates.
show Show YAML document for named BuildTemplate.
```