Knative – Knative Reference Documentation https://knative.dev/v0.21-docs/reference/ Recent content in Knative Reference Documentation on Knative Hugo -- gohugo.io V0.21-Docs: Knative Release Notes https://knative.dev/v0.21-docs/reference/relnotes/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.21-docs/reference/relnotes/ <p>For details about the Knative releases, see the following pages:</p> <ul> <li><a href="https://github.com/knative/serving/releases">Knative Serving releases</a></li> <li><a href="https://github.com/knative/serving-operator/releases">Knative Serving Operator releases</a></li> <li><a href="https://github.com/knative/client/releases">Knative CLI releases</a></li> <li><a href="https://github.com/knative/eventing/releases">Knative Eventing releases</a></li> </ul> V0.21-Docs: Knative API Reference Documentation https://knative.dev/v0.21-docs/reference/api/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.21-docs/reference/api/ V0.21-Docs: Additional resources https://knative.dev/v0.21-docs/reference/resources/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.21-docs/reference/resources/ <p>This page contains information about various tools and technologies that are useful to anyone developing on Knative.</p> <h3 id="kohttpsgithubcomgoogleko"><a href="https://github.com/google/ko"><code>ko</code></a></h3> <p><code>ko</code> is a tool designed to make development of Go apps on Kubernetes easier, by abstracting away the container image being used, and instead referring to Go packages by their <a href="https://golang.org/doc/code.html#ImportPaths">import paths</a> (e.g., <code>github.com/kaniko/serving/cmd/controller</code>)</p> <p>The typical usage is <code>ko apply --filename config.yaml</code>, which reads in the config YAML, and looks for Go import paths representing runnable commands (i.e., <code>package main</code>). When it finds a matching import path, <code>ko</code> builds the package using <code>go build</code> then pushes a container image containing that binary on top of a base image (by default, <code>gcr.io/distroless/base</code>) to <code>$KO_DOCKER_REPO/unique-string</code>. After pushing those images, <code>ko</code> replaces instances of matched import paths with fully-qualified references to the images it pushed.</p> <p>So if <code>ko apply</code> was passed this config:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">github.com/my/repo/cmd/foo</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><p>&hellip;it would produce YAML like:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/my-docker-repo/foo-zyxwvut@sha256:abcdef</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># image by digest</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><p>(This assumes that you have set the environment variable <code>KO_DOCKER_REPO=gcr.io/my-docker-repo</code>)</p> <p><code>ko apply</code> then passes this generated YAML config to <code>kubectl apply</code>.</p> <p><code>ko</code> also supports:</p> <ul> <li><code>ko publish</code> to simply push images and not produce configs.</li> <li><code>ko resolve</code> to push images and output the generated configs, but not <code>kubectl apply</code> them.</li> <li><code>ko delete</code> to simply passthrough to <code>kubectl delete</code> for convenience.</li> </ul> <p><code>ko</code> is used during development and release of Knative components, but is not intended to be required for <em>users</em> of Knative &ndash; they should only need to <code>kubectl apply</code> released configs generated by <code>ko</code>.</p>