Performing a Custom Knative Installation

Use this guide to perform a custom installation of Knative on an existing Kubernetes cluster. Knative’s pluggable components allow you to install only what you need.

The steps covered in this guide are for advanced operators who want to customize each Knative installation. Installing individual Knative components requires you to run multiple installation commands.

Before you begin

  • If you are new to Knative, you should instead follow one of the platform-specific installation guides to help you get up and running quickly.

  • The steps in this guide use bash for the MacOS or Linux environment.

  • This guide assumes that you have an existing Kubernetes cluster, on which you’re comfortable installing and running alpha level software.

  • Knative requires a Kubernetes cluster v1.14 or newer, as well as a compatible kubectl.

Installing Istio

Knative depends on Istio for traffic routing and ingress.

If your cloud platform offers a managed Istio installation, we recommend installing Istio that way.

If you prefer to install Istio manually, see the Installing Istio for Knative guide.

Note: Ambassador and Gloo are available as an alternative to Istio.

Installing Knative components

Each Knative component must be installed individually. You can decide which components to install based on what you plan to do with Knative.

Choosing Knative installation files

The following Knative installation files are available:

Install details and options

The following table includes details about the available Knative installation files from the Knative repositories:

Knative Install Filename Notes Dependencies
knative/serving
serving.yaml Installs the Serving component.
serving-cert-manager.yaml Installs support for cert-manager and automatic TLS cert provisioning. Serving component
Observability plugins
monitoring.yaml Installs the ELK stack, Prometheus, Grafana, and Zipkin* Serving component
monitoring-logs-elasticsearch.yaml Installs only the ELK stack* Serving or Eventing component
monitoring-metrics-prometheus.yaml Installs only Prometheus* Serving component
monitoring-tracing-jaeger.yaml Installs only Jaeger* Serving or Eventing component, ELK stack (monitoring-logs-elasticsearch.yaml), Jaeger Operator
monitoring-tracing-jaeger-in-mem.yaml Installs only Jaeger in-memory* Serving or Eventing component, Jaeger Operator
monitoring-tracing-zipkin.yaml Installs only Zipkin.* Serving or Eventing component, ELK stack (monitoring-logs-elasticsearch.yaml)
monitoring-tracing-zipkin-in-mem.yaml Installs only Zipkin in-memory* Serving or Eventing component
knative/eventing
release.yaml Installs the Eventing component. Includes ContainerSource, [CronJobSource][6.2], InMemoryChannel.
eventing.yaml Installs the Eventing component. Includes ContainerSource and [CronJobSource][6.2]. Does not include any Channel.
in-memory-channel.yaml Installs only the InMemoryChannel. Eventing component
knative/eventing-contrib
github.yaml Installs the GitHub source. Eventing component
camel.yaml Installs the Apache Camel source. Eventing component
kafka-source.yaml Installs the Apache Kafka source. Eventing component
kafka-channel.yaml Installs the Kafka channel. Eventing component
awssqs.yaml Installs the AWS SQS source. Eventing component
event-display.yaml Installs a Knative Service that logs events received for use in samples and debugging. Serving component, Eventing component
natss-channel.yaml Installs the NATS streaming channel implementation. Eventing component
knative/google/knative-gcp
cloud-run-events.yaml Installs the GCP PubSub channel implementation

* See Installing logging, metrics, and traces for details about installing the various supported observability plugins.

† These are the recommended standard install files suitable for most use cases.

Installing Knative

To install Knative components or plugins, you specify and then run their filenames in the kubectl apply command. To prevent race conditions, you first create the CRD by using the -l knative.dev/crd-install=true flag.

Tip: From the table above, copy and paste the URL and filename into the commands below.

  1. Install the component or plugin:

    1. Create the URL variable and specify the path to the Knative component or plugin that you want to install:

      URL=[FILE_URL]

      Where [FILE_URL] is the URL path of a Knative component or plugin and includes the following details:

      https://github.com/knative/[COMPONENT]/releases/download/[VERSION]/[FILENAME].yaml

      • [COMPONENT]: A Knative component repository.
      • [VERSION]: Version number of a Knative component release.
      • [FILENAME]: Filename of the component or plugin that you want installed.

      Examples:

      https://github.com/knative/serving/releases/download/v0.11.0/serving.yaml
      https://github.com/knative/eventing/releases/download/v0.11.0/release.yaml
      https://github.com/knative/serving/releases/download/v0.11.0/monitoring.yaml
    2. Install only the CRD by using the --selector knative.dev/crd-install=true flag:

      kubectl apply --selector knative.dev/crd-install=true \
      --filename ${URL}
    3. Install the actual component or plugin by running the command without the --selector knative.dev/crd-install=true flag:

      kubectl apply --filename ${URL}

      Tip: To install multiple components or plugins at the same time, you can add multiple --filename [FILE_URL] flags to the commands.

    Example install commands:

    The following examples demonstrate how to install muliptle components and plugins at the same time.

    • To install the Knative Serving component with the set of observability plugin, run the following commands:

      1. Installs the CRDs only:

        kubectl apply --selector knative.dev/crd-install=true \
        --filename https://github.com/knative/serving/releases/download/v0.11.0/serving.yaml \
        --filename https://github.com/knative/serving/releases/download/v0.11.0/monitoring.yaml
      2. Remove the --selector knative.dev/crd-install=true flag to install the actual Serving component and observability plugin:

        kubectl apply --filename https://github.com/knative/serving/releases/download/v0.11.0/serving.yaml \
        --filename https://github.com/knative/serving/releases/download/v0.11.0/monitoring.yaml
    • To install both Knative components without an observability plugin, run the following commands.

      1. Installs the CRDs only:

        kubectl apply --selector knative.dev/crd-install=true \
        --filename https://github.com/knative/serving/releases/download/v0.11.0/serving.yaml \
        --filename https://github.com/knative/eventing/releases/download/v0.11.0/release.yaml
      2. Remove the --selector knative.dev/crd-install=true flag to install all the Knative components and the Eventing resources:

        kubectl apply --filename https://github.com/knative/serving/releases/download/v0.11.0/serving.yaml \
        --filename https://github.com/knative/eventing/releases/download/v0.11.0/release.yaml
  2. Run one or more of the following commands to ensure that your component or plugin was installed successfully. It can take a few seconds for your install to complete, so rerun the commands until you receive a STATUS of Running.

    Tip: You can append the --watch flag to the kubectl get commands to view the pod status in realtime. You use CTRL + C to exit watch mode.

    • If you installed the Serving or Eventing component:

      kubectl get pods --namespace knative-serving
      kubectl get pods --namespace knative-eventing
    • If you installed an observability plugin:

      kubectl get pods --namespace knative-monitoring

For information about installing other Knative features, see the following topics:

You are now ready to deploy an app or start sending and receiving events in your Knative cluster.

What’s next

Depending on the Knative components you installed, you can use the following guides to help you get started with Knative: