Knative – Installing Knative https://knative.dev/v0.23-docs/install/ Recent content in Installing Knative on Knative Hugo -- gohugo.io V0.23-Docs: Prerequisites https://knative.dev/v0.23-docs/install/prerequisites/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/prerequisites/ <p>Before installing Knative, you must meet the following prerequisites:</p> <h2 id="system-requirements">System requirements</h2> <p><strong>For prototyping purposes</strong>, Knative will work on most local deployments of Kubernetes. For example, you can use a local, one-node cluster that has 2 CPU and 4GB of memory.</p> <p><strong>For production purposes</strong>, it is recommended that:</p> <ul> <li>If you have only one node in your cluster, you will need at least 6 CPUs, 6 GB of memory, and 30 GB of disk storage.</li> <li>If you have multiple nodes in your cluster, for each node you will need at least 2 CPUs, 4 GB of memory, and 20 GB of disk storage.</li> </ul> <!--TODO: Verify these requirements--> <p><strong>NOTE:</strong> The system requirements provided are recommendations only. The requirements for your installation may vary, depending on whether you use optional components, such as a networking layer.</p> <h2 id="prerequisites">Prerequisites</h2> <p>Before installation, you must meet the following prerequisites:</p> <ul> <li>You have a cluster that uses Kubernetes v1.18 or newer.</li> <li>You have installed the <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/"><code>kubectl</code> CLI</a>.</li> <li>Your Kubernetes cluster must have access to the internet, since Kubernetes needs to be able to fetch images. (To pull from a private registry, see <a href="https://knative.dev/docs/serving/deploying/private-registry/">Deploying images from a private container registry</a>)</li> </ul> <h2 id="next-steps-install-knative-serving-and-eventing">Next Steps: Install Knative Serving and Eventing</h2> <p>You can install the Serving component, Eventing component, or both on your cluster. If you&rsquo;re planning on installing both, <strong>we recommend starting with Knative Serving.</strong></p> <ul> <li><a href="../install-serving-with-yaml">Installing Knative Serving using YAML files</a></li> <li><a href="../install-eventing-with-yaml">Installing Knative Eventing using YAML files</a></li> </ul> V0.23-Docs: Installing Knative Serving using YAML files https://knative.dev/v0.23-docs/install/install-serving-with-yaml/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/install-serving-with-yaml/ <p>This topic describes how to install Knative Serving by applying YAML files using the <code>kubectl</code> CLI.</p> <h2 id="prerequisites">Prerequisites</h2> <p>Before installation, you must meet the prerequisites. See <a href="../prerequisites">Knative Prerequisites</a>.</p> <h2 id="install-the-serving-component">Install the Serving component</h2> <p>To install the serving component:</p> <ol> <li> <p>Install the required custom resources:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/serving/releases/download/v0.23.0/serving-crds.yaml </code></pre></div></li> <li> <p>Install the core components of Knative Serving:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/serving/releases/download/v0.23.0/serving-core.yaml </code></pre></div></li> </ol> <p>For information about the YAML files in the Knative Serving and Eventing releases, see <a href="../installation-files">Installation files</a>.</p> <h2 id="install-a-networking-layer">Install a networking layer</h2> <p>The networking layer in Knative Serving is responsible for incoming requests and the associated responses for your Knative installation. Knative enables you to choose a networking layer and then translates Knative’s resources into the specific configuration for your chosen networking solution.</p> <p>You can choose a networking layer based on what you are familiar with, what is already installed on your cluster, or what is suitable for your use case. For prototyping purposes, if you have no preference for a networking layer, choose Kourier. For production use cases, Istio is a common choice.</p> <p>The tabs below expand to show instructions for installing a networking layer. Follow the procedure for the networking layer of your choice:</p> <!-- TODO: Link to document/diagram describing what is a networking layer. --> <!-- This indentation is important for things to render properly. --> <ul class="nav nav-tabs" id="serving_networking" role="tablist"> <li class="nav-item "> <a class="nav-link " id="serving_networking-0-tab" data-toggle="tab" href="#serving_networking-0" role="tab" aria-controls="serving_networking-0" aria-selected="true">Ambassador</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_networking-1-tab" data-toggle="tab" href="#serving_networking-1" role="tab" aria-controls="serving_networking-1" aria-selected="true">Contour</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_networking-2-tab" data-toggle="tab" href="#serving_networking-2" role="tab" aria-controls="serving_networking-2" aria-selected="true">Gloo</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_networking-3-tab" data-toggle="tab" href="#serving_networking-3" role="tab" aria-controls="serving_networking-3" aria-selected="true">Istio</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_networking-4-tab" data-toggle="tab" href="#serving_networking-4" role="tab" aria-controls="serving_networking-4" aria-selected="true">Kong</a> </li> <li class="nav-item active"> <a class="nav-link active" id="serving_networking-5-tab" data-toggle="tab" href="#serving_networking-5" role="tab" aria-controls="serving_networking-5" aria-selected="true">Kourier</a> </li> </ul> <div class="tab-content" > <div class="tab-pane fade " id="serving_networking-0" role="tabpanel" aria-labelledby="serving_networking-0-tab"> <p>The following commands install Ambassador and enable its Knative integration.</p> <ol> <li> <p>Create a namespace to install Ambassador in:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl create namespace ambassador </code></pre></div></li> <li> <p>Install Ambassador:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --namespace ambassador <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> -f https://getambassador.io/yaml/ambassador/ambassador-crds.yaml <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> -f https://getambassador.io/yaml/ambassador/ambassador-rbac.yaml <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> -f https://getambassador.io/yaml/ambassador/ambassador-service.yaml </code></pre></div></li> <li> <p>Give Ambassador the required permissions:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl patch clusterrolebinding ambassador -p <span style="color:#4e9a06">&#39;{&#34;subjects&#34;:[{&#34;kind&#34;: &#34;ServiceAccount&#34;, &#34;name&#34;: &#34;ambassador&#34;, &#34;namespace&#34;: &#34;ambassador&#34;}]}&#39;</span> </code></pre></div></li> <li> <p>Enable Knative support in Ambassador:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl <span style="color:#204a87">set</span> env --namespace ambassador deployments/ambassador <span style="color:#000">AMBASSADOR_KNATIVE_SUPPORT</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87">true</span> </code></pre></div></li> <li> <p>To configure Knative Serving to use Ambassador by default:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl patch configmap/config-network <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --namespace knative-serving <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --type merge <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --patch <span style="color:#4e9a06">&#39;{&#34;data&#34;:{&#34;ingress.class&#34;:&#34;ambassador.ingress.networking.knative.dev&#34;}}&#39;</span> </code></pre></div></li> <li> <p>Fetch the External IP or CNAME:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl --namespace ambassador get service ambassador </code></pre></div><p>Save this for configuring DNS below.</p> </li> </ol> </div> <div class="tab-pane fade " id="serving_networking-1" role="tabpanel" aria-labelledby="serving_networking-1-tab"> <p>The following commands install Contour and enable its Knative integration.</p> <ol> <li> <p>Install a properly configured Contour:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/net-contour/releases/download/v0.23.0/contour.yaml </code></pre></div></li> </ol> <!-- TODO(https://github.com/knative-sandbox/net-contour/issues/11): We need a guide on how to use/modify a pre-existing install. --> <ol> <li> <p>Install the Knative Contour controller:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/net-contour/releases/download/v0.23.0/net-contour.yaml </code></pre></div></li> <li> <p>To configure Knative Serving to use Contour by default:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl patch configmap/config-network <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --namespace knative-serving <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --type merge <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --patch <span style="color:#4e9a06">&#39;{&#34;data&#34;:{&#34;ingress.class&#34;:&#34;contour.ingress.networking.knative.dev&#34;}}&#39;</span> </code></pre></div></li> <li> <p>Fetch the External IP or CNAME:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl --namespace contour-external get service envoy </code></pre></div><p>Save this for configuring DNS below.</p> </li> </ol> </div> <div class="tab-pane fade " id="serving_networking-2" role="tabpanel" aria-labelledby="serving_networking-2-tab"> <p><em>For a detailed guide on Gloo integration, see <a href="https://docs.solo.io/gloo/latest/installation/knative/">Installing Gloo for Knative</a> in the Gloo documentation.</em></p> <p>The following commands install Gloo and enable its Knative integration.</p> <ol> <li> <p>Make sure <code>glooctl</code> is installed (version 1.3.x and higher recommended):</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">glooctl version </code></pre></div><p>If it is not installed, you can install the latest version using:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">curl -sL https://run.solo.io/gloo/install <span style="color:#000;font-weight:bold">|</span> sh <span style="color:#204a87">export</span> <span style="color:#000">PATH</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$HOME</span>/.gloo/bin:<span style="color:#000">$PATH</span> </code></pre></div><p>Or following the <a href="https://docs.solo.io/gloo/latest/installation/knative/#install-command-line-tool-cli">Gloo CLI install instructions</a>.</p> </li> <li> <p>Install Gloo and the Knative integration:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">glooctl install knative --install-knative<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87">false</span> </code></pre></div></li> <li> <p>Fetch the External IP or CNAME:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">glooctl proxy url --name knative-external-proxy </code></pre></div><p>Save this for configuring DNS below.</p> </li> </ol> </div> <div class="tab-pane fade " id="serving_networking-3" role="tabpanel" aria-labelledby="serving_networking-3-tab"> <p>The following commands install Istio and enable its Knative integration.</p> <ol> <li> <p>Install a properly configured Istio (<a href="../installing-istio">Advanced installation</a>)</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/net-istio/releases/download/v0.23.0/istio.yaml </code></pre></div></li> <li> <p>Install the Knative Istio controller:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/net-istio/releases/download/v0.23.0/net-istio.yaml </code></pre></div></li> <li> <p>Fetch the External IP or CNAME:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl --namespace istio-system get service istio-ingressgateway </code></pre></div><p>Save this for configuring DNS below.</p> </li> </ol> </div> <div class="tab-pane fade " id="serving_networking-4" role="tabpanel" aria-labelledby="serving_networking-4-tab"> <p>The following commands install Kong and enable its Knative integration.</p> <ol> <li> <p>Install Kong Ingress Controller:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://raw.githubusercontent.com/Kong/kubernetes-ingress-controller/0.9.x/deploy/single/all-in-one-dbless.yaml </code></pre></div></li> <li> <p>To configure Knative Serving to use Kong by default:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl patch configmap/config-network <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --namespace knative-serving <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --type merge <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --patch <span style="color:#4e9a06">&#39;{&#34;data&#34;:{&#34;ingress.class&#34;:&#34;kong&#34;}}&#39;</span> </code></pre></div></li> <li> <p>Fetch the External IP or CNAME:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl --namespace kong get service kong-proxy </code></pre></div><p>Save this for configuring DNS below.</p> </li> </ol> </div> <div class="tab-pane fade show active" id="serving_networking-5" role="tabpanel" aria-labelledby="serving_networking-5-tab"> <p>The following commands install Kourier and enable its Knative integration.</p> <ol> <li> <p>Install the Knative Kourier controller:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/net-kourier/releases/download/v0.23.0/kourier.yaml </code></pre></div></li> <li> <p>To configure Knative Serving to use Kourier by default:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl patch configmap/config-network <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --namespace knative-serving <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --type merge <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --patch <span style="color:#4e9a06">&#39;{&#34;data&#34;:{&#34;ingress.class&#34;:&#34;kourier.ingress.networking.knative.dev&#34;}}&#39;</span> </code></pre></div></li> <li> <p>Fetch the External IP or CNAME:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl --namespace kourier-system get service kourier </code></pre></div><p>Save this for configuring DNS below.</p> </li> </ol> </div> </div> <h2 id="verify-the-installation">Verify the installation</h2> <p>Monitor the Knative components until all of the components show a <code>STATUS</code> of <code>Running</code> or <code>Completed</code>:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl get pods --namespace knative-serving </code></pre></div><h2 id="configure-dns">Configure DNS</h2> <p>You can configure DNS to prevent the need to run curl commands with a host header.</p> <p>The tabs below expand to show instructions for configuring DNS. Follow the procedure for the DNS of your choice:</p> <!-- This indentation is important for things to render properly. --> <ul class="nav nav-tabs" id="serving_dns" role="tablist"> <li class="nav-item active"> <a class="nav-link active" id="serving_dns-0-tab" data-toggle="tab" href="#serving_dns-0" role="tab" aria-controls="serving_dns-0" aria-selected="true">Magic DNS (sslip.io)</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_dns-1-tab" data-toggle="tab" href="#serving_dns-1" role="tab" aria-controls="serving_dns-1" aria-selected="true">Real DNS</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_dns-2-tab" data-toggle="tab" href="#serving_dns-2" role="tab" aria-controls="serving_dns-2" aria-selected="true">Temporary DNS</a> </li> </ul> <div class="tab-content" > <div class="tab-pane fade show active" id="serving_dns-0" role="tabpanel" aria-labelledby="serving_dns-0-tab"> <p>We ship a simple Kubernetes Job called &ldquo;default domain&rdquo; that will (see caveats) configure Knative Serving to use <a href="http://sslip.io">sslip.io</a> as the default DNS suffix.</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/serving/releases/download/v0.23.0/serving-default-domain.yaml </code></pre></div><p><strong>Caveat</strong>: This will only work if the cluster LoadBalancer service exposes an IPv4 address or hostname, so it will not work with IPv6 clusters or local setups like Minikube. For these, see &ldquo;Real DNS&rdquo; or &ldquo;Temporary DNS&rdquo;.</p> </div> <div class="tab-pane fade " id="serving_dns-1" role="tabpanel" aria-labelledby="serving_dns-1-tab"> <p>To configure DNS for Knative, take the External IP or CNAME from setting up networking, and configure it with your DNS provider as follows:</p> <ul> <li> <p>If the networking layer produced an External IP address, then configure a wildcard <code>A</code> record for the domain:</p> <pre><code># Here knative.example.com is the domain suffix for your cluster *.knative.example.com == A 35.233.41.212 </code></pre></li> <li> <p>If the networking layer produced a CNAME, then configure a CNAME record for the domain:</p> <pre><code># Here knative.example.com is the domain suffix for your cluster *.knative.example.com == CNAME a317a278525d111e89f272a164fd35fb-1510370581.eu-central-1.elb.amazonaws.com </code></pre></li> </ul> <p>Once your DNS provider has been configured, direct Knative to use that domain:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash"><span style="color:#8f5902;font-style:italic"># Replace knative.example.com with your domain suffix</span> kubectl patch configmap/config-domain <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --namespace knative-serving <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --type merge <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --patch <span style="color:#4e9a06">&#39;{&#34;data&#34;:{&#34;knative.example.com&#34;:&#34;&#34;}}&#39;</span> </code></pre></div> </div> <div class="tab-pane fade " id="serving_dns-2" role="tabpanel" aria-labelledby="serving_dns-2-tab"> <p>If you are using <code>curl</code> to access the sample applications, or your own Knative app, and are unable to use the &ldquo;Magic DNS (sslip.io)&rdquo; or &ldquo;Real DNS&rdquo; methods, there is a temporary approach. This is useful for those who wish to evaluate Knative without altering their DNS configuration, as per the &ldquo;Real DNS&rdquo; method, or cannot use the &ldquo;Magic DNS&rdquo; method due to using, for example, minikube locally or IPv6 clusters.</p> <p>To access your application using <code>curl</code> using this method:</p> <ol> <li> <p>After starting your application, get the URL of your application:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl get ksvc </code></pre></div><p>The output should be similar to:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">NAME URL LATESTCREATED LATESTREADY READY REASON helloworld-go http://helloworld-go.default.example.com helloworld-go-vqjlf helloworld-go-vqjlf True </code></pre></div></li> <li> <p>Instruct <code>curl</code> to connect to the External IP or CNAME defined by the networking layer in section 3 above, and use the <code>-H &quot;Host:&quot;</code> command-line option to specify the Knative application&rsquo;s host name. For example, if the networking layer defines your External IP and port to be <code>http://192.168.39.228:32198</code> and you wish to access the above <code>helloworld-go</code> application, use:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">curl -H <span style="color:#4e9a06">&#34;Host: helloworld-go.default.example.com&#34;</span> http://192.168.39.228:32198 </code></pre></div><p>In the case of the provided <code>helloworld-go</code> sample application, the output should, using the default configuration, be:</p> <pre><code>Hello Go Sample v1! </code></pre></li> </ol> <p>Refer to the &ldquo;Real DNS&rdquo; method for a permanent solution.</p> </div> </div> <h2 id="next-steps">Next steps</h2> <p>After installing Knative Serving:</p> <ul> <li> <p><a href="../install-eventing-with-yaml">Installing Knative Eventing using YAML files</a></p> </li> <li> <p>To add optional enhancements to your installation, see <a href="../install-extensions">Installing optional extensions</a>.</p> </li> <li> <p>To easily interact with Knative Services, <a href="../../docs/client/install-kn">install the <code>kn</code> CLI</a></p> </li> </ul> V0.23-Docs: Installing Knative Eventing using YAML files https://knative.dev/v0.23-docs/install/install-eventing-with-yaml/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/install-eventing-with-yaml/ <p>This topic describes how to install Knative Eventing by applying YAML files using the <code>kubectl</code> CLI.</p> <h2 id="prerequisites">Prerequisites</h2> <p>Before installation, you must meet the prerequisites. See <a href="../prerequisites">Knative Prerequisites</a>.</p> <h2 id="install-the-eventing-component">Install the Eventing component</h2> <p>To install the Eventing component:</p> <ol> <li> <p>Install the required custom resource definitions (CRDs):</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/eventing/releases/download/v0.23.0/eventing-crds.yaml </code></pre></div></li> <li> <p>Install the core components of Eventing:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/eventing/releases/download/v0.23.0/eventing-core.yaml </code></pre></div></li> </ol> <p>For information about the YAML files in the Knative Serving and Eventing releases, see <a href="../installation-files">Installation files</a>.</p> <h2 id="verify-the-installation">Verify the installation</h2> <p>Monitor the Knative components until all of the components show a <code>STATUS</code> of <code>Running</code>:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl get pods --namespace knative-eventing </code></pre></div><h2 id="optional-install-a-default-channel-messaging-layer">Optional: Install a default channel (messaging) layer</h2> <p>The tabs below expand to show instructions for installing a default channel layer. Follow the procedure for the channel of your choice:</p> <!-- This indentation is important for things to render properly. --> <ul class="nav nav-tabs" id="eventing_channels" role="tablist"> <li class="nav-item "> <a class="nav-link " id="eventing_channels-0-tab" data-toggle="tab" href="#eventing_channels-0" role="tab" aria-controls="eventing_channels-0" aria-selected="true">Apache Kafka Channel</a> </li> <li class="nav-item "> <a class="nav-link " id="eventing_channels-1-tab" data-toggle="tab" href="#eventing_channels-1" role="tab" aria-controls="eventing_channels-1" aria-selected="true">Google Cloud Pub/Sub Channel</a> </li> <li class="nav-item active"> <a class="nav-link active" id="eventing_channels-2-tab" data-toggle="tab" href="#eventing_channels-2" role="tab" aria-controls="eventing_channels-2" aria-selected="true">In-Memory (standalone)</a> </li> <li class="nav-item "> <a class="nav-link " id="eventing_channels-3-tab" data-toggle="tab" href="#eventing_channels-3" role="tab" aria-controls="eventing_channels-3" aria-selected="true">NATS Channel</a> </li> </ul> <div class="tab-content" > <div class="tab-pane fade " id="eventing_channels-0" role="tabpanel" aria-labelledby="eventing_channels-0-tab"> <ol> <li> <p>First, <a href="../../eventing/samples/kafka/">Install Apache Kafka for Kubernetes</a></p> </li> <li> <p>Then install the Apache Kafka channel:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">curl -L <span style="color:#4e9a06">&#34;https://github.com/knative-sandbox/eventing-kafka/releases/download/v0.23.0/channel-consolidated.yaml&#34;</span> <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> <span style="color:#000;font-weight:bold">|</span> sed <span style="color:#4e9a06">&#39;s/REPLACE_WITH_CLUSTER_URL/my-cluster-kafka-bootstrap.kafka:9092/&#39;</span> <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> <span style="color:#000;font-weight:bold">|</span> kubectl apply -f - </code></pre></div></li> </ol> <p>To learn more about the Apache Kafka channel, try <a href="../../eventing/samples/kafka/channel/">our sample</a></p> </div> <div class="tab-pane fade " id="eventing_channels-1" role="tabpanel" aria-labelledby="eventing_channels-1-tab"> <ol> <li> <p>Install the Google Cloud Pub/Sub channel:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash"><span style="color:#8f5902;font-style:italic"># This installs both the Channel and the GCP Sources.</span> kubectl apply -f https://github.com/google/knative-gcp/releases/download/v0.23.0/cloud-run-events.yaml </code></pre></div></li> </ol> <p>To learn more about the Google Cloud Pub/Sub channel, try <a href="https://github.com/google/knative-gcp/blob/master/docs/examples/channel/">our sample</a></p> </div> <div class="tab-pane fade show active" id="eventing_channels-2" role="tabpanel" aria-labelledby="eventing_channels-2-tab"> <p>The following command installs an implementation of channel that runs in-memory. This implementation is nice because it is simple and standalone, but it is unsuitable for production use cases.</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/eventing/releases/download/v0.23.0/in-memory-channel.yaml </code></pre></div> </div> <div class="tab-pane fade " id="eventing_channels-3" role="tabpanel" aria-labelledby="eventing_channels-3-tab"> <ol> <li> <p>First, <a href="https://github.com/knative-sandbox/eventing-natss/tree/main/config">Install NATS Streaming for Kubernetes</a></p> </li> <li> <p>Then install the NATS Streaming channel:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative-sandbox/eventing-natss/releases/download/v0.23.0/300-natss-channel.yaml </code></pre></div></li> </ol> </div> </div> <h2 id="optional-install-a-broker-layer">Optional: Install a broker layer:</h2> <p>The tabs below expand to show instructions for installing the broker layer. Follow the procedure for the broker of your choice:</p> <!-- This indentation is important for things to render properly. --> <ul class="nav nav-tabs" id="eventing_brokers" role="tablist"> <li class="nav-item "> <a class="nav-link " id="eventing_brokers-0-tab" data-toggle="tab" href="#eventing_brokers-0" role="tab" aria-controls="eventing_brokers-0" aria-selected="true">Apache Kafka Broker</a> </li> <li class="nav-item active"> <a class="nav-link active" id="eventing_brokers-1-tab" data-toggle="tab" href="#eventing_brokers-1" role="tab" aria-controls="eventing_brokers-1" aria-selected="true">MT-Channel-based</a> </li> </ul> <div class="tab-content" > <div class="tab-pane fade " id="eventing_brokers-0" role="tabpanel" aria-labelledby="eventing_brokers-0-tab"> <p>The following commands install the Apache Kafka broker, and run event routing in a system namespace, <code>knative-eventing</code>, by default.</p> <ol> <li> <p>Install the Kafka controller by entering the following command:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.23.0/eventing-kafka-controller.yaml </code></pre></div></li> <li> <p>Install the Kafka broker data plane by entering the following command:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.23.0/eventing-kafka-broker.yaml </code></pre></div></li> </ol> <p>For more information, see the <a href="../../eventing/broker/kafka-broker">Kafka broker</a> documentation.</p> </div> <div class="tab-pane fade show active" id="eventing_brokers-1" role="tabpanel" aria-labelledby="eventing_brokers-1-tab"> <p>The following command installs an implementation of broker that utilizes channels and runs event routing components in a System Namespace, providing a smaller and simpler installation.</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/eventing/releases/download/v0.23.0/mt-channel-broker.yaml </code></pre></div><p>To customize which broker channel implementation is used, update the following ConfigMap to specify which configurations are used for which namespaces:</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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-br-defaults</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default-br-config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic"> </span><span style="color:#8f5902;font-style:italic"> # This is the cluster-wide default broker channel. </span><span style="color:#8f5902;font-style:italic"> clusterDefault: </span><span style="color:#8f5902;font-style:italic"> brokerClass: MTChannelBasedBroker </span><span style="color:#8f5902;font-style:italic"> apiVersion: v1 </span><span style="color:#8f5902;font-style:italic"> kind: ConfigMap </span><span style="color:#8f5902;font-style:italic"> name: imc-channel </span><span style="color:#8f5902;font-style:italic"> namespace: knative-eventing </span><span style="color:#8f5902;font-style:italic"> # This allows you to specify different defaults per-namespace, </span><span style="color:#8f5902;font-style:italic"> # in this case the &#34;some-namespace&#34; namespace will use the Kafka </span><span style="color:#8f5902;font-style:italic"> # channel ConfigMap by default (only for example, you will need </span><span style="color:#8f5902;font-style:italic"> # to install kafka also to make use of this). </span><span style="color:#8f5902;font-style:italic"> namespaceDefaults: </span><span style="color:#8f5902;font-style:italic"> some-namespace: </span><span style="color:#8f5902;font-style:italic"> brokerClass: MTChannelBasedBroker </span><span style="color:#8f5902;font-style:italic"> apiVersion: v1 </span><span style="color:#8f5902;font-style:italic"> kind: ConfigMap </span><span style="color:#8f5902;font-style:italic"> name: kafka-channel </span><span style="color:#8f5902;font-style:italic"> namespace: knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><p>The referenced <code>imc-channel</code> and <code>kafka-channel</code> example ConfigMaps would look 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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">imc-channel</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channelTemplateSpec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic"> </span><span style="color:#8f5902;font-style:italic"> apiVersion: messaging.knative.dev/v1 </span><span style="color:#8f5902;font-style:italic"> kind: InMemoryChannel</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><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">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-channel</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channelTemplateSpec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic"> </span><span style="color:#8f5902;font-style:italic"> apiVersion: messaging.knative.dev/v1alpha1 </span><span style="color:#8f5902;font-style:italic"> kind: KafkaChannel </span><span style="color:#8f5902;font-style:italic"> spec: </span><span style="color:#8f5902;font-style:italic"> numPartitions: 3 </span><span style="color:#8f5902;font-style:italic"> replicationFactor: 1</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><p><strong>NOTE:</strong> In order to use the KafkaChannel make sure it is installed on the cluster as discussed above.</p> </div> </div> <h2 id="next-steps">Next steps</h2> <p>After installing Knative Eventing:</p> <ul> <li> <p>To easily interact with Knative Eventing components, <a href="../../docs/client/install-kn">install the <code>kn</code> CLI</a></p> </li> <li> <p>To add optional enhancements to your installation, see <a href="../install-extensions">Installing optional extensions</a></p> </li> <li> <p><a href="../install-serving-with-yaml">Installing Knative Serving using YAML files</a></p> </li> </ul> V0.23-Docs: Installing optional extensions https://knative.dev/v0.23-docs/install/install-extensions/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/install-extensions/ <p>To add extra features to your Knative Serving or Eventing installation, you can install extensions by applying YAML files using the <code>kubectl</code> CLI.</p> <p>For information about the YAML files in the Knative Serving and Eventing releases, see <a href="../installation-files">Installation files</a>.</p> <h1 id="prerequisites">Prerequisites</h1> <p>Before you install any optional extensions, you must install Knative Serving or Eventing. See <a href="../install-serving-with-yaml">Installing Serving using YAML files</a> and <a href="../install-eventing-with-yaml">Installing Eventing using YAML files</a>.</p> <h2 id="install-optional-serving-extensions">Install optional Serving extensions</h2> <p>The tabs below expand to show instructions for installing each Serving extension.</p> <ul class="nav nav-tabs" id="serving_extensions" role="tablist"> <li class="nav-item "> <a class="nav-link " id="serving_extensions-0-tab" data-toggle="tab" href="#serving_extensions-0" role="tab" aria-controls="serving_extensions-0" aria-selected="true">HPA autoscaling</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_extensions-1-tab" data-toggle="tab" href="#serving_extensions-1" role="tab" aria-controls="serving_extensions-1" aria-selected="true">TLS with cert-manager</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_extensions-2-tab" data-toggle="tab" href="#serving_extensions-2" role="tab" aria-controls="serving_extensions-2" aria-selected="true">TLS via HTTP01</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_extensions-3-tab" data-toggle="tab" href="#serving_extensions-3" role="tab" aria-controls="serving_extensions-3" aria-selected="true">TLS wildcard support</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_extensions-4-tab" data-toggle="tab" href="#serving_extensions-4" role="tab" aria-controls="serving_extensions-4" aria-selected="true">DomainMapping CRD</a> </li> </ul> <div class="tab-content" > <div class="tab-pane fade " id="serving_extensions-0" role="tabpanel" aria-labelledby="serving_extensions-0-tab"> <p>Knative also supports the use of the Kubernetes Horizontal Pod Autoscaler (HPA) for driving autoscaling decisions. The following command will install the components needed to support HPA-class autoscaling:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/serving/releases/download/v0.23.0/serving-hpa.yaml </code></pre></div><!-- TODO(https://github.com/knative/docs/issues/2152): Link to a more in-depth guide on HPA-class autoscaling --> </div> <div class="tab-pane fade " id="serving_extensions-1" role="tabpanel" aria-labelledby="serving_extensions-1-tab"> <p>Knative supports automatically provisioning TLS certificates via <a href="https://cert-manager.io/docs/">cert-manager</a>. The following commands will install the components needed to support the provisioning of TLS certificates via cert-manager.</p> <ol> <li> <p>First, install <a href="../../serving/installing-cert-manager">cert-manager version <code>0.12.0</code> or higher</a></p> </li> <li> <p>Next, install the component that integrates Knative with cert-manager:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/net-certmanager/releases/download/v0.23.0/release.yaml </code></pre></div></li> <li> <p>Now configure Knative to <a href="../../serving/using-auto-tls">automatically configure TLS certificates</a>.</p> </li> </ol> </div> <div class="tab-pane fade " id="serving_extensions-2" role="tabpanel" aria-labelledby="serving_extensions-2-tab"> <p>Knative supports automatically provisioning TLS certificates using Let&rsquo;s Encrypt HTTP01 challenges. The following commands will install the components needed to support that.</p> <ol> <li> <p>First, install the <code>net-http01</code> controller:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/net-http01/releases/download/v0.23.0/release.yaml </code></pre></div></li> <li> <p>Next, configure the <code>certificate.class</code> to use this certificate type.</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl patch configmap/config-network <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --namespace knative-serving <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --type merge <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --patch <span style="color:#4e9a06">&#39;{&#34;data&#34;:{&#34;certificate.class&#34;:&#34;net-http01.certificate.networking.knative.dev&#34;}}&#39;</span> </code></pre></div></li> <li> <p>Lastly, enable auto-TLS.</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl patch configmap/config-network <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --namespace knative-serving <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --type merge <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --patch <span style="color:#4e9a06">&#39;{&#34;data&#34;:{&#34;autoTLS&#34;:&#34;Enabled&#34;}}&#39;</span> </code></pre></div></li> </ol> </div> <div class="tab-pane fade " id="serving_extensions-3" role="tabpanel" aria-labelledby="serving_extensions-3-tab"> <p>If you are using a Certificate implementation that supports provisioning wildcard certificates (e.g. cert-manager with a DNS01 issuer), then the most efficient way to provision certificates is with the namespace wildcard certificate controller. The following command will install the components needed to provision wildcard certificates in each namespace:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/serving/releases/download/v0.23.0/serving-nscert.yaml </code></pre></div><blockquote> <p>Note this will not work with HTTP01 either via cert-manager or the net-http01 options.</p> </blockquote> </div> <div class="tab-pane fade " id="serving_extensions-4" role="tabpanel" aria-labelledby="serving_extensions-4-tab"> <p>The <code>DomainMapping</code> CRD allows a user to map a Domain Name that they own to a specific Knative Service.</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/serving/releases/download/v0.23.0/serving-domainmapping-crds.yaml kubectl <span style="color:#204a87">wait</span> --for<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">condition</span><span style="color:#ce5c00;font-weight:bold">=</span>Established --all crd kubectl apply -f https://github.com/knative/serving/releases/download/v0.23.0/serving-domainmapping.yaml </code></pre></div> </div> </div> <h2 id="install-optional-eventing-extensions">Install optional Eventing extensions</h2> <p>The tabs below expand to show instructions for installing each Eventing extension.</p> <!-- This indentation is important for things to render properly. --> <ul class="nav nav-tabs" id="eventing_extensions" role="tablist"> <li class="nav-item "> <a class="nav-link " id="eventing_extensions-0-tab" data-toggle="tab" href="#eventing_extensions-0" role="tab" aria-controls="eventing_extensions-0" aria-selected="true">Apache Kafka Sink</a> </li> <li class="nav-item "> <a class="nav-link " id="eventing_extensions-1-tab" data-toggle="tab" href="#eventing_extensions-1" role="tab" aria-controls="eventing_extensions-1" aria-selected="true">Sugar Controller</a> </li> <li class="nav-item "> <a class="nav-link " id="eventing_extensions-2-tab" data-toggle="tab" href="#eventing_extensions-2" role="tab" aria-controls="eventing_extensions-2" aria-selected="true">Github Source</a> </li> <li class="nav-item "> <a class="nav-link " id="eventing_extensions-3-tab" data-toggle="tab" href="#eventing_extensions-3" role="tab" aria-controls="eventing_extensions-3" aria-selected="true">Apache Camel-K Source</a> </li> <li class="nav-item "> <a class="nav-link " id="eventing_extensions-4-tab" data-toggle="tab" href="#eventing_extensions-4" role="tab" aria-controls="eventing_extensions-4" aria-selected="true">Apache Kafka Source</a> </li> <li class="nav-item "> <a class="nav-link " id="eventing_extensions-5-tab" data-toggle="tab" href="#eventing_extensions-5" role="tab" aria-controls="eventing_extensions-5" aria-selected="true">GCP Sources</a> </li> <li class="nav-item "> <a class="nav-link " id="eventing_extensions-6-tab" data-toggle="tab" href="#eventing_extensions-6" role="tab" aria-controls="eventing_extensions-6" aria-selected="true">Apache CouchDB Source</a> </li> <li class="nav-item "> <a class="nav-link " id="eventing_extensions-7-tab" data-toggle="tab" href="#eventing_extensions-7" role="tab" aria-controls="eventing_extensions-7" aria-selected="true">VMware Sources and Bindings</a> </li> </ul> <div class="tab-content" > <div class="tab-pane fade " id="eventing_extensions-0" role="tabpanel" aria-labelledby="eventing_extensions-0-tab"> <ol> <li> <p>Install the Kafka controller:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.23.0/eventing-kafka-controller.yaml </code></pre></div></li> <li> <p>Install the Kafka Sink data plane:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.23.0/eventing-kafka-sink.yaml </code></pre></div></li> </ol> <p>For more information, see the <a href="../../eventing/sink/kafka-sink">Kafka Sink</a> documentation.</p> </div> <div class="tab-pane fade " id="eventing_extensions-1" role="tabpanel" aria-labelledby="eventing_extensions-1-tab"> <!-- Unclear when this feature came in --> <p>The following command installs the Eventing Sugar Controller:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative/eventing/releases/download/v0.23.0/eventing-sugar-controller.yaml </code></pre></div><p>The Knative Eventing Sugar Controller will react to special labels and annotations and produce Eventing resources. For example:</p> <ul> <li>When a Namespace is labeled with <code>eventing.knative.dev/injection=enabled</code>, the controller will create a default broker in that namespace.</li> <li>When a Trigger is annotated with <code>eventing.knative.dev/injection=enabled</code>, the controller will create a Broker named by that Trigger in the Trigger&rsquo;s Namespace.</li> </ul> <p>The following command enables the default Broker on a namespace (here <code>default</code>):</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl label namespace default eventing.knative.dev/injection<span style="color:#ce5c00;font-weight:bold">=</span>enabled </code></pre></div> </div> <div class="tab-pane fade " id="eventing_extensions-2" role="tabpanel" aria-labelledby="eventing_extensions-2-tab"> <p>The following command installs the single-tenant Github source:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative-sandbox/eventing-github/releases/download/v0.23.0/github.yaml </code></pre></div><p>The single-tenant GitHub source creates one Knative service per GitHub source.</p> <p>The following command installs the multi-tenant GitHub source:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative-sandbox/eventing-github/releases/download/v0.23.0/mt-github.yaml </code></pre></div><p>The multi-tenant GitHub source creates only one Knative service handling all GitHub sources in the cluster. This source does not support logging or tracing configuration yet.</p> <p>To learn more about the Github source, try <a href="../../eventing/samples/github-source/">our sample</a></p> </div> <div class="tab-pane fade " id="eventing_extensions-3" role="tabpanel" aria-labelledby="eventing_extensions-3-tab"> <p>The following command installs the Apache Camel-K Source:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative-sandbox/eventing-camel/releases/download/v0.23.0/camel.yaml </code></pre></div><p>To learn more about the Apache Camel-K source, try <a href="../../eventing/samples/apache-camel-source/">our sample</a></p> </div> <div class="tab-pane fade " id="eventing_extensions-4" role="tabpanel" aria-labelledby="eventing_extensions-4-tab"> <p>The following command installs the Apache Kafka Source:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative-sandbox/eventing-kafka/releases/download/v0.23.0/source.yaml </code></pre></div><p>To learn more about the Apache Kafka source, try <a href="../../eventing/samples/kafka/source/">our sample</a></p> </div> <div class="tab-pane fade " id="eventing_extensions-5" role="tabpanel" aria-labelledby="eventing_extensions-5-tab"> <p>The following command installs the GCP Sources:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash"><span style="color:#8f5902;font-style:italic"># This installs both the Sources and the Channel.</span> kubectl apply -f https://github.com/google/knative-gcp/releases/download/v0.23.0/cloud-run-events.yaml </code></pre></div><p>To learn more about the Cloud Pub/Sub source, try <a href="../../eventing/samples/cloud-pubsub-source/">our sample</a>.</p> <p>To learn more about the Cloud Storage source, try <a href="../../eventing/samples/cloud-storage-source/">our sample</a>.</p> <p>To learn more about the Cloud Scheduler source, try <a href="../../eventing/samples/cloud-scheduler-source/">our sample</a>.</p> <p>To learn more about the Cloud Audit Logs source, try <a href="../../eventing/samples/cloud-audit-logs-source/">our sample</a>.</p> </div> <div class="tab-pane fade " id="eventing_extensions-6" role="tabpanel" aria-labelledby="eventing_extensions-6-tab"> <p>The following command installs the Apache CouchDB Source:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/knative-sandbox/eventing-couchdb/releases/download/v0.23.0/couchdb.yaml </code></pre></div><p>To learn more about the Apache CouchDB source, read the <a href="https://github.com/knative-sandbox/eventing-couchdb/blob/main/source/">documentation</a>.</p> </div> <div class="tab-pane fade " id="eventing_extensions-7" role="tabpanel" aria-labelledby="eventing_extensions-7-tab"> <p>The following command installs the VMware Sources and Bindings:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f https://github.com/vmware-tanzu/sources-for-knative/releases/download/v0.23.0/release.yaml </code></pre></div><p>To learn more about the VMware sources and bindings, try <a href="https://github.com/vmware-tanzu/sources-for-knative/tree/master/samples/">our samples</a>.</p> </div> </div> <h2 id="next-steps">Next steps</h2> <ul> <li>To easily interact with Knative Services and Eventing components, <a href="../../docs/client/install-kn">install the <code>kn</code> CLI</a></li> </ul> V0.23-Docs: Knative Operator installation https://knative.dev/v0.23-docs/install/knative-with-operators/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/knative-with-operators/ <p>Knative provides a <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/operator/">Kubernetes Operator</a> to install, configure and manage Knative. You can install the Serving component, Eventing component, or both on your cluster.</p> <p><strong>NOTE:</strong> The Knative Operator is still in Alpha phase. It has not been tested in a production environment, and should be used for development or test purposes only.</p> <h2 id="prerequisites">Prerequisites</h2> <ul> <li>You have a cluster that uses Kubernetes v1.18 or newer.</li> <li>You have installed the <code>kubectl</code> CLI.</li> <li>If you have only one node in your cluster, you will need at least 6 CPUs, 6 GB of memory, and 30 GB of disk storage.</li> <li>If you have multiple nodes in your cluster, for each node you will need at least 2 CPUs, 4 GB of memory, and 20 GB of disk storage.</li> <li>Your Kubernetes cluster must have access to the internet, since Kubernetes needs to be able to fetch images, such as <code>gcr.io/knative-releases/knative.dev/operator/cmd/operator:&lt;version&gt;</code>.</li> </ul> <!--TODO: Verify these requirements--> <ul> <li>You have installed <a href="../installing-istio">Istio</a>.</li> </ul> <h2 id="installing-the-latest-release">Installing the latest release</h2> <p>You can find information about the different released versions of the Knative Operator on the <a href="https://github.com/knative/operator/releases">Releases page</a>.</p> <p>Install the latest stable Operator release:</p> <pre><code>kubectl apply -f https://github.com/knative/operator/releases/download/v0.23.0/operator.yaml </code></pre><h2 id="verify-your-installation">Verify your installation</h2> <p>Verify your installation:</p> <pre><code>kubectl get deployment knative-operator </code></pre><p>If the operator is installed correctly, the deployment shows a <code>Ready</code> status:</p> <pre><code>NAME READY UP-TO-DATE AVAILABLE AGE knative-operator 1/1 1 1 19h </code></pre><h2 id="track-the-log">Track the log</h2> <p>Track the log of the operator:</p> <pre><code>kubectl logs -f deploy/knative-operator </code></pre><h2 id="installing-the-knative-serving-component">Installing the Knative Serving component</h2> <ol> <li> <p>Create and apply the Knative Serving CR:</p> <!-- This indentation is important for things to render properly. --> <ul class="nav nav-tabs" id="serving_cr" role="tablist"> <li class="nav-item active"> <a class="nav-link active" id="serving_cr-0-tab" data-toggle="tab" href="#serving_cr-0" role="tab" aria-controls="serving_cr-0" aria-selected="true">Install Current Serving (default)</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_cr-1-tab" data-toggle="tab" href="#serving_cr-1" role="tab" aria-controls="serving_cr-1" aria-selected="true">Install Future Knative Serving</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_cr-2-tab" data-toggle="tab" href="#serving_cr-2" role="tab" aria-controls="serving_cr-2" aria-selected="true">Install Customized Knative Serving</a> </li> </ul> <div class="tab-content" > <div class="tab-pane fade show active" id="serving_cr-0" role="tabpanel" aria-labelledby="serving_cr-0-tab"> <p>You can install the latest available Knative Serving in the operator by applying a YAML file containing the following:</p> <pre><code>apiVersion: v1 kind: Namespace metadata: name: knative-serving --- apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving </code></pre><p>If you do not specify a version by using spec.version, the operator defaults to the latest available version.</p> </div> <div class="tab-pane fade " id="serving_cr-1" role="tabpanel" aria-labelledby="serving_cr-1-tab"> <p>You do not need to upgrade the operator to a newer version to install new releases of Knative Serving. If Knative Serving launches a new version, e.g. <code>{{spec.version}}</code>, you can install it by applying a YAML file containing the following:</p> <pre><code>apiVersion: v1 kind: Namespace metadata: name: knative-serving --- apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: version: {{spec.version}} manifests: - URL: https://github.com/knative/serving/releases/download/v${VERSION}/serving-core.yaml - URL: https://github.com/knative/serving/releases/download/v${VERSION}/serving-hpa.yaml - URL: https://github.com/knative/serving/releases/download/v${VERSION}/serving-post-install-jobs.yaml - URL: https://github.com/knative/net-istio/releases/download/v${VERSION}/net-istio.yaml </code></pre><p>The field <code>spec.version</code> is used to set the version of Knative Serving. Replace <code>{{spec.version}}</code> with the correct version number. The tag <code>${VERSION}</code> is automatically replaced with the version number from <code>spec.version</code> by the operator.</p> <p>The field <code>spec.manifests</code> is used to specify one or multiple URL links of Knative Serving component. Do not forget to add the valid URL of the Knative network ingress plugin. Knative Serving component is still tightly-coupled with a network ingress plugin in the operator. As in the above example, you can use <code>net-istio</code>. The ordering of the URLs is critical. Put the manifest you want to apply first on the top.</p> </div> <div class="tab-pane fade " id="serving_cr-2" role="tabpanel" aria-labelledby="serving_cr-2-tab"> <p>The operator provides you the flexibility to install customized Knative Serving based your own requirements. As long as the manifests of customized Knative Serving are accessible to the operator, they can be installed.</p> <p>There are two modes available for you to install the customized manifests: overwrite mode and append mode. With the overwrite mode, you need to define all the manifests for Knative Serving to install, because the operator will no long install any available default manifests. With the append mode, you only need to define your customized manifests, and the customized manifests are installed, after default manifests are applied.</p> <ol> <li>You can use the overwrite mode to customize all the Knative Serving manifests. For example, the version of the customized Knative Serving is <code>{{spec.version}}</code>, and it is available at <code>https://my-serving/serving.yaml</code>. You choose <code>net-istio</code> as the ingress plugin, which is available at <code>https://my-net-istio/net-istio.yaml</code>. You can create the content of Serving CR as below to install your Knative Serving and the istio ingress:</li> </ol> <pre><code>apiVersion: v1 kind: Namespace metadata: name: knative-serving --- apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: version: {{spec.version}} manifests: - URL: https://my-serving/serving.yaml - URL: https://my-net-istio/net-istio.yaml </code></pre><p>You can make the customized Knative Serving available in one or multiple links, as the <code>spec.manifests</code> supports a list of links. The ordering of the URLs is critical. Put the manifest you want to apply first on the top. We strongly recommend you to specify the version and the valid links to the customized Knative Serving, by leveraging both <code>spec.version</code> and <code>spec.manifests</code>. Do not skip either field.</p> <ol> <li>You can use the append mode to add your customized manifests into the default manifests. For example, you only customize a few resources, and make them available at <code>https://my-serving/serving-custom.yaml</code>. You still need to install the default Knative Serving. In this case, you can create the content of Serving CR as below:</li> </ol> <pre><code>apiVersion: v1 kind: Namespace metadata: name: knative-serving --- apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: version: {{spec.version}} additionalManifests: - URL: https://my-serving/serving-custom.yaml </code></pre><p>Knative operator will install the default manifests of Knative Serving at the version <code>{{spec.version}}</code>, and then install your customized manifests based on them.</p> </div> </div> </li> <li> <p>Verify the Knative Serving deployment:</p> </li> </ol> <pre><code>kubectl get deployment -n knative-serving </code></pre><p>If Knative Serving has been successfully deployed, all deployments of the Knative Serving will show <code>READY</code> status. Here is a sample output:</p> <pre><code>NAME READY UP-TO-DATE AVAILABLE AGE activator 1/1 1 1 18s autoscaler 1/1 1 1 18s autoscaler-hpa 1/1 1 1 14s controller 1/1 1 1 18s istio-webhook 1/1 1 1 12s networking-istio 1/1 1 1 12s webhook 1/1 1 1 17s </code></pre><ol start="3"> <li>Check the status of Knative Serving Custom Resource:</li> </ol> <pre><code>kubectl get KnativeServing knative-serving -n knative-serving </code></pre><p>If Knative Serving is successfully installed, you should see:</p> <pre><code>NAME VERSION READY REASON knative-serving &lt;version number&gt; True </code></pre><h3 id="installing-the-knative-serving-component-with-different-network-layers">Installing the Knative Serving component with different network layers</h3> <p>Knative Operator can configure Knative Serving component with different network layer options. Istio is the default network layer, if the ingress is not specified in the Knative Serving CR. Click on each tab below to see how you can configure Knative Serving with different ingresses:</p> <ul class="nav nav-tabs" id="serving_networking" role="tablist"> <li class="nav-item active"> <a class="nav-link active" id="serving_networking-0-tab" data-toggle="tab" href="#serving_networking-0" role="tab" aria-controls="serving_networking-0" aria-selected="true">Ambassador</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_networking-1-tab" data-toggle="tab" href="#serving_networking-1" role="tab" aria-controls="serving_networking-1" aria-selected="true">Contour</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_networking-2-tab" data-toggle="tab" href="#serving_networking-2" role="tab" aria-controls="serving_networking-2" aria-selected="true">Gloo</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_networking-3-tab" data-toggle="tab" href="#serving_networking-3" role="tab" aria-controls="serving_networking-3" aria-selected="true">Kong</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_networking-4-tab" data-toggle="tab" href="#serving_networking-4" role="tab" aria-controls="serving_networking-4" aria-selected="true">Kourier</a> </li> </ul> <div class="tab-content" > <div class="tab-pane fade show active" id="serving_networking-0" role="tabpanel" aria-labelledby="serving_networking-0-tab"> <p>The following commands install Ambassador and enable its Knative integration.</p> <ol> <li> <p>Create a namespace to install Ambassador in:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl create namespace ambassador </code></pre></div></li> <li> <p>Install Ambassador:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --namespace ambassador <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --filename https://getambassador.io/yaml/ambassador/ambassador-crds.yaml <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --filename https://getambassador.io/yaml/ambassador/ambassador-rbac.yaml <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --filename https://getambassador.io/yaml/ambassador/ambassador-service.yaml </code></pre></div></li> <li> <p>Give Ambassador the required permissions:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl patch clusterrolebinding ambassador -p <span style="color:#4e9a06">&#39;{&#34;subjects&#34;:[{&#34;kind&#34;: &#34;ServiceAccount&#34;, &#34;name&#34;: &#34;ambassador&#34;, &#34;namespace&#34;: &#34;ambassador&#34;}]}&#39;</span> </code></pre></div></li> <li> <p>Enable Knative support in Ambassador:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl <span style="color:#204a87">set</span> env --namespace ambassador deployments/ambassador <span style="color:#000">AMBASSADOR_KNATIVE_SUPPORT</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87">true</span> </code></pre></div></li> <li> <p>To configure Knative Serving to use Ambassador, apply the content of the Serving CR as below:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">cat <span style="color:#4e9a06">&lt;&lt;-EOF | kubectl apply -f - </span><span style="color:#4e9a06">apiVersion: operator.knative.dev/v1alpha1 </span><span style="color:#4e9a06">kind: KnativeServing </span><span style="color:#4e9a06">metadata: </span><span style="color:#4e9a06"> name: knative-serving </span><span style="color:#4e9a06"> namespace: knative-serving </span><span style="color:#4e9a06">spec: </span><span style="color:#4e9a06"> config: </span><span style="color:#4e9a06"> network: </span><span style="color:#4e9a06"> ingress.class: &#34;ambassador.ingress.networking.knative.dev&#34; </span><span style="color:#4e9a06">EOF</span> </code></pre></div></li> <li> <p>Fetch the External IP or CNAME:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl --namespace ambassador get service ambassador </code></pre></div><p>Save this for configuring DNS below.</p> </li> </ol> </div> <div class="tab-pane fade " id="serving_networking-1" role="tabpanel" aria-labelledby="serving_networking-1-tab"> <p>The following commands install Contour and enable its Knative integration.</p> <ol> <li> <p>Install a properly configured Contour:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename https://github.com/knative/net-contour/releases/download/v0.23.0/contour.yaml </code></pre></div></li> <li> <p>To configure Knative Serving to use Contour, apply the content of the Serving CR as below:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">cat <span style="color:#4e9a06">&lt;&lt;-EOF | kubectl apply -f - </span><span style="color:#4e9a06">apiVersion: operator.knative.dev/v1alpha1 </span><span style="color:#4e9a06">kind: KnativeServing </span><span style="color:#4e9a06">metadata: </span><span style="color:#4e9a06"> name: knative-serving </span><span style="color:#4e9a06"> namespace: knative-serving </span><span style="color:#4e9a06">spec: </span><span style="color:#4e9a06"> ingress: </span><span style="color:#4e9a06"> contour: </span><span style="color:#4e9a06"> enabled: true </span><span style="color:#4e9a06"> config: </span><span style="color:#4e9a06"> network: </span><span style="color:#4e9a06"> ingress.class: &#34;contour.ingress.networking.knative.dev&#34; </span><span style="color:#4e9a06">EOF</span> </code></pre></div></li> <li> <p>Fetch the External IP or CNAME:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl --namespace contour-external get service envoy </code></pre></div><p>Save this for configuring DNS below.</p> </li> </ol> </div> <div class="tab-pane fade " id="serving_networking-2" role="tabpanel" aria-labelledby="serving_networking-2-tab"> <p><em>For a detailed guide on Gloo integration, see <a href="https://docs.solo.io/gloo/latest/installation/knative/">Installing Gloo for Knative</a> in the Gloo documentation.</em></p> <p>The following commands install Gloo and enable its Knative integration.</p> <ol> <li> <p>Make sure <code>glooctl</code> is installed (version 1.3.x and higher recommended):</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">glooctl version </code></pre></div><p>If it is not installed, you can install the latest version using:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">curl -sL https://run.solo.io/gloo/install <span style="color:#000;font-weight:bold">|</span> sh <span style="color:#204a87">export</span> <span style="color:#000">PATH</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$HOME</span>/.gloo/bin:<span style="color:#000">$PATH</span> </code></pre></div><p>Or following the <a href="https://docs.solo.io/gloo/latest/installation/knative/#install-command-line-tool-cli">Gloo CLI install instructions</a>.</p> </li> <li> <p>Install Gloo and the Knative integration:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">glooctl install knative --install-knative<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87">false</span> </code></pre></div></li> <li> <p>To configure Knative Serving to use Gloo, apply the content of the Serving CR as below:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">cat <span style="color:#4e9a06">&lt;&lt;-EOF | kubectl apply -f - </span><span style="color:#4e9a06">apiVersion: operator.knative.dev/v1alpha1 </span><span style="color:#4e9a06">kind: KnativeServing </span><span style="color:#4e9a06">metadata: </span><span style="color:#4e9a06"> name: knative-serving </span><span style="color:#4e9a06"> namespace: knative-serving </span><span style="color:#4e9a06">EOF</span> </code></pre></div><p>There is no need to configure the ingress class to use the gloo.</p> </li> <li> <p>Fetch the External IP or CNAME:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">glooctl proxy url --name knative-external-proxy </code></pre></div><p>Save this for configuring DNS below.</p> </li> </ol> </div> <div class="tab-pane fade " id="serving_networking-3" role="tabpanel" aria-labelledby="serving_networking-3-tab"> <p>The following commands install Kong and enable its Knative integration.</p> <ol> <li> <p>Install Kong Ingress Controller:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename https://raw.githubusercontent.com/Kong/kubernetes-ingress-controller/0.9.x/deploy/single/all-in-one-dbless.yaml </code></pre></div></li> <li> <p>To configure Knative Serving to use Kong, apply the content of the Serving CR as below:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">cat <span style="color:#4e9a06">&lt;&lt;-EOF | kubectl apply -f - </span><span style="color:#4e9a06">apiVersion: operator.knative.dev/v1alpha1 </span><span style="color:#4e9a06">kind: KnativeServing </span><span style="color:#4e9a06">metadata: </span><span style="color:#4e9a06"> name: knative-serving </span><span style="color:#4e9a06"> namespace: knative-serving </span><span style="color:#4e9a06">spec: </span><span style="color:#4e9a06"> config: </span><span style="color:#4e9a06"> network: </span><span style="color:#4e9a06"> ingress.class: &#34;kong&#34; </span><span style="color:#4e9a06">EOF</span> </code></pre></div></li> <li> <p>Fetch the External IP or CNAME:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl --namespace kong get service kong-proxy </code></pre></div><p>Save this for configuring DNS below.</p> </li> </ol> </div> <div class="tab-pane fade " id="serving_networking-4" role="tabpanel" aria-labelledby="serving_networking-4-tab"> <p>The following commands install Kourier and enable its Knative integration.</p> <ol> <li> <p>To configure Knative Serving to use Kourier, apply the content of the Serving CR as below:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">cat <span style="color:#4e9a06">&lt;&lt;-EOF | kubectl apply -f - </span><span style="color:#4e9a06">apiVersion: operator.knative.dev/v1alpha1 </span><span style="color:#4e9a06">kind: KnativeServing </span><span style="color:#4e9a06">metadata: </span><span style="color:#4e9a06"> name: knative-serving </span><span style="color:#4e9a06"> namespace: knative-serving </span><span style="color:#4e9a06">spec: </span><span style="color:#4e9a06"> ingress: </span><span style="color:#4e9a06"> kourier: </span><span style="color:#4e9a06"> enabled: true </span><span style="color:#4e9a06"> config: </span><span style="color:#4e9a06"> network: </span><span style="color:#4e9a06"> ingress.class: &#34;kourier.ingress.networking.knative.dev&#34; </span><span style="color:#4e9a06">EOF</span> </code></pre></div></li> <li> <p>Fetch the External IP or CNAME:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl --namespace knative-serving get service kourier </code></pre></div><p>Save this for configuring DNS below.</p> </li> </ol> </div> </div> <ol> <li> <p>Configure DNS</p> <!-- This indentation is important for things to render properly. --> <ul class="nav nav-tabs" id="serving_dns" role="tablist"> <li class="nav-item "> <a class="nav-link " id="serving_dns-0-tab" data-toggle="tab" href="#serving_dns-0" role="tab" aria-controls="serving_dns-0" aria-selected="true">Magic DNS (sslip.io)</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_dns-1-tab" data-toggle="tab" href="#serving_dns-1" role="tab" aria-controls="serving_dns-1" aria-selected="true">Real DNS</a> </li> <li class="nav-item "> <a class="nav-link " id="serving_dns-2-tab" data-toggle="tab" href="#serving_dns-2" role="tab" aria-controls="serving_dns-2" aria-selected="true">Temporary DNS</a> </li> </ul> <div class="tab-content" > <div class="tab-pane fade " id="serving_dns-0" role="tabpanel" aria-labelledby="serving_dns-0-tab"> <p>We ship a simple Kubernetes Job called &ldquo;default domain&rdquo; that will (see caveats) configure Knative Serving to use <a href="http://sslip.io">sslip.io</a> as the default DNS suffix.</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename https://github.com/knative/serving/releases/download/v0.23.0/serving-default-domain.yaml </code></pre></div><p><strong>Caveat</strong>: This will only work if the cluster LoadBalancer service exposes an IPv4 address or hostname, so it will not work with IPv6 clusters or local setups like Minikube. For these, see &ldquo;Real DNS&rdquo; or &ldquo;Temporary DNS&rdquo;.</p> </div> <div class="tab-pane fade " id="serving_dns-1" role="tabpanel" aria-labelledby="serving_dns-1-tab"> <p>To configure DNS for Knative, take the External IP or CNAME from setting up networking, and configure it with your DNS provider as follows:</p> <ul> <li> <p>If the networking layer produced an External IP address, then configure a wildcard <code>A</code> record for the domain:</p> <pre><code># Here knative.example.com is the domain suffix for your cluster *.knative.example.com == A 35.233.41.212 </code></pre></li> <li> <p>If the networking layer produced a CNAME, then configure a CNAME record for the domain:</p> <pre><code># Here knative.example.com is the domain suffix for your cluster *.knative.example.com == CNAME a317a278525d111e89f272a164fd35fb-1510370581.eu-central-1.elb.amazonaws.com </code></pre></li> </ul> <p>Once your DNS provider has been configured, add the following section into your existing Serving CR, and apply it:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash"><span style="color:#8f5902;font-style:italic"># Replace knative.example.com with your domain suffix</span> apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: config: domain: <span style="color:#4e9a06">&#34;knative.example.com&#34;</span>: <span style="color:#4e9a06">&#34;&#34;</span> ... </code></pre></div> </div> <div class="tab-pane fade " id="serving_dns-2" role="tabpanel" aria-labelledby="serving_dns-2-tab"> <p>If you are using <code>curl</code> to access the sample applications, or your own Knative app, and are unable to use the &ldquo;Magic DNS (sslip.io)&rdquo; or &ldquo;Real DNS&rdquo; methods, there is a temporary approach. This is useful for those who wish to evaluate Knative without altering their DNS configuration, as per the &ldquo;Real DNS&rdquo; method, or cannot use the &ldquo;Magic DNS&rdquo; method due to using, for example, minikube locally or IPv6 clusters.</p> <p>To access your application using <code>curl</code> using this method:</p> <ol> <li> <p>After starting your application, get the URL of your application:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl get ksvc </code></pre></div><p>The output should be similar to:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">NAME URL LATESTCREATED LATESTREADY READY REASON helloworld-go http://helloworld-go.default.example.com helloworld-go-vqjlf helloworld-go-vqjlf True </code></pre></div></li> <li> <p>Instruct <code>curl</code> to connect to the External IP or CNAME defined by the networking layer in section 3 above, and use the <code>-H &quot;Host:&quot;</code> command-line option to specify the Knative application&rsquo;s host name. For example, if the networking layer defines your External IP and port to be <code>http://192.168.39.228:32198</code> and you wish to access the above <code>helloworld-go</code> application, use:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">curl -H <span style="color:#4e9a06">&#34;Host: helloworld-go.default.example.com&#34;</span> http://192.168.39.228:32198 </code></pre></div><p>In the case of the provided <code>helloworld-go</code> sample application, using the default configuration, the output should be:</p> <pre><code>Hello Go Sample v1! </code></pre></li> </ol> <p>Refer to the &ldquo;Real DNS&rdquo; method for a permanent solution.</p> </div> </div> </li> <li> <p>Monitor the Knative components until all of the components show a <code>STATUS</code> of <code>Running</code> or <code>Completed</code>:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl get pods --namespace knative-serving </code></pre></div></li> </ol> <h2 id="installing-the-knative-eventing-component">Installing the Knative Eventing component</h2> <ol> <li> <p>Create and apply the Knative Eventing CR:</p> <!-- This indentation is important for things to render properly. --> <ul class="nav nav-tabs" id="eventing_cr" role="tablist"> <li class="nav-item active"> <a class="nav-link active" id="eventing_cr-0-tab" data-toggle="tab" href="#eventing_cr-0" role="tab" aria-controls="eventing_cr-0" aria-selected="true">Install Current Eventing (default)</a> </li> <li class="nav-item "> <a class="nav-link " id="eventing_cr-1-tab" data-toggle="tab" href="#eventing_cr-1" role="tab" aria-controls="eventing_cr-1" aria-selected="true">Install Future Knative Eventing</a> </li> <li class="nav-item "> <a class="nav-link " id="eventing_cr-2-tab" data-toggle="tab" href="#eventing_cr-2" role="tab" aria-controls="eventing_cr-2" aria-selected="true">Install Customized Knative Eventing</a> </li> </ul> <div class="tab-content" > <div class="tab-pane fade show active" id="eventing_cr-0" role="tabpanel" aria-labelledby="eventing_cr-0-tab"> <p>You can install the latest available Knative Eventing in the operator by applying a YAML file containing the following:</p> <pre><code>apiVersion: v1 kind: Namespace metadata: name: knative-eventing --- apiVersion: operator.knative.dev/v1alpha1 kind: KnativeEventing metadata: name: knative-eventing namespace: knative-eventing </code></pre><p>If you do not specify a version by using spec.version, the operator defaults to the latest available version.</p> </div> <div class="tab-pane fade " id="eventing_cr-1" role="tabpanel" aria-labelledby="eventing_cr-1-tab"> <p>You do not need to upgrade the operator to a newer version to install new releases of Knative Eventing. If Knative Eventing launches a new version, e.g. <code>{{spec.version}}</code>, you can install it by applying a YAML file containing the following:</p> <pre><code>apiVersion: v1 kind: Namespace metadata: name: knative-eventing --- apiVersion: operator.knative.dev/v1alpha1 kind: KnativeEventing metadata: name: knative-eventing namespace: knative-eventing spec: version: {{spec.version}} manifests: - URL: https://github.com/knative/eventing/releases/download/v${VERSION}/eventing.yaml - URL: https://github.com/knative/eventing/releases/download/v${VERSION}/eventing-post-install-jobs.yaml </code></pre><p>The field <code>spec.version</code> is used to set the version of Knative Eventing. Replace <code>{{spec.version}}</code> with the correct version number. The tag <code>${VERSION}</code> is automatically replaced with the version number from <code>spec.version</code> by the operator.</p> <p>The field <code>spec.manifests</code> is used to specify one or multiple URL links of Knative Eventing component. Do not forget to add the valid URL of the Knative network ingress plugin. The ordering of the URLs is critical. Put the manifest you want to apply first on the top.</p> </div> <div class="tab-pane fade " id="eventing_cr-2" role="tabpanel" aria-labelledby="eventing_cr-2-tab"> <p>The operator provides you the flexibility to install customized Knative Eventing based your own requirements. As long as the manifests of customized Knative Eventing are accessible to the operator, they can be installed.</p> <p>There are two modes available for you to install the customized manifests: overwrite mode and append mode. With the overwrite mode, you need to define all the manifests for Knative Eventing to install, because the operator will no long install any available default manifests. With the append mode, you only need to define your customized manifests, and the customized manifests are installed, after default manifests are applied.</p> <ol> <li>You can use the overwrite mode to customize all the Knative Eventing manifests. For example, the version of the customized Knative Eventing is <code>{{spec.version}}</code>, and it is available at <code>https://my-eventing/eventing.yaml</code>. You can create the content of Eventing CR as below to install your Knative Eventing:</li> </ol> <pre><code>apiVersion: v1 kind: Namespace metadata: name: knative-eventing --- apiVersion: operator.knative.dev/v1alpha1 kind: KnativeEventing metadata: name: knative-eventing namespace: knative-eventing spec: version: {{spec.version}} manifests: - URL: https://my-eventing/eventing.yaml </code></pre><p>You can make the customized Knative Eventing available in one or multiple links, as the <code>spec.manifests</code> supports a list of links. The ordering of the URLs is critical. Put the manifest you want to apply first on the top. We strongly recommend you to specify the version and the valid links to the customized Knative Eventing, by leveraging both <code>spec.version</code> and <code>spec.manifests</code>. Do not skip either field.</p> <ol> <li>You can use the append mode to add your customized manifests into the default manifests. For example, you only customize a few resources, and make them available at <code>https://my-eventing/eventing-custom.yaml</code>. You still need to install the default Knative eventing. In this case, you can create the content of Eventing CR as below:</li> </ol> <pre><code>apiVersion: v1 kind: Namespace metadata: name: knative-eventing --- apiVersion: operator.knative.dev/v1alpha1 kind: KnativeEventing metadata: name: knative-eventing namespace: knative-eventing spec: version: {{spec.version}} additionalManifests: - URL: https://my-eventing/eventing-custom.yaml </code></pre><p>Knative operator will install the default manifests of Knative Eventing at the version <code>{{spec.version}}</code>, and then install your customized manifests based on them.</p> </div> </div> </li> <li> <p>Verify the Knative Eventing deployment:</p> </li> </ol> <pre><code>kubectl get deployment -n knative-eventing </code></pre><p>If Knative Eventing has been successfully deployed, all deployments of the Knative Eventing will show <code>READY</code> status. Here is a sample output:</p> <pre><code>NAME READY UP-TO-DATE AVAILABLE AGE broker-controller 1/1 1 1 63s broker-filter 1/1 1 1 62s broker-ingress 1/1 1 1 62s eventing-controller 1/1 1 1 67s eventing-webhook 1/1 1 1 67s imc-controller 1/1 1 1 59s imc-dispatcher 1/1 1 1 59s mt-broker-controller 1/1 1 1 62s </code></pre><ol start="3"> <li>Check the status of Knative Eventing Custom Resource:</li> </ol> <pre><code>kubectl get KnativeEventing knative-eventing -n knative-eventing </code></pre><p>If Knative Eventing is successfully installed, you should see:</p> <pre><code>NAME VERSION READY REASON knative-eventing &lt;version number&gt; True </code></pre><h2 id="whats-next">What&rsquo;s next</h2> <ul> <li><a href="../operator/configuring-serving-cr">Configure Knative Serving using Operator</a></li> <li><a href="../operator/configuring-eventing-cr">Configure Knative Eventing using Operator</a></li> </ul> V0.23-Docs: Installing Istio for Knative https://knative.dev/v0.23-docs/install/installing-istio/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/installing-istio/ <p>This guide walks you through manually installing and customizing Istio for use with Knative.</p> <p>If your cloud platform offers a managed Istio installation, we recommend installing Istio that way, unless you need to customize your installation.</p> <h2 id="before-you-begin">Before you begin</h2> <p>You need:</p> <ul> <li>A Kubernetes cluster created.</li> <li><a href="https://istio.io/docs/setup/install/istioctl/"><code>istioctl</code></a> (v1.7 or later) installed.</li> </ul> <h2 id="supported-istio-versions">Supported Istio versions</h2> <p>The current known-to-be-stable version of Istio tested in conjunction with Knative is <strong>v1.8.2</strong>. Versions in the 1.7 line are generally fine too. 1.8.0 and 1.8.1 have bugs that don&rsquo;t work with Knative.</p> <h2 id="installing-istio">Installing Istio</h2> <p>When you install Istio, there are a few options depending on your goals. For a basic Istio installation suitable for most Knative use cases, follow the <a href="#installing-istio-without-sidecar-injection">Installing Istio without sidecar injection</a> instructions. If you&rsquo;re familiar with Istio and know what kind of installation you want, read through the options and choose the installation that suits your needs.</p> <p>You can easily customize your Istio installation with <code>istioctl</code>. The below sections cover a few useful Istio configurations and their benefits.</p> <h3 id="choosing-an-istio-installation">Choosing an Istio installation</h3> <p>You can install Istio with or without a service mesh:</p> <ul> <li> <p><a href="#installing-istio-without-sidecar-injection">Installing Istio without sidecar injection</a>(Recommended default installation)</p> </li> <li> <p><a href="#installing-istio-with-sidecar-injection">Installing Istio with sidecar injection</a></p> </li> </ul> <p>If you want to get up and running with Knative quickly, we recommend installing Istio without automatic sidecar injection. This install is also recommended for users who don&rsquo;t need the Istio service mesh, or who want to enable the service mesh by <a href="https://istio.io/docs/setup/kubernetes/additional-setup/sidecar-injection/#manual-sidecar-injection">manually injecting the Istio sidecars</a>.</p> <h4 id="installing-istio-without-sidecar-injection">Installing Istio without sidecar injection</h4> <p>Run the following comand to install Istio.</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">istioctl install -y </code></pre></div><h4 id="installing-istio-with-sidecar-injection">Installing Istio with sidecar injection</h4> <p>If you want to enable the Istio service mesh, you must enable <a href="https://istio.io/docs/setup/kubernetes/additional-setup/sidecar-injection/#automatic-sidecar-injection">automatic sidecar injection</a>. The Istio service mesh provides a few benefits:</p> <ul> <li> <p>Allows you to turn on <a href="https://istio.io/docs/concepts/security/#mutual-tls-authentication">mutual TLS</a>, which secures service-to-service traffic within the cluster.</p> </li> <li> <p>Allows you to use the <a href="https://istio.io/docs/tasks/security/authz-http/">Istio authorization policy</a>, controlling the access to each Knative service based on Istio service roles.</p> </li> </ul> <p>To automatic sidecar injection, set <code>autoInject: enabled</code> in addition to above operator configuration.</p> <pre><code> global: proxy: autoInject: enabled </code></pre><h4 id="using-istio-mtls-feature">Using Istio mTLS feature</h4> <p>Since there are some networking communications between knative-serving namespace and the namespace where your services running on, you need additional preparations for mTLS enabled environment.</p> <ul> <li>Enable sidecar container on <code>knative-serving</code> system namespace.</li> </ul> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl label namespace knative-serving istio-injection<span style="color:#ce5c00;font-weight:bold">=</span>enabled </code></pre></div><ul> <li>Set <code>PeerAuthentication</code> to <code>PERMISSIVE</code> on knative-serving system namespace.</li> </ul> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">cat <span style="color:#4e9a06">&lt;&lt;EOF | kubectl apply -f - </span><span style="color:#4e9a06">apiVersion: &#34;security.istio.io/v1beta1&#34; </span><span style="color:#4e9a06">kind: &#34;PeerAuthentication&#34; </span><span style="color:#4e9a06">metadata: </span><span style="color:#4e9a06"> name: &#34;default&#34; </span><span style="color:#4e9a06"> namespace: &#34;knative-serving&#34; </span><span style="color:#4e9a06">spec: </span><span style="color:#4e9a06"> mtls: </span><span style="color:#4e9a06"> mode: PERMISSIVE </span><span style="color:#4e9a06">EOF</span> </code></pre></div><p>After you install the cluster local gateway, your service and deployment for the local gateway is named <code>knative-local-gateway</code>.</p> <h3 id="updating-the-config-istio-configmap-to-use-a-non-default-local-gateway">Updating the <code>config-istio</code> configmap to use a non-default local gateway</h3> <p>If you create a custom service and deployment for local gateway with a name other than <code>knative-local-gateway</code>, you need to update gateway configmap <code>config-istio</code> under the <code>knative-serving</code> namespace.</p> <ol> <li>Edit the <code>config-istio</code> configmap:</li> </ol> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl edit configmap config-istio -n knative-serving </code></pre></div><ol start="2"> <li>Replace the <code>local-gateway.knative-serving.knative-local-gateway</code> field with the custom service. As an example, if you name both the service and deployment <code>custom-local-gateway</code> under the namespace <code>istio-system</code>, it should be updated to:</li> </ol> <pre><code>custom-local-gateway.istio-system.svc.cluster.local </code></pre><p>As an example, if both the custom service and deployment are labeled with <code>custom: custom-local-gateway</code>, not the default <code>istio: knative-local-gateway</code>, you must update gateway instance <code>knative-local-gateway</code> in the <code>knative-serving</code> namespace:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl edit gateway knative-local-gateway -n knative-serving </code></pre></div><p>Replace the label selector with the label of your service:</p> <pre><code>istio: knative-local-gateway </code></pre><p>For the service above, it should be updated to:</p> <pre><code>custom: custom-local-gateway </code></pre><p>If there is a change in service ports (compared to that of <code>knative-local-gateway</code>), update the port info in the gateway accordingly.</p> <h3 id="verifying-your-istio-install">Verifying your Istio install</h3> <p>View the status of your Istio installation to make sure the install was successful. It might take a few seconds, so rerun the following command until all of the pods show a <code>STATUS</code> of <code>Running</code> or <code>Completed</code>:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl get pods --namespace istio-system </code></pre></div><blockquote> <p>Tip: You can append the <code>--watch</code> flag to the <code>kubectl get</code> commands to view the pod status in realtime. You use <code>CTRL + C</code> to exit watch mode.</p> </blockquote> <h3 id="configuring-dns">Configuring DNS</h3> <p>Knative dispatches to different services based on their hostname, so it is recommended to have DNS properly configured.</p> <p>To do this, begin by looking up the external IP address that Istio received:</p> <pre><code>$ kubectl get svc -nistio-system NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE istio-ingressgateway LoadBalancer 10.0.2.24 34.83.80.117 15020:32206/TCP,80:30742/TCP,443:30996/TCP 2m14s istio-pilot ClusterIP 10.0.3.27 &lt;none&gt; 15010/TCP,15011/TCP,8080/TCP,15014/TCP 2m14s </code></pre><p>This external IP can be used with your DNS provider with a wildcard <code>A</code> record. However, for a basic non-production set up, this external IP address can be used with <code>sslip.io</code> in the <code>config-domain</code> ConfigMap in <code>knative-serving</code>.</p> <p>You can edit this by using the following command:</p> <pre><code>kubectl edit cm config-domain --namespace knative-serving </code></pre><p>Given the external IP above, change the content to:</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: config-domain namespace: knative-serving data: # sslip.io is a &quot;magic&quot; DNS provider, which resolves all DNS lookups for: # *.{ip}.sslip.io to {ip}. 34.83.80.117.sslip.io: &quot;&quot; </code></pre><h2 id="istio-resources">Istio resources</h2> <ul> <li> <p>For the official Istio installation guide, see the <a href="https://istio.io/docs/setup/kubernetes/">Istio Kubernetes Getting Started Guide</a>.</p> </li> <li> <p>For the full list of available configs when installing Istio with <code>istioctl</code>, see the <a href="https://istio.io/docs/setup/install/istioctl/">Istio Installation Options reference</a>.</p> </li> </ul> <h2 id="clean-up-istio">Clean up Istio</h2> <p>See the <a href="https://istio.io/docs/setup/install/istioctl/#uninstall-istio">Uninstall Istio</a>.</p> <h2 id="whats-next">What&rsquo;s next</h2> <ul> <li>Try the <a href="../../serving/getting-started-knative-app">Getting Started with App Deployment guide</a> for Knative serving.</li> </ul> V0.23-Docs: Checking the version of your Knative components https://knative.dev/v0.23-docs/install/check-install-version/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/check-install-version/ <p>To obtain the version of the Knative component that you have running on your cluster, you query for the <code>[component].knative.dev/release</code> label with the following commands:</p> <ul> <li> <p>Knative Serving</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl get namespace knative-serving -o <span style="color:#4e9a06">&#39;go-template={{index .metadata.labels &#34;serving.knative.dev/release&#34;}}&#39;</span> </code></pre></div></li> <li> <p>Knative Eventing</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl get namespace knative-eventing -o <span style="color:#4e9a06">&#39;go-template={{index .metadata.labels &#34;eventing.knative.dev/release&#34;}}&#39;</span> </code></pre></div></li> </ul> V0.23-Docs: Configuring the Serving Operator Custom Resource https://knative.dev/v0.23-docs/install/operator/configuring-serving-cr/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/operator/configuring-serving-cr/ <p>The Knative Serving operator can be configured with these options:</p> <ul> <li><a href="#version-configuration">Version Configuration</a></li> <li><a href="#serving-configuration-by-configmap">Serving Configuration by ConfigMap</a></li> <li><a href="#private-repository-and-private-secrets">Private repository and private secret</a></li> <li><a href="#ssl-certificate-for-controller">SSL certificate for controller</a></li> <li><a href="#configuration-of-knative-ingress-gateway">Knative ingress gateway</a></li> <li><a href="#configuration-of-cluster-local-gateway">Cluster local gateway</a></li> <li><a href="#high-availability">High availability</a></li> <li><a href="#system-resource-settings">System Resource Settings</a></li> <li><a href="#override-system-deployments">Override system deployments</a></li> </ul> <h2 id="version-configuration">Version Configuration</h2> <p>Cluster administrators can install a specific version of Knative Serving by using the <code>spec.version</code> field. For example, if you want to install Knative Serving 0.16.0, you can apply the following <code>KnativeServing</code> custom resource:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: version: 0.16.0 </code></pre><p>If <code>spec.version</code> is not specified, the Knative Operator will install the latest available version of Knative Serving. If users specify an invalid or unavailable version, the Knative Operator will do nothing. The Knative Operator always includes the latest 3 minor release versions. For example, if the current version of the Knative Operator is 0.16.x, the earliest version of Knative Serving available through the Operator is 0.14.0.</p> <p>If Knative Serving is already managed by the Operator, updating the <code>spec.version</code> field in the <code>KnativeServing</code> resource enables upgrading or downgrading the Knative Serving version, without needing to change the Operator.</p> <p>Note that the Knative Operator only permits upgrades or downgrades by one minor release version at a time. For example, if the current Knative Serving deployment is version 0.14.x, you must upgrade to 0.15.x before upgrading to 0.16.x.</p> <h2 id="serving-configuration-by-configmap">Serving Configuration by ConfigMap</h2> <p>The Operator manages the Knative Serving installation. It overwrites any updates to ConfigMaps which are used to configure Knative Serving. The KnativeServing custom resource (CR) allows you to set values for these ConfigMaps by using the Operator. Knative Serving has multiple ConfigMaps that are named with the prefix <code>config-</code>. The <code>spec.config</code> in the KnativeServing CR has one <code>&lt;name&gt;</code> entry for each ConfigMap, named <code>config-&lt;name&gt;</code>, with a value which will be used for the ConfigMap <code>data</code>.</p> <p>In the <a href="../../../serving/using-a-custom-domain">setup a custom domain example</a>, you can see the content of the ConfigMap <code>config-domain</code> is:</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: config-domain namespace: knative-serving data: example.org: | selector: app: prod example.com: &quot;&quot; </code></pre><p>Using the operator, specify the ConfigMap <code>config-domain</code> using the operator CR:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: config: domain: example.org: | selector: app: prod example.com: &quot;&quot; </code></pre><p>You can apply values to multiple ConfigMaps. This example sets <code>stable-window</code> to 60s in <code>config-autoscaler</code> as well as specifying <code>config-domain</code>:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: config: domain: example.org: | selector: app: prod example.com: &quot;&quot; autoscaler: stable-window: &quot;60s&quot; </code></pre><p>All the ConfigMaps are created in the same namespace as the operator CR. You can use the operator CR as the unique entry point to edit all of them.</p> <h2 id="private-repository-and-private-secrets">Private repository and private secrets</h2> <p>You can use the <code>spec.registry</code> section of the operator CR to change the image references to point to a private registry or <a href="https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod">specify imagePullSecrets</a>:</p> <ul> <li> <p><code>default</code>: this field defines a image reference template for all Knative images. The format is <code>example-registry.io/custom/path/${NAME}:{CUSTOM-TAG}</code>. If you use the same tag for all your images, the only difference is the image name. <code>${NAME}</code> is a pre-defined variable in the operator corresponding to the container name. If you name the images in your private repo to align with the container names ( <code>activator</code>, <code>autoscaler</code>, <code>controller</code>, <code>webhook</code>, <code>autoscaler-hpa</code>, <code>networking-istio</code>, and <code>queue-proxy</code>), the <code>default</code> argument should be sufficient.</p> </li> <li> <p><code>override</code>: a map from container name to the full registry location. This section is only needed when the registry images do not match the common naming format. For containers whose name matches a key, the value is used in preference to the image name calculated by <code>default</code>. If a container&rsquo;s name does not match a key in <code>override</code>, the template in <code>default</code> is used.</p> </li> <li> <p><code>imagePullSecrets</code>: a list of Secret names used when pulling Knative container images. The Secrets must be created in the same namespace as the Knative Serving Deployments. See <a href="../../../serving/deploying/private-registry">deploying images from a private container registry</a> for configuration details.</p> </li> </ul> <h3 id="download-images-in-a-predefined-format-without-secrets">Download images in a predefined format without secrets:</h3> <p>This example shows how you can define custom image links that can be defined in the CR using the simplified format <code>docker.io/knative-images/${NAME}:{CUSTOM-TAG}</code>.</p> <p>In the example below:</p> <ul> <li>the custom tag <code>v0.13.0</code> is used for all images</li> <li>all image links are accessible without using secrets</li> <li>images are pushed as <code>docker.io/knative-images/${NAME}:{CUSTOM-TAG}</code></li> </ul> <p>First, you need to make sure your images pushed to the following image tags:</p> <table> <thead> <tr> <th>Container</th> <th>Docker Image</th> </tr> </thead> <tbody> <tr> <td><code>activator</code></td> <td><code>docker.io/knative-images/activator:v0.13.0</code></td> </tr> <tr> <td><code>autoscaler</code></td> <td><code>docker.io/knative-images/autoscaler:v0.13.0</code></td> </tr> <tr> <td><code>controller</code></td> <td><code>docker.io/knative-images/controller:v0.13.0</code></td> </tr> <tr> <td><code>webhook</code></td> <td><code>docker.io/knative-images/webhook:v0.13.0</code></td> </tr> <tr> <td><code>autoscaler-hpa</code></td> <td><code>docker.io/knative-images/autoscaler-hpa:v0.13.0</code></td> </tr> <tr> <td><code>networking-istio</code></td> <td><code>docker.io/knative-images/networking-istio:v0.13.0</code></td> </tr> <tr> <td><code>queue-proxy</code></td> <td><code>docker.io/knative-images/queue-proxy:v0.13.0</code></td> </tr> </tbody> </table> <p>Then, you need to define your operator CR with following content:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: registry: default: docker.io/knative-images/${NAME}:v0.13.0 </code></pre><h3 id="download-images-individually-without-secrets">Download images individually without secrets:</h3> <p>If your custom image links are not defined in a uniform format by default, you will need to individually include each link in the CR.</p> <p>For example, to given the following images:</p> <table> <thead> <tr> <th>Container</th> <th>Docker Image</th> </tr> </thead> <tbody> <tr> <td><code>activator</code></td> <td><code>docker.io/knative-images-repo1/activator:v0.13.0</code></td> </tr> <tr> <td><code>autoscaler</code></td> <td><code>docker.io/knative-images-repo2/autoscaler:v0.13.0</code></td> </tr> <tr> <td><code>controller</code></td> <td><code>docker.io/knative-images-repo3/controller:v0.13.0</code></td> </tr> <tr> <td><code>webhook</code></td> <td><code>docker.io/knative-images-repo4/webhook:v0.13.0</code></td> </tr> <tr> <td><code>autoscaler-hpa</code></td> <td><code>docker.io/knative-images-repo5/autoscaler-hpa:v0.13.0</code></td> </tr> <tr> <td><code>networking-istio</code></td> <td><code>docker.io/knative-images-repo6/prefix-networking-istio:v0.13.0</code></td> </tr> <tr> <td><code>queue-proxy</code></td> <td><code>docker.io/knative-images-repo7/queue-proxy-suffix:v0.13.0</code></td> </tr> </tbody> </table> <p>The operator CR should be modified to include the full list:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: registry: override: activator: docker.io/knative-images-repo1/activator:v0.13.0 autoscaler: docker.io/knative-images-repo2/autoscaler:v0.13.0 controller: docker.io/knative-images-repo3/controller:v0.13.0 webhook: docker.io/knative-images-repo4/webhook:v0.13.0 autoscaler-hpa: docker.io/knative-images-repo5/autoscaler-hpa:v0.13.0 networking-istio: docker.io/knative-images-repo6/prefix-networking-istio:v0.13.0 queue-proxy: docker.io/knative-images-repo7/queue-proxy-suffix:v0.13.0 </code></pre><h3 id="download-images-with-secrets">Download images with secrets:</h3> <p>If your image repository requires private secrets for access, include the <code>imagePullSecrets</code> attribute.</p> <p>This example uses a secret named <code>regcred</code>. You must create your own private secrets if these are required:</p> <ul> <li><a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#registry-secret-existing-credentials">From existing docker credentials</a></li> <li><a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-secret-by-providing-credentials-on-the-command-line">From command line for docker credentials</a></li> <li><a href="https://kubernetes.io/docs/concepts/configuration/secret/#creating-your-own-secrets">Create your own secret</a></li> </ul> <p>After you create this secret, edit your operator CR by appending the content below:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: registry: ... imagePullSecrets: - name: regcred </code></pre><p>The field <code>imagePullSecrets</code> expects a list of secrets. You can add multiple secrets to access the images as below:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: registry: ... imagePullSecrets: - name: regcred - name: regcred-2 ... </code></pre><h2 id="ssl-certificate-for-controller">SSL certificate for controller</h2> <p>To <a href="../../../serving/tag-resolution">enable tag to digest resolution</a>, the Knative Serving controller needs to access the container registry. To allow the controller to trust a self-signed registry cert, you can use the Operator to specify the certificate using a ConfigMap or Secret.</p> <p>Specify the following fields in <code>spec.controller-custom-certs</code> to select a custom registry certificate:</p> <ul> <li><code>name</code>: the name of the ConfigMap or Secret.</li> <li><code>type</code>: either the string &ldquo;ConfigMap&rdquo; or &ldquo;Secret&rdquo;.</li> </ul> <p>If you create a ConfigMap named <code>testCert</code> containing the certificate, change your CR:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: controller-custom-certs: name: testCert type: ConfigMap </code></pre><h2 id="configuration-of-knative-ingress-gateway">Configuration of Knative ingress gateway</h2> <p>To set up custom ingress gateway, follow <a href="../../../serving/setting-up-custom-ingress-gateway"><strong>Step 1: Create Gateway Service and Deployment Instance</strong></a>.</p> <h3 id="step-2-update-the-knative-gateway">Step 2: Update the Knative gateway</h3> <p>Update <code>spec.ingress.istio.knative-ingress-gateway</code> to select the labels of the new ingress gateway:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: ingress: istio: enabled: true knative-ingress-gateway: selector: custom: ingressgateway </code></pre><h3 id="step-3-update-gateway-configmap">Step 3: Update Gateway ConfigMap</h3> <p>Additionally, you will need to update the Istio ConfigMap:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: ingress: istio: enabled: true knative-ingress-gateway: selector: custom: ingressgateway config: istio: gateway.knative-serving.knative-ingress-gateway: &quot;custom-ingressgateway.istio-system.svc.cluster.local&quot; </code></pre><p>The key in <code>spec.config.istio</code> is in the format of <code>gateway.{{gateway_namespace}}.{{gateway_name}}</code>.</p> <h2 id="configuration-of-cluster-local-gateway">Configuration of cluster local gateway</h2> <p>Update <code>spec.ingress.istio.knative-local-gateway</code> to select the labels of the new cluster-local ingress gateway:</p> <h3 id="default-local-gateway-name">Default local gateway name:</h3> <p>Go through the guide <a href="../../installing-istio/#installing-istio-without-sidecar-injection">here</a> to use local cluster gateway, if you use the default gateway called <code>knative-local-gateway</code>.</p> <h3 id="non-default-local-gateway-name">Non-default local gateway name:</h3> <p>If you create custom local gateway with a name other than <code>knative-local-gateway</code>, update <code>config.istio</code> and the <code>knative-local-gateway</code> selector:</p> <p>This example shows a service and deployment <code>knative-local-gateway</code> in the namespace <code>istio-system</code>, with the label <code>custom: custom-local-gw</code>:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: ingress: istio: enabled: true knative-local-gateway: selector: custom: custom-local-gateway config: istio: local-gateway.knative-serving.knative-local-gateway: &quot;custom-local-gateway.istio-system.svc.cluster.local&quot; </code></pre><h2 id="high-availability">High availability</h2> <p>By default, Knative Serving runs a single instance of each controller. The <code>spec.high-availability</code> field allows you to configure the number of replicas for the following leader-elected controllers: <code>controller</code>, <code>autoscaler-hpa</code>, <code>networking-istio</code>. This field also configures the <code>HorizontalPodAutoscaler</code> resources for the data plane (<code>activator</code>):</p> <p>The following configuration specifies a replica count of 3 for the controllers and a minimum of 3 activators (which may scale higher if needed):</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: high-availability: replicas: 3 </code></pre><h2 id="system-resource-settings">System Resource Settings</h2> <p>The operator custom resource allows you to configure system resources for the Knative system containers. Requests and limits can be configured for the following containers: <code>activator</code>, <code>autoscaler</code>, <code>controller</code>, <code>webhook</code>, <code>autoscaler-hpa</code>, <code>networking-istio</code> and <code>queue-proxy</code>.</p> <p>To override resource settings for a specific container, create an entry in the <code>spec.resources</code> list with the container name and the <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container">Kubernetes resource settings</a>.</p> <p>For example, the following KnativeServing resource configures the <code>activator</code> to request 0.3 CPU and 100MB of RAM, and sets hard limits of 1 CPU, 250MB RAM, and 4GB of local storage:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: resources: - container: activator requests: cpu: 300m memory: 100Mi limits: cpu: 1000m memory: 250Mi ephemeral-storage: 4Gi </code></pre><p>If you would like to add another container <code>autoscaler</code> with the same configuration, you need to change your CR as below:</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: resources: - container: activator requests: cpu: 300m memory: 100Mi limits: cpu: 1000m memory: 250Mi ephemeral-storage: 4Gi - container: autoscaler requests: cpu: 300m memory: 100Mi limits: cpu: 1000m memory: 250Mi ephemeral-storage: 4Gi </code></pre><h2 id="override-system-deployments">Override system deployments</h2> <p>If you would like to override some configurations for a specific deployment, you can override the configuration by using <code>spec.deployments</code> in CR. Currently <code>replicas</code>, <code>labels</code> and <code>annotations</code> are supported.</p> <p>For example, the following KnativeServing resource overrides the <code>webhook</code> to have <code>3</code> replicass, <code>mylabel: foo</code> labels and <code>myannotataions: bar</code> annotations, while other system deployments have <code>2</code> replicas by <code>spec.high-availability</code>.</p> <pre><code>apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: ks namespace: knative-serving spec: high-availability: replicas: 2 deployments: - name: webhook replicas: 3 labels: mylabel: foo annotations: myannotataions: bar </code></pre><p><strong>NOTE:</strong> The labels and annotations settings override webhook&rsquo;s labels and annotations in deployment and pod both.</p> V0.23-Docs: Installation files https://knative.dev/v0.23-docs/install/installation-files/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/installation-files/ <p>This guide provides reference information about the YAML files in the Knative Serving and Eventing releases.</p> <p>The YAML files in the releases include:</p> <ul> <li>The custom resource definitions (CRDs) and core components required to install Knative.</li> <li>Optional components that you can apply to customize your installation.</li> </ul> <p>For information about installing these files, see <a href="../install-serving-with-yaml">Installing Serving using YAML files</a> and <a href="../install-eventing-with-yaml">Installing Eventing using YAML files</a>.</p> <h2 id="knative-serving-installation-files">Knative Serving installation files</h2> <p>The table below describes the installation files in the Knative Serving release:</p> <table> <thead> <tr> <th>File name</th> <th>Description</th> <th>Dependencies</th> </tr> </thead> <tbody> <tr> <td>serving-core.yaml</td> <td>Required: Knative Serving core components.</td> <td>serving-crds.yaml</td> </tr> <tr> <td>serving-crds.yaml</td> <td>Required: Knative Serving core CRDs.</td> <td>none</td> </tr> <tr> <td>serving-default-domain.yaml</td> <td>Configures Knative Serving to use <a href="http://sslip.io">http://sslip.io</a> as the default DNS suffix.</td> <td>serving-core.yaml</td> </tr> <tr> <td>serving-domainmapping-crds.yaml</td> <td>CRDs used by the Domain Mapping feature.</td> <td>none</td> </tr> <tr> <td>serving-domainmapping.yaml</td> <td>Components used by the Domain Mapping feature.</td> <td>serving-domainmapping-crds.yaml</td> </tr> <tr> <td>serving-hpa.yaml</td> <td>Components to autoscale Knative revisions through the Kubernetes Horizontal Pod Autoscaler.</td> <td>serving-core.yaml</td> </tr> <tr> <td>serving-nscert.yaml</td> <td>Components to provision TLS wildcard certificates.</td> <td>serving-core.yaml</td> </tr> <tr> <td>serving-post-install-jobs.yaml</td> <td>Additional jobs after installing <code>serving-core.yaml</code>. Currently it is the same as <code>serving-storage-version-migration.yaml</code>.</td> <td>serving-core.yaml</td> </tr> <tr> <td>serving-storage-version-migration.yaml</td> <td>Migrates the storage version of Knative resources, including Service, Route, Revision, and Configuration, from <code>v1alpha1</code> and <code>v1beta1</code> to <code>v1</code>. Required by upgrade from version 0.18 to 0.19.</td> <td>serving-core.yaml</td> </tr> </tbody> </table> <h2 id="knative-eventing-installation-files">Knative Eventing installation files</h2> <p>The table below describes the installation files in the Knative Eventing release:</p> <table> <thead> <tr> <th>File name</th> <th>Description</th> <th>Dependencies</th> </tr> </thead> <tbody> <tr> <td>eventing-core.yaml</td> <td>Required: Knative Eventing core components.</td> <td>eventing-crds.yaml</td> </tr> <tr> <td>eventing-crds.yaml</td> <td>Required: Knative Eventing core CRDs.</td> <td>none</td> </tr> <tr> <td>eventing-post-install.yaml</td> <td>Jobs required for upgrading to a new minor version.</td> <td>eventing-core.yaml, eventing-crds.yaml</td> </tr> <tr> <td>eventing-sugar-controller.yaml</td> <td>Reconciler that watches for labels and annotations on certain resources to inject eventing components.</td> <td>eventing-core.yaml</td> </tr> <tr> <td>eventing.yaml</td> <td>Combines <code>eventing-core.yaml</code>, <code>mt-channel-broker.yaml</code>, and <code>in-memory-channel.yaml</code>.</td> <td>none</td> </tr> <tr> <td>in-memory-channel.yaml</td> <td>Components to configure In-Memory Channels.</td> <td>eventing-core.yaml</td> </tr> <tr> <td>mt-channel-broker.yaml</td> <td>Components to configure Multi-Tenant (MT) Channel Broker.</td> <td>eventing-core.yaml</td> </tr> </tbody> </table> V0.23-Docs: Collecting Logs with Fluentbit https://knative.dev/v0.23-docs/install/collecting-logs/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/collecting-logs/ <p>This document describes how to set up <a href="https://docs.fluentbit.io/">Fluent Bit</a>, a log processor and forwarder, to collect your kubernetes logs in a central directory. This is not required for running Knative, but can be helpful with <a href="../serving">Knative Serving</a>, which will automatically delete pods (and their associated logs) when they are no longer needed. Note that Fluent Bit supports exporting to a number of other log providers; if you already have an existing log provider (for example, Splunk, Datadog, ElasticSearch, or Stackdriver), then you may only need <a href="#setting-up-the-forwarders">the second part of setting up and configuring log forwarders</a>.</p> <p>Setting up log collection consists of two pieces: running a log forwarding DaemonSet on each node, and running a collector somewhere in the cluster (in our example, we use a StatefulSet which stores logs on a Kubernetes PersistentVolumeClaim, but you could also use a HostPath).</p> <h2 id="setting-up-the-collector">Setting up the collector</h2> <p>It&rsquo;s useful to set up the collector before the forwarders, because you&rsquo;ll need the address of the collector when configuring the forwarders, and the forwarders may queue logs until the collector is ready.</p> <p><img src="system.svg" alt="System diagram: forwarders and co-located collector and nginx"></p> <!-- yuml.me UML rendering of: [Forwarder1]logs->[Collector] [Forwarder2]logs->[Collector] // Add notes [Collector]->[shared volume] [nginx]-[shared volume] --> <p>The <a href="./fluent-bit-collector.yaml"><code>fluent-bit-collector.yaml</code></a> defines a StatefulSet as well as a Kubernetes Service which allows accessing and reading the logs from within the cluster. The supplied configuration will create the monitoring configuration in a namespace called <code>logging</code>. You can apply the configuration with:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename https://github.com/knative/docs/raw/main/docs/install/collecting-logs/fluent-bit-collector.yaml </code></pre></div><p>The default configuration will classify logs into Knative, apps (pods with an <code>app=</code> label which aren&rsquo;t Knative), and the default to logging with the pod name; this can be changed by updating the <code>log-collector-config</code> ConfigMap before or after installation. Once the ConfigMap is updated, you&rsquo;ll need to restart Fluent Bit (for example, by deleting the pod and letting the StatefulSet recreate it).</p> <p>To access the logs through your web browser:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl port-forward --namespace logging service/log-collector 8080:80 </code></pre></div><p>And then visit http://localhost:8080/.</p> <p>You can also open a shell in the <code>nginx</code> pod and search the logs using unix tools:</p> <pre><code>kubectl exec --namespace logging --stdin --tty --container nginx log-collector-0 </code></pre><h2 id="setting-up-the-forwarders">Setting up the forwarders</h2> <p>For the most part, you can follow the <a href="https://docs.fluentbit.io/manual/installation/kubernetes">Fluent Bit directions for installing on Kubernetes</a>. Those directions will set up a Fluent Bit DaemonSet which forwards logs to ElasticSearch by default; when the directions call for creating the ConfigMap, you&rsquo;ll want to either replace the elasticsearch configuration with <a href="./fluent-bit-configmap.yaml">this <code>fluent-bit-configmap.yaml</code></a> or add the following block to the ConfigMap and update the <code>@INCLUDE output-elasticsearch.conf</code> to be <code>@INCLUDE output-forward.conf</code>.</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:#204a87;font-weight:bold">output-forward.conf</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic"> </span><span style="color:#8f5902;font-style:italic"> [OUTPUT] </span><span style="color:#8f5902;font-style:italic"> Name forward </span><span style="color:#8f5902;font-style:italic"> Host log-collector.logging </span><span style="color:#8f5902;font-style:italic"> Port 24224 </span><span style="color:#8f5902;font-style:italic"> Require_ack_response True</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><p>If you are using a different log collection infrastructure (Splunk, for example), <a href="https://docs.fluentbit.io/manual/pipeline/outputs">follow the directions in the FluentBit documentation</a> on how to configure your forwarders.</p> <h2 id="local-collector">Local collector</h2> <p><strong>NOTE:</strong> This describes a development environment setup, and is not appropriate for production.</p> <p>If you are using a local Kubernetes cluster for development (Kind, Docker Desktop, or Minikube), you can create a <code>hostPath</code> PersistentVolume to store the logs on your desktop OS. This will allow you to use all your normal desktop tools on the files without needing Kubernetes-specific tools.</p> <p>The PersistentVolumeClaim will look something like this, but the <code>hostPath</code> will vary based on your Kubernetes software and host operating system. Some example values are documented below.</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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">PersistentVolume</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">shared-logs</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">logs-collector</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">accessModes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#4e9a06">&#34;ReadWriteOnce&#34;</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">storageClassName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">manual</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">claimRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">PersistentVolumeClaim</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">logs-log-collector-0</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">logging</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">capacity</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">storage</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">5Gi</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">hostPath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">&lt;see below&gt;</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><p>And then you&rsquo;ll need to update the StatefulSet&rsquo;s <code>volumeClaimTemplates</code> to reference the <code>shared-logs</code> volume, like this fragment of yaml:</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:#204a87;font-weight:bold">volumeClaimTemplates</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">logs</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">accessModes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[</span><span style="color:#4e9a06">&#34;ReadWriteOnce&#34;</span><span style="color:#000;font-weight:bold">]</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">volumeName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">shared-logs</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><h3 id="kind">Kind</h3> <p>When creating your cluster, you&rsquo;ll need to use a <code>kind-config.yaml</code> and specify <code>extraMounts</code> for each node, like so:</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:#204a87;font-weight:bold">apiversion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kind.x-k8s.io/v1alpha4</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Cluster</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">nodes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">role</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">control-plane</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">extraMounts</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">hostPath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">./logs</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containerPath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">/shared/logs</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">role</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">worker</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">extraMounts</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">hostPath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">./logs</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containerPath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">/shared/logs</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><p>You can then use <code>/shared/logs</code> as the <code>spec.hostPath.path</code> in your PersistentVolume. Note that the directory path <code>./logs</code> is relative to the directory that the Kind cluster was created in.</p> <h3 id="docker-desktop">Docker Desktop</h3> <p>Docker desktop automatically creates some shared mounts between the host and the guest operating systems, so you only need to know the path to your home directory. Here are some examples for different operating systems:</p> <table> <thead> <tr> <th>Host OS</th> <th><code>hostPath</code></th> </tr> </thead> <tbody> <tr> <td>Mac OS</td> <td><code>/Users/${USER}</code></td> </tr> <tr> <td>Windows</td> <td><code>/run/desktop/mnt/host/c/Users/${USER}/</code></td> </tr> <tr> <td>Linux</td> <td><code>/home/${USER}</code></td> </tr> </tbody> </table> <h3 id="minikube">Minikube</h3> <p>Minikube requires an explicit command to <a href="https://minikube.sigs.k8s.io/docs/handbook/mount/">mount a directory into the VM running Kubernetes</a>. This command mounts the <code>logs</code> directory inside the current directory onto <code>/mnt/logs</code> in the VM:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">minikube mount ./logs:/mnt/logs </code></pre></div><p>You would then reference <code>/mnt/logs</code> as the <code>hostPath.path</code> in the PersistentVolume.</p> V0.23-Docs: Collecting Metrics with OpenTelemetry https://knative.dev/v0.23-docs/install/collecting-metrics/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/collecting-metrics/ <p>This document describes how to set up the <a href="https://opentelemetry.io/docs/collector/">OpenTelemetry Collector</a> to receive metrics from the Knative infrastructure components and distribute them to Prometheus. <a href="https://opentelemetry.io/">OpenTelemetry</a> is a CNCF an observability framework for cloud-native software. The project provides a collection of tools, APIs, and SDKs. You use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis in order to understand your software&rsquo;s performance and behavior. OpenTelemetry allows Knative to build provider-agnostic instrumentation into the platform, so that it&rsquo;s easy to export metrics to multiple monitoring services without needing to rebuild or reconfigure the Knative binaries.</p> <h2 id="setting-up-the-collector">Setting up the collector</h2> <p>The collector provides a long-lived location where various Knative components can push metrics (and eventually traces) to be retained and collected by a monitoring service. For this example, we&rsquo;ll configure a single collector instance using a ConfigMap and a Deployment. For more complex deployments, some of this can be automated using the <a href="https://github.com/open-telemetry/opentelemetry-operator">opentelemetry-operator</a>, but it&rsquo;s also easy to manage this service directly. Note that you can attach other components (node agents, other services); this is just a simple sample.</p> <p><img src="./system-diagram.svg" alt="Diagram of components reporting to collector, which is scraped by Prometheus"></p> <!-- yuml.me UML rendering of: [queue-proxy1]->[Collector] [queue-proxy2]->[Collector] [autoscaler]->[Collector] [controller]->[Collector] [Collector]<-scrape[Prometheus] --> <ol> <li> <p>First, create a namespace for the collector to run in:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create namespace metrics </code></pre></div></li> <li> <p>And then create a Deployment, Service, and ConfigMap for the collector:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename https://raw.githubusercontent.com/knative/docs/master/docs/install/collecting-metrics/collector.yaml </code></pre></div></li> <li> <p>Finally, update the <code>config-observability</code> ConfigMap in Knative Serving and Eventing</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl patch --namespace knative-serving configmap/config-observability <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --type merge <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --patch <span style="color:#4e9a06">&#39;{&#34;data&#34;:{&#34;metrics.backend-destination&#34;:&#34;opencensus&#34;,&#34;request-metrics-backend-destination&#34;:&#34;opencensus&#34;,&#34;metrics.opencensus-address&#34;:&#34;otel-collector.metrics:55678&#34;}}&#39;</span> kubectl patch --namespace knative-eventing configmap/config-observability <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --type merge <span style="color:#4e9a06">\ </span><span style="color:#4e9a06"></span> --patch <span style="color:#4e9a06">&#39;{&#34;data&#34;:{&#34;metrics.backend-destination&#34;:&#34;opencensus&#34;,&#34;metrics.opencensus-address&#34;:&#34;otel-collector.metrics:55678&#34;}}&#39;</span> </code></pre></div></li> </ol> <p>You can check that metrics are being forwarded by loading the Prometheus export port on the collector:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl port-forward --namespace metrics deployment/otel-collector <span style="color:#0000cf;font-weight:bold">8889</span> </code></pre></div><p>And then fetch http://localhost:8889/metrics to see the exported metrics.</p> <h2 id="setting-up-prometheus">Setting up Prometheus</h2> <p><a href="https://prometheus.io/">Prometheus</a> is an open-source tool for collecting and aggregating timeseries metrics. Full configuration of Prometheus can be found at the website, but this document will provide a simple setup for scraping the OpenTelemetry Collector we set up in the previous section.</p> <ol> <li> <p>Install the <a href="https://github.com/prometheus-operator/prometheus-operator">Prometheus Operator</a>. Note that the provided manifest installs the operator into the <code>default</code> namespace. If you want to install into another namespace, you&rsquo;ll need to download the YAML manifest and update all the namespace references to your target namespace.</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/master/bundle.yaml </code></pre></div></li> <li> <p>You&rsquo;ll then need to set up a ServiceMonitor object to track the OpenTelemetry Collector, as well as a ServiceAccount with the ability to read Kubernetes services and pods (so that Prometheus can track the resource endpoints) and finally a Prometheus object to instantiate the actual Prometheus instance.</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename prometheus.yaml </code></pre></div></li> </ol> <p>By default, the Prometheus instance will only be exposed on a private service named <code>prometheus-operated</code>; to access the console in your web browser, run:</p> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl port-forward --namespace metrics service/prometheus-operated <span style="color:#0000cf;font-weight:bold">9090</span> </code></pre></div><p>And then access the console in your browser via http://localhost:9090.</p> V0.23-Docs: Configuring the Eventing Operator custom resource https://knative.dev/v0.23-docs/install/operator/configuring-eventing-cr/ Mon, 01 Jan 0001 00:00:00 +0000 https://knative.dev/v0.23-docs/install/operator/configuring-eventing-cr/ <p>You can configure the Knative Eventing operator by modifying settings in the KnativeEventing custom resource (CR).</p> <p><strong>NOTE:</strong> Kubernetes spec level policies cannot be configured using the Knative Operators.</p> <!--TODO: break this into sub sections like for the channels sections, i.e. a page per topic--> <h2 id="installing-a-specific-version-of-eventing">Installing a specific version of Eventing</h2> <p>Cluster administrators can install a specific version of Knative Eventing by using the <code>spec.version</code> field. For example, if you want to install Knative Eventing v0.19.0, you can apply the following KnativeEventing CR:</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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">operator.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KnativeEventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">0.19.0</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><p>If <code>spec.version</code> is not specified, the Knative Operator will install the latest available version of Knative Eventing. If users specify an invalid or unavailable version, the Knative Operator will do nothing. The Knative Operator always includes the latest 3 minor release versions.</p> <p>If Knative Eventing is already managed by the Operator, updating the <code>spec.version</code> field in the KnativeEventing CR enables upgrading or downgrading the Knative Eventing version, without requiring modifications to the Operator.</p> <p>Note that the Knative Operator only permits upgrades or downgrades by one minor release version at a time. For example, if the current Knative Eventing deployment is version 0.18.x, you must upgrade to 0.19.x before upgrading to 0.20.x.</p> <h2 id="configuring-knative-eventing-using-configmaps">Configuring Knative Eventing using ConfigMaps</h2> <p>The Operator manages the Knative Eventing installation. It overwrites any updates to ConfigMaps which are used to configure Knative Eventing. The KnativeEventing CR allows you to set values for these ConfigMaps by using the Operator.</p> <p>All Knative Eventing ConfigMaps are created in the same namespace as the KnativeEventing CR. You can use the KnativeEventing CR as a unique entry point to edit all ConfigMaps.</p> <p>Knative Eventing has multiple ConfigMaps that are named with the prefix <code>config-</code>. The <code>spec.config</code> in the KnativeEventing CR has one <code>&lt;name&gt;</code> entry for each ConfigMap, named <code>config-&lt;name&gt;</code>, with a value which will be used for the ConfigMap <code>data</code>.</p> <h3 id="setting-a-default-channel">Setting a default channel</h3> <p>If you are using different channel implementations, like the KafkaChannel, or you want a specific configuration of the InMemoryChannel to be the default configuration, you can change the default behavior by updating the <code>default-ch-webhook</code> ConfigMap.</p> <p>You can do this by modifying the KnativeEventing CR:</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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">operator.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KnativeEventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default-ch-webhook</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default-ch-config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic"> </span><span style="color:#8f5902;font-style:italic"> clusterDefault: </span><span style="color:#8f5902;font-style:italic"> apiVersion: messaging.knative.dev/v1beta1 </span><span style="color:#8f5902;font-style:italic"> kind: KafkaChannel </span><span style="color:#8f5902;font-style:italic"> spec: </span><span style="color:#8f5902;font-style:italic"> numPartitions: 10 </span><span style="color:#8f5902;font-style:italic"> replicationFactor: 1 </span><span style="color:#8f5902;font-style:italic"> namespaceDefaults: </span><span style="color:#8f5902;font-style:italic"> my-namespace: </span><span style="color:#8f5902;font-style:italic"> apiVersion: messaging.knative.dev/v1 </span><span style="color:#8f5902;font-style:italic"> kind: InMemoryChannel </span><span style="color:#8f5902;font-style:italic"> spec: </span><span style="color:#8f5902;font-style:italic"> delivery: </span><span style="color:#8f5902;font-style:italic"> backoffDelay: PT0.5S </span><span style="color:#8f5902;font-style:italic"> backoffPolicy: exponential </span><span style="color:#8f5902;font-style:italic"> retry: 5</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><p><strong>NOTE:</strong> The <code>clusterDefault</code> setting determines the global, cluster-wide default channel type. You can configure channel defaults for individual namespaces by using the <code>namespaceDefaults</code> setting.</p> <h3 id="setting-the-default-channel-for-the-broker">Setting the default channel for the broker</h3> <p>If you are using a channel-based broker, you can change the default channel type for the broker from InMemoryChannel to KafkaChannel, by updating the <code>config-br-default-channel</code> ConfigMap.</p> <p>You can do this by modifying the KnativeEventing CR:</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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">operator.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KnativeEventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config-br-default-channel</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channelTemplateSpec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic"> </span><span style="color:#8f5902;font-style:italic"> apiVersion: messaging.knative.dev/v1beta1 </span><span style="color:#8f5902;font-style:italic"> kind: KafkaChannel </span><span style="color:#8f5902;font-style:italic"> spec: </span><span style="color:#8f5902;font-style:italic"> numPartitions: 6 </span><span style="color:#8f5902;font-style:italic"> replicationFactor: 1</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><h2 id="private-repository-and-private-secrets">Private repository and private secrets</h2> <p>The Knative Eventing Operator CR is configured the same way as the Knative Serving Operator CR. See the documentation on <a href="configuring-serving-cr#private-repository-and-private-secrets">Private repository and private secret</a>.</p> <p>Knative Eventing also specifies only one container within each Deployment resource. However, the container does not use the same name as its parent Deployment, which means that the container name in Knative Eventing is not the same unique identifier as it is in Knative Serving.</p> <p>List of containers within each Deployment resource:</p> <table> <thead> <tr> <th>Component</th> <th>Deployment name</th> <th>Container name</th> </tr> </thead> <tbody> <tr> <td>Core eventing</td> <td><code>eventing-controller</code></td> <td><code>eventing-controller</code></td> </tr> <tr> <td>Core eventing</td> <td><code>eventing-webhook</code></td> <td><code>eventing-webhook</code></td> </tr> <tr> <td>Eventing Broker</td> <td><code>broker-controller</code></td> <td><code>eventing-controller</code></td> </tr> <tr> <td>In-Memory Channel</td> <td><code>imc-controller</code></td> <td><code>controller</code></td> </tr> <tr> <td>In-Memory Channel</td> <td><code>imc-dispatcher</code></td> <td><code>dispatcher</code></td> </tr> </tbody> </table> <p>The <code>default</code> field can still be used to replace the images in a predefined format. However, if the container name is not a unique identifier, for example <code>eventing-controller</code>, you must use the <code>override</code> field to replace it, by specifying <code>deployment/container</code> as the unique key.</p> <p>Some images are defined by using the environment variable in Knative Eventing. They can be replaced by taking advantage of the <code>override</code> field.</p> <h3 id="download-images-in-a-predefined-format-without-secrets">Download images in a predefined format without secrets</h3> <p>This example shows how you can define custom image links that can be defined in the KnativeEventing CR using the simplified format <code>docker.io/knative-images/${NAME}:{CUSTOM-TAG}</code>.</p> <p>In the example below:</p> <ul> <li>The custom tag <code>latest</code> is used for all images.</li> <li>All image links are accessible without using secrets.</li> <li>Images are defined in the accepted format <code>docker.io/knative-images/${NAME}:{CUSTOM-TAG}</code>.</li> </ul> <ol> <li>Push images to the following image tags:</li> </ol> <table> <thead> <tr> <th>Deployment</th> <th>Container</th> <th>Docker image</th> </tr> </thead> <tbody> <tr> <td><code>eventing-controller</code></td> <td><code>eventing-controller</code></td> <td><code>docker.io/knative-images/eventing-controller:latest</code></td> </tr> <tr> <td></td> <td><code>eventing-webhook</code></td> <td><code>docker.io/knative-images/eventing-webhook:latest</code></td> </tr> <tr> <td><code>broker-controller</code></td> <td><code>eventing-controller</code></td> <td><code>docker.io/knative-images/broker-eventing-controller:latest</code></td> </tr> <tr> <td></td> <td><code>controller</code></td> <td><code>docker.io/knative-images/controller:latest</code></td> </tr> <tr> <td></td> <td><code>dispatcher</code></td> <td><code>docker.io/knative-images/dispatcher:latest</code></td> </tr> </tbody> </table> <ol start="2"> <li>Define your the KnativeEventing CR with following content:</li> </ol> <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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">operator.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KnativeEventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">registry</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images/${NAME}:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">override</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker-controller/eventing-controller</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo1/broker-eventing-controller:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><pre><code>- `${NAME}` maps to the container name in each `Deployment` resource. - `default` is used to define the image format for all containers, except the container `eventing-controller` in the deployment `broker-controller`. To replace the image for this container, use the `override` field to specify individually, by using `broker-controller/eventing-controller` as the key. </code></pre> <!-- TODO: check that this is still relevant, I don't see default in this example?--> <h3 id="download-images-from-different-repositories-without-secrets">Download images from different repositories without secrets</h3> <p>If your custom image links are not defined in a uniform format, you will need to individually include each link in the KnativeEventing CR.</p> <p>For example, to define the following list of images:</p> <table> <thead> <tr> <th>Deployment</th> <th>Container</th> <th>Docker Image</th> </tr> </thead> <tbody> <tr> <td><code>eventing-controller</code></td> <td><code>eventing-controller</code></td> <td><code>docker.io/knative-images/eventing-controller:latest</code></td> </tr> <tr> <td></td> <td><code>eventing-webhook</code></td> <td><code>docker.io/knative-images/eventing-webhook:latest</code></td> </tr> <tr> <td></td> <td><code>controller</code></td> <td><code>docker.io/knative-images/controller:latest</code></td> </tr> <tr> <td></td> <td><code>dispatcher</code></td> <td><code>docker.io/knative-images/dispatcher:latest</code></td> </tr> <tr> <td><code>broker-controller</code></td> <td><code>eventing-controller</code></td> <td><code>docker.io/knative-images/broker-eventing-controller:latest</code></td> </tr> </tbody> </table> <p>The KnativeEventing CR must be modified to include the full list. For example:</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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">operator.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KnativeEventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">registry</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">override</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing-controller/eventing-controller</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo1/eventing-controller:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing-webhook/eventing-webhook</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo2/eventing-webhook:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">imc-controller/controller</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo3/imc-controller:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">imc-dispatcher/dispatcher</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo4/imc-dispatcher:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker-controller/eventing-controller</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo5/broker-eventing-controller:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><p>If you want to replace the image defined by the environment variable, you must modify the KnativeEventing CR. For example, if you want to replace the image defined by the environment variable <code>DISPATCHER_IMAGE</code>, in the container <code>controller</code>, of the deployment <code>imc-controller</code>, and the target image is <code>docker.io/knative-images-repo5/DISPATCHER_IMAGE:latest</code>, the KnativeEventing CR would be as follows:</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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">operator.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KnativeEventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">registry</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">override</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing-controller/eventing-controller</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo1/eventing-controller:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing-webhook/eventing-webhook</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo2/eventing-webhook:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">imc-controller/controller</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo3/imc-controller:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">imc-dispatcher/dispatcher</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo4/imc-dispatcher:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker-controller/eventing-controller</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo5/broker-eventing-controller:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">DISPATCHER_IMAGE</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/knative-images-repo5/DISPATCHER_IMAGE:latest</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><h3 id="download-images-with-secrets">Download images with secrets</h3> <p>If your image repository requires private secrets for access, you must append the <code>imagePullSecrets</code> attribute to the KnativeEventing CR.</p> <p>This example uses a secret named <code>regcred</code>. Refer to the <a href="https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod">Kubernetes documentation</a> to create your own private secrets.</p> <p>After you create the secret, edit the KnativeEventing CR:</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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">operator.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KnativeEventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">registry</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><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">imagePullSecrets</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">regcred</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><p>The field <code>imagePullSecrets</code> requires a list of secrets. You can add multiple secrets to access the images:</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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">operator.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KnativeEventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">registry</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><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">imagePullSecrets</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">regcred</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">regcred-2</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">...</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><h2 id="configuring-the-default-broker-class">Configuring the default broker class</h2> <p>Knative Eventing allows you to define a default broker class when the user does not specify one. The Operator provides two broker classes by default: ChannelBasedBroker and MTChannelBasedBroker.</p> <p>The field <code>defaultBrokerClass</code> indicates which class to use; if empty, the ChannelBasedBroker is used.</p> <p>The following example CR specifies MTChannelBasedBroker as the default:</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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">operator.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KnativeEventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">defaultBrokerClass</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MTChannelBasedBroker</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div><h2 id="system-resource-settings">System resource settings</h2> <p>The KnativeEventing CR allows you to configure system resources for Knative system containers.</p> <p>Requests and limits can be configured for the following containers:</p> <ul> <li><code>eventing-controller</code></li> <li><code>eventing-webhook</code></li> <li><code>imc-controller</code></li> <li><code>imc-dispatcher</code></li> <li><code>mt-broker-ingress</code></li> <li><code>mt-broker-ingress</code></li> <li><code>mt-broker-controller</code></li> </ul> <p>To override resource settings for a specific container, you must create an entry in the <code>spec.resources</code> list with the container name and the <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container">Kubernetes resource settings</a>.</p> <p>For example, the following KnativeEventing CR configures the <code>eventing-webhook</code> container to request 0.3 CPU and 100MB of RAM, and sets hard limits of 1 CPU, 250MB RAM, and 4GB of local storage:</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:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">operator.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KnativeEventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">container</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing-webhook</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">requests</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">cpu</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">300m</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">memory</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">100Mi</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">limits</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">cpu</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">1000m</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">memory</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">250Mi</span><span style="color:#f8f8f8;text-decoration:underline"> </span></code></pre></div>