### Install Knative Quickstart Plugin with Binary Source: https://github.com/knative/docs/blob/main/docs/snippets/quickstart-install.md Install the Knative quickstart plugin by downloading the binary, making it executable, and moving it to your PATH. Verify the installation with `kn quickstart --help`. ```bash mv kn-quickstart /usr/local/bin ``` ```bash kn quickstart --help ``` -------------------------------- ### Install Knative Quickstart Plugin with Go Source: https://github.com/knative/docs/blob/main/docs/snippets/quickstart-install.md Install the Knative quickstart plugin by cloning the repository, building the binary, and moving it to your PATH. Verify the installation with `kn quickstart --help`. ```bash git clone https://github.com/knative-extensions/kn-plugin-quickstart.git cd kn-plugin-quickstart/ ``` ```bash hack/build.sh ``` ```bash mv kn-quickstart /usr/local/bin ``` ```bash kn quickstart --help ``` -------------------------------- ### Run Knative Quickstart with kind Source: https://github.com/knative/docs/blob/main/docs/snippets/quickstart-install.md Install Knative and Kubernetes using kind with the quickstart plugin. Ensure no other services are using Port 80. Verify the cluster with `kind get clusters`. ```bash kn quickstart kind ``` ```bash netstat -tnlp | grep 80 ``` ```bash kind get clusters ``` -------------------------------- ### Install Knative with Quickstart Plugin Source: https://github.com/knative/docs/blob/main/docs/blog/articles/quickstart-with-knative.md Use the Knative client's quickstart plugin to set up a local Knative environment with KinD. This command installs Knative Serving, Eventing, and Kourier networking. ```bash $ kn quickstart kind Running Knative Quickstart using Kind βœ… Checking dependencies... Kind version is: kind v0.11.1 go1.16.4 linux/amd64 ☸ Creating Kind cluster... Cluster ready 🍿 Installing Knative Serving v0.25.0 ... CRDs installed... Core installed... Finished installing Knative Serving πŸ•ΈοΈ Installing Kourier networking layer v0.25.0 ... Kourier installed... Ingress patched... Kourier service installed... Domain DNS set up... Finished installing Kourier Networking layer πŸ”₯ Installing Knative Eventing v0.25.0 ... CRDs installed... Core installed... In-memory channel installed... Mt-channel broker installed... Example broker installed... Finished installing Knative Eventing πŸš€ Knative install took: 1m50s πŸŽ‰ Now have some fun with Serverless and Event Driven Apps! ``` -------------------------------- ### Install and start k0s Source: https://github.com/knative/docs/blob/main/docs/blog/articles/knative-serving-in-k0s.md Download, install, and start k0s as a controller in single-node mode. ```bash # Download k0s curl -sSLf https://get.k0s.sh | sudo sh # Install k0s as a service sudo k0s install controller --single # Start k0s as a service sudo k0s start # Check service, logs and k0s status sudo k0s status # Access your cluster using kubectl sudo k0s kubectl get nodes ``` -------------------------------- ### Install Knative Locally with Quickstart Source: https://context7.com/knative/docs/llms.txt Install Knative locally using the `kn quickstart` plugin. This command creates a `kind` cluster with Knative Serving and Eventing pre-installed. Verify the installation using `kn service list` and `kn broker list`. ```bash # Install kn CLI (macOS) brew install kn # Install quickstart plugin brew install knative-sandbox/kn-plugins/quickstart # Create a local kind cluster with Knative pre-installed kn quickstart kind # 🍿 Downloading Knative Quickstart plugin... # βœ… kind cluster created # βœ… Knative Serving installed # βœ… Knative Eventing installed # Verify installation kn service list # Serving ready kn broker list # Eventing ready ``` -------------------------------- ### Install ko with go get Source: https://github.com/knative/docs/blob/main/docs/blog/articles/ko-fast-kubernetes-microservice-development-in-go.md Use 'go get' to install the 'ko' command-line tool. This is a standard way to install Go binaries. ```bash # e.g. installing ko itself go get github.com/google/go-containerregistry/cmd/ko ``` -------------------------------- ### Install Knative Quickstart Plugin with Homebrew Source: https://github.com/knative/docs/blob/main/docs/snippets/quickstart-install.md Install the Knative quickstart plugin using Homebrew. Use `brew upgrade` if upgrading from a previous version. ```bash brew install knative-extensions/kn-plugins/quickstart ``` -------------------------------- ### Start Local Preview with MkDocs CLI Source: https://github.com/knative/docs/blob/main/contribute-to-docs/getting-started/previewing-docs-locally.md Run this command in the root of your cloned repository after installing dependencies to start the local development server for MkDocs. ```bash mkdocs serve ``` -------------------------------- ### Run Knative Quickstart with minikube Source: https://github.com/knative/docs/blob/main/docs/snippets/quickstart-install.md Install Knative and Kubernetes using minikube with the quickstart plugin. A minikube tunnel must be running in a secondary terminal. Verify the profile with `minikube profile list`. ```bash minikube tunnel --profile knative ``` ```bash minikube profile list ``` -------------------------------- ### Example Knative Serving Pod Status Source: https://github.com/knative/docs/blob/main/docs/versioned/install/yaml-install/serving/install-serving-with-yaml.md Example output showing the status of Knative Serving pods. All components should display 'Running' or 'Completed' for a successful installation. ```bash NAME READY STATUS RESTARTS AGE 3scale-kourier-control-54cc54cc58-mmdgq 1/1 Running 0 81s activator-67656dcbbb-8mftq 1/1 Running 0 97s autoscaler-df6856b64-5h4lc 1/1 Running 0 97s controller-788796f49d-4x6pm 1/1 Running 0 97s webhook-859796bc7-8n5g2 1/1 Running 0 96s ``` -------------------------------- ### Example Pod Status Output Source: https://github.com/knative/docs/blob/main/docs/versioned/serving/troubleshooting/debugging-application-issues.md This example shows typical output from 'kubectl get pods', highlighting different pod statuses like 'Running' and 'CrashLoopBackOff'. ```text NAME READY STATUS RESTARTS AGE configuration-example-00001-deployment-659747ff99-9bvr4 2/2 Running 0 3h configuration-example-00002-deployment-5f475b7849-gxcht 1/2 CrashLoopBackOff 2 36s ``` -------------------------------- ### Install KinD Source: https://github.com/knative/docs/blob/main/docs/blog/articles/set-up-a-local-knative-environment-with-kind.md Download and install the KinD binary. Ensure the directory is in your system's PATH. ```bash curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.8.1/kind-$(uname)-amd64 chmod +x ./kind mv ./kind /some-dir-in-your-PATH/kind ``` -------------------------------- ### Clone Hello World Java Quarkus Sample Source: https://github.com/knative/docs/blob/main/code-samples/community/serving/helloworld-java-quarkus/index.md Clone the sample code from the repository to get started. This command downloads the code and navigates you to the sample's directory. ```bash git clone https://github.com/knative/docs.git knative/docs cd knative/docs/code-samples/community/serving/helloworld-java-quarkus ``` -------------------------------- ### Start Local Preview with MkDocs CLI (Dirty Reload) Source: https://github.com/knative/docs/blob/main/contribute-to-docs/getting-started/previewing-docs-locally.md Use this command with the `--dirtyreload` flag for faster rebuilds when only changing non-homepage files in the `/docs/` directory. Requires MkDocs to be installed. ```bash mkdocs serve --dirtyreload ``` -------------------------------- ### Install Apache Kafka Channel Controller Source: https://github.com/knative/docs/blob/main/docs/versioned/install/yaml-install/eventing/install-eventing-with-yaml.md Install the controller for the Apache Kafka Channel. ```bash kubectl apply -f {{ artifact(org="knative-extensions",repo="eventing-kafka-broker",file="eventing-kafka-controller.yaml")}} ``` -------------------------------- ### Install func CLI with Homebrew Source: https://github.com/knative/docs/blob/main/docs/snippets/install-func-CLI.md Use Homebrew to install the func CLI. If the kn CLI is already installed, func is automatically recognized as a plugin. ```bash brew tap knative-extensions/kn-plugins ``` ```bash brew install func ``` -------------------------------- ### Install Istio with istioctl Source: https://github.com/knative/docs/blob/main/docs/versioned/install/installing-istio.md Use this command for a basic Istio installation suitable for most Knative use cases. ```sh istioctl install -y ``` -------------------------------- ### Apply Sample Source Configuration Source: https://github.com/knative/docs/blob/main/docs/versioned/eventing/custom-event-source/custom-event-source/publish-event-source.md Deploys the `example.yaml` file which defines the `event-display` service and the `sample-source`. ```bash ko apply -f example.yaml ``` -------------------------------- ### Example Pod Status Output Source: https://github.com/knative/docs/blob/main/docs/snippets/event-display.md An example of the output from `kubectl get pods`, showing the event-display pod in a 'Running' state. ```bash NAME READY STATUS RESTARTS AGE event-display-00001-deployment-5d5df6c7-gv2j4 2/2 Running 0 72s ``` -------------------------------- ### Example: Labeling Hello World Service as Cluster-Local Source: https://github.com/knative/docs/blob/main/docs/versioned/serving/services/private-services.md This example demonstrates deploying the Hello World sample and then labeling its Knative Service to make it cluster-local. Verify the change by checking the Service's URL. ```bash kubectl label kservice helloworld-go networking.knative.dev/visibility=cluster-local ``` ```bash kubectl get kservice helloworld-go NAME URL LATESTCREATED LATESTREADY READY REASON helloworld-go http://helloworld-go.default.svc.cluster.local helloworld-go-2bz5l helloworld-go-2bz5l True ``` -------------------------------- ### Install Kubetest for End-to-End Tests Source: https://github.com/knative/docs/blob/main/test/README.md Install the `kubetest` tool using `go get`. This is a dependency for running end-to-end tests locally. ```bash go get -u k8s.io/test-infra/kubetest ``` -------------------------------- ### Install kn from binary Source: https://github.com/knative/docs/blob/main/docs/snippets/install-kn.md Download the executable binary for your system, rename it to `kn`, make it executable, and move it to your system path. Verify the installation with `kn version`. ```bash mv kn ``` ```bash chmod +x kn ``` ```bash mv kn /usr/local/bin ``` ```bash kn version ``` -------------------------------- ### Example Gateway Configuration Source: https://github.com/knative/docs/blob/main/docs/versioned/serving/setting-up-custom-ingress-gateway.md This is an example of the `external-gateways` field within the `config-istio` ConfigMap, showing the default Knative ingress gateway setup. ```yaml apiVersion: v1 data: _example: | ################################ # # # EXAMPLE CONFIGURATION # # # ################################ # ... external-gateways: | - name: knative-ingress-gateway namespace: knative-serving service: istio-ingressgateway.istio-system.svc.cluster.local ``` -------------------------------- ### Deploy Hello World App with Knative Source: https://github.com/knative/docs/blob/main/docs/versioned/samples/eventing.md A basic Go example demonstrating how to deploy an application using Knative. ```Go package main import ( log "log" ``` -------------------------------- ### Install func CLI from Source (Go) Source: https://github.com/knative/docs/blob/main/docs/snippets/install-func-CLI.md Build the func CLI from source by cloning the repository, navigating to the directory, and running make. Then, move the executable to your system path. ```bash git clone https://github.com/knative/func.git func ``` ```bash cd func/ ``` ```bash make ``` ```bash func version ``` -------------------------------- ### Run Setup Script Source: https://github.com/knative/docs/blob/main/docs/versioned/bookstore/page-0.5/environment-setup.md This script automates the environment setup tasks for the bookstore sample application. It is recommended to review the manual steps if you are unfamiliar with the process. ```sh docs/code-samples/eventing/bookstore-sample-app/start/setup.sh ``` -------------------------------- ### Install func CLI with Executable Binary Source: https://github.com/knative/docs/blob/main/docs/snippets/install-func-CLI.md Install func by downloading the executable binary for your system, renaming it, making it executable, and moving it to your system path. ```bash mv func ``` ```bash chmod +x func ``` ```bash mv func /usr/local/bin ``` ```bash func version ``` -------------------------------- ### Example Knative Eventing Pod Status Source: https://github.com/knative/docs/blob/main/docs/versioned/install/upgrade/upgrade-installation.md This is an example output of the `kubectl get pods -n knative-eventing` command, showing the status of eventing pods after an upgrade. ```bash NAME READY STATUS RESTARTS AGE eventing-controller-69ffcc6f7d-5l7th 1/1 Running 0 83s eventing-webhook-6c56fcd86c-42dr8 1/1 Running 0 81s imc-controller-6bcf5957b5-6ccp2 1/1 Running 0 80s imc-dispatcher-f59b7c57-q9xcl 1/1 Running 0 80s sources-controller-8596684d7b-jxkmd 1/1 Running 0 83s ``` -------------------------------- ### Apply Example YAML and Verify Source: https://github.com/knative/docs/blob/main/docs/versioned/eventing/features/transport-encryption.md Create a test namespace, apply the example Broker, Trigger, Service, and Pod YAML, and then verify that broker addresses are HTTPS. ```shell kubectl create namespace transport-encryption-test kubectl apply -n transport-encryption-test -f defautl-broker-example.yaml ``` ```shell kubectl get brokers.eventing.knative.dev -n transport-encryption-test br -oyaml ``` -------------------------------- ### Install Dart Dependencies Source: https://github.com/knative/docs/blob/main/code-samples/community/serving/helloworld-dart/index.md Run `dart pub get` to install project dependencies. This step is optional if you only intend to run the application within Docker or Knative. ```shell > dart pub get ``` -------------------------------- ### Deploy Hello World App with Knative Serving Source: https://github.com/knative/docs/blob/main/docs/versioned/samples/serving.md A basic example to demonstrate deploying an application using Knative Serving. Links to multiple language implementations are available. ```Go apiVersion: serving.knative.dev/v1 kind: Service metadata: name: helloworld-go spec: template: spec: containers: - image: gcr.io/knative-samples/helloworld-go env: - name: TARGET value: "Go Sample v1" ``` -------------------------------- ### Backstage Application Log Example Source: https://github.com/knative/docs/blob/main/docs/versioned/install/installing-backstage-plugins.md An example log line that may appear when starting your Backstage application with the Knative Event Mesh plugin configured. This can be useful for troubleshooting. ```text [1] 2024-01-04T09:38:08.707Z knative-event-mesh-backend info Found 1 knative event mesh provider configs with ids: dev type=plugin ``` -------------------------------- ### Create Function Using Installed Language Pack Source: https://github.com/knative/docs/blob/main/docs/versioned/functions/language-packs.md Create a function using a template from an installed language pack by prefixing the template name with the repository alias. For example, `knative/metacontroller`. ```bash func create -t knative/metacontroller -l nodejs my-controller-function ``` -------------------------------- ### Example Queue-Proxy Log Output Source: https://github.com/knative/docs/blob/main/docs/versioned/serving/encryption/system-internal-tls.md This is an example of the expected log output from the `queue-proxy` container when system-internal TLS is successfully configured and operational. It shows the certificate watcher starting and reloading certificates. ```json {"severity":"INFO","timestamp":"2024-01-03T07:07:32.892810888Z","logger":"queueproxy","caller":"certificate/watcher.go:62","message":"Starting to watch the following directories for changes{certDir 15 0 /var/lib/knative/certs } {keyDir 15 0 /var/lib/knative/certs }","commit":"86420f2-dirty","knative.dev/key":"first/helloworld-00001","knative.dev/pod":"helloworld-00001-deployment-75fbb7d488-qgmxx"} {"severity":"INFO","timestamp":"2024-01-03T07:07:32.89397512Z","logger":"queueproxy","caller":"certificate/watcher.go:131","message":"Certificate and/or key have changed on disk and were reloaded.","commit":"86420f2-dirty","knative.dev/key":"first/helloworld-00001","knative.dev/pod":"helloworld-00001-deployment-75fbb7d488-qgmxx"} {"severity":"INFO","timestamp":"2024-01-03T07:07:32.894232939Z","logger":"queueproxy","caller":"sharedmain/main.go:282","message":"Starting tls server admin:8022","commit":"86420f2-dirty","knative.dev/key":"first/helloworld-00001","knative.dev/pod":"helloworld-00001-deployment-75fbb7d488-qgmxx"} {"severity":"INFO","timestamp":"2024-01-03T07:07:32.894268548Z","logger":"queueproxy","caller":"sharedmain/main.go:282","message":"Starting tls server main:8112","commit":"86420f2-dirty","knative.dev/key":"first/helloworld-00001","knative.dev/pod":"helloworld-00001-deployment-75fbb7d488-qgmxx"} ``` -------------------------------- ### Start Live Preview with Docker Source: https://github.com/knative/docs/blob/main/contribute-to-docs/getting-started/previewing-docs-locally.md Run this script from the root of your local Knative docs repository to start a live preview server. Changes in the `./docs` directory will auto-reload. ```bash ./hack/docker/run.sh ``` -------------------------------- ### Install Security-Guard with Knative Operator Source: https://github.com/knative/docs/blob/main/docs/versioned/serving/app-security/security-guard.md Example script to install Knative Serving with Security-Guard enabled using the Knative Operator and Kourier ingress. Adjust ingress configuration if using Istio or Contour. ```yaml kubectl apply --filename - < /dev/null` PEM=`echo $DOC | jq -r '.data."ca-cert.pem"'` done echo " Secret found!" echo "Copy the certificate to file" ROOTCA="$(mktemp)" FILENAME=`basename $ROOTCA` echo $PEM | base64 -d > $ROOTCA echo "Create a temporary config-deployment configmap with the certificate" CERT=`kubectl create cm config-deployment --from-file $ROOTCA -o json --dry-run=client |jq .data."$FILENAME"` echo "cleanup" rm $ROOTCA kubectl apply --filename - <", "namespace": "knative-serving", "serviceAccount": "controller", "associationArn": "", "associationId": "" }, ... } } ``` -------------------------------- ### AWS CLI Example for ECR Pod Identity Setup Source: https://github.com/knative/docs/blob/main/docs/versioned/install/operator/configuring-serving-cr.md This AWS CLI script sets up the necessary IAM roles and EKS Pod Identity associations for Knative Serving to access AWS ECR. Adapt region and cluster name variables. ```bash # Set variables REGION="" CLUSTER_NAME="" ROLE_NAME="knative-serving-controller" NAMESPACE="knative-serving" SERVICE_ACCOUNT="controller" ACCOUNT_ID="$(aws sts get-caller-identity --query 'Account' --output text)" PARTITION="$(aws sts get-caller-identity --query 'Arn' --output text | cut -d: -f2)" # Create trust policy for EKS Pod Identity cat > trust-policy.json <