Coder Social home page Coder Social logo

knt's Introduction

KNT

knt is a simple utility for working with 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:

$ 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:

$ knt inspect buildah
buildah
https://raw.githubusercontent.com/knative/build-templates/master/buildah/buildah.yaml

Parameters (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)  true

Steps (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:

$ 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.

$ 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

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.

knt's People

Contributors

garethr avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.