-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add instruction in how to install Knative with Knative operators (#2261) #2304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
knative-prow-robot
merged 1 commit into
knative:release-0.13
from
houshengbo:release-13-pick
Mar 12, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
|
|
||
| To install Knative components on your Kubernetes cluster, follow our [installation guide](./any-kubernetes-cluster.md). | ||
| To install Knative components on your Kubernetes cluster, follow the [installation guide](./any-kubernetes-cluster.md) or | ||
| [installation guide with Knative Operators](./knative-with-operators.md). | ||
|
|
||
| To install the Knative CLI, follow our [installation guide](./install-kn.md). | ||
| To install the Knative CLI, follow the [installation guide](./install-kn.md). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,256 @@ | ||
| --- | ||
| title: "Installing Knative components using Operators" | ||
| weight: 10 | ||
| type: "docs" | ||
| --- | ||
|
|
||
| Knative provides operators as tools to install, configure and manage Knative. This guide explains how to install and | ||
| uninstall Knative using Knative operators. | ||
|
|
||
| Each component in Knative has a separate operator for installation and configuration. This means that there is a [Serving operator](https://github.com/knative/serving-operator) | ||
| and an [Eventing operator](https://github.com/knative/eventing-operator), and you can choose to install one or both independently. | ||
|
|
||
| ## Before you begin | ||
|
|
||
| Knative installation using Operators requires the following: | ||
|
|
||
| - A Kubernetes cluster v1.15 or newer, as well as a compatible kubectl. This guide assumes that you've already created | ||
| a Kubernetes cluster. If you have only one node for your cluster, set CPUs to at least 6, Memory to at least 6.0 GB, | ||
| Disk storage to at least 30 GB. If you have multiple nodes for your cluster, set CPUs to at least 2, Memory to at least | ||
| 4.0 GB, Disk storage to at least 20 GB for each node. | ||
| - The Kubernetes cluster must be able to access the internet, since Knative operators download images online. | ||
| - Istio: | ||
| - [Download and install Istio](https://knative.dev/development/install/installing-istio/#downloading-istio-and-installing-crds). Go through all the 4 sub-steps. | ||
| - [Update your Istio to use cluster local gateway](https://knative.dev/development/install/installing-istio/#updating-your-install-to-use-cluster-local-gateway). | ||
|
|
||
| ## Limitations of Knative Operators: | ||
|
|
||
| Knative Operators use custom resources (CRs) to configure your Knative deployment. | ||
|
|
||
| - Currently, the CRs included with Knative Operators do not provide high availability (HA) capabilities. | ||
| - Knative Operators have not been tested in a production environment, and should be used for development or test purposes only. | ||
|
|
||
| ## Install Knative Serving with Operator: | ||
|
|
||
| Information about Knative Serving Operator releases can be found on the [Releases page](https://github.com/knative/serving-operator/releases). | ||
|
|
||
| ### Installing the Knative Serving Operator | ||
|
|
||
| __From releases__: | ||
|
|
||
| Run the following command to install Knative Serving Operator: | ||
|
|
||
| ``` | ||
| kubectl apply -f https://github.com/knative/serving-operator/releases/download/v0.13.0/serving-operator.yaml | ||
| ``` | ||
|
|
||
| __From source code__: | ||
|
|
||
| You can also install Knative Operators from source using `ko`. | ||
|
|
||
| 1. Install the [ko](https://github.com/google/ko) build tool. | ||
| 1. Install the operator in the root directory of the source using the following command: | ||
|
|
||
| ``` | ||
| ko apply -f config/ | ||
| ``` | ||
|
|
||
| ### Verify the operator installation | ||
|
|
||
| Verify the installation of Knative Serving Operator using the command: | ||
|
|
||
| ``` | ||
| kubectl get deployment knative-serving-operator | ||
| ``` | ||
|
|
||
| If the operator is installed correctly, the deployment should show a `Ready` status. Here is a sample output: | ||
|
|
||
| ``` | ||
| NAME READY UP-TO-DATE AVAILABLE AGE | ||
| knative-serving-operator 1/1 1 1 19h | ||
| ``` | ||
|
|
||
| ### Track the log | ||
|
|
||
| Use the following command to track the log of the operator: | ||
|
|
||
| ``` | ||
| kubectl logs -f $(kubectl get pods -l name=knative-serving-operator -o name) | ||
| ``` | ||
|
|
||
| ### Installing the Knative Serving component | ||
|
|
||
| 1. Create and apply the Knative Serving CR: | ||
|
|
||
| ``` | ||
| cat <<-EOF | kubectl apply -f - | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: knative-serving | ||
| --- | ||
| apiVersion: operator.knative.dev/v1alpha1 | ||
| kind: KnativeServing | ||
| metadata: | ||
| name: knative-serving | ||
| namespace: knative-serving | ||
| EOF | ||
| ``` | ||
|
|
||
| 2. Verify the Knative Serving deployment: | ||
|
|
||
| ``` | ||
| kubectl get deployment -n knative-serving | ||
| ``` | ||
|
|
||
| If Knative Serving has been successfully deployed, all deployments of the Knative Serving will show `READY` status. Here | ||
| is a sample output: | ||
|
|
||
| ``` | ||
| NAME READY UP-TO-DATE AVAILABLE AGE | ||
| activator 1/1 1 1 19h | ||
| autoscaler 1/1 1 1 19h | ||
| autoscaler-hpa 1/1 1 1 19h | ||
| controller 1/1 1 1 19h | ||
| networking-istio 1/1 1 1 19h | ||
| webhook 1/1 1 1 19h | ||
| ``` | ||
|
|
||
| ## Install Knative Eventing with Operator: | ||
|
|
||
| Information about Knative Eventing Operator releases can be found on the [Releases page](https://github.com/knative/eventing-operator/releases). | ||
|
|
||
| ### Installing the Knative Eventing Operator | ||
|
|
||
| __From releases__: | ||
|
|
||
| Run the following command to install Knative Eventing Operator: | ||
|
|
||
| ``` | ||
| kubectl apply -f https://github.com/knative/eventing-operator/releases/download/v0.13.0/eventing-operator.yaml | ||
| ``` | ||
|
|
||
| __From source code__: | ||
|
|
||
| You can also install Knative Operators from source using `ko`. | ||
|
|
||
| - Install the [ko]((https://github.com/google/ko)) build tool. | ||
| - Install the operator in the root directory of the source using the following command: | ||
|
|
||
| ``` | ||
| ko apply -f config/ | ||
| ``` | ||
|
|
||
| ### Verify the operator installation | ||
|
|
||
| Verify the installation of Knative Eventing Operator using the command: | ||
|
|
||
| ``` | ||
| kubectl get deployment knative-eventing-operator | ||
| ``` | ||
|
|
||
| If the operator is installed correctly, the deployment should show a `Ready` status. Here is a sample output: | ||
|
|
||
| ``` | ||
| NAME READY UP-TO-DATE AVAILABLE AGE | ||
| knative-eventing-operator 1/1 1 1 19h | ||
| ``` | ||
|
|
||
| ### Track the log | ||
|
|
||
| Use the following command to track the log of the operator: | ||
|
|
||
| ``` | ||
| kubectl logs -f $(kubectl get pods -l name=knative-eventing-operator -o name) | ||
| ``` | ||
|
|
||
| ### Installing the Knative Eventing component | ||
|
|
||
| 1. Create and apply the Knative eventing CR: | ||
|
|
||
| ``` | ||
| cat <<-EOF | kubectl apply -f - | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: knative-eventing | ||
| --- | ||
| apiVersion: operator.knative.dev/v1alpha1 | ||
| kind: KnativeEventing | ||
| metadata: | ||
| name: knative-eventing | ||
| namespace: knative-eventing | ||
| EOF | ||
| ``` | ||
|
|
||
| 2. Verify the Knative Eventing deployment: | ||
|
|
||
| ``` | ||
| kubectl get deployment -n knative-eventing | ||
| ``` | ||
|
|
||
| If Knative Eventing has been successfully deployed, all deployments of the Knative Eventing will show `READY` status. Here | ||
| is a sample output: | ||
|
|
||
| ``` | ||
| NAME READY UP-TO-DATE AVAILABLE AGE | ||
| broker-controller 1/1 1 1 42h | ||
| eventing-controller 1/1 1 1 42h | ||
| eventing-webhook 1/1 1 1 42h | ||
| imc-controller 1/1 1 1 42h | ||
| imc-dispatcher 1/1 1 1 42h | ||
| ``` | ||
|
|
||
| ## Uninstall Knative | ||
|
|
||
| ### Removing the Knative Serving component | ||
|
|
||
| Remove the Knative Serving CR: | ||
|
|
||
| ``` | ||
| kubectl delete KnativeServing knative-serving -n knative-serving | ||
| ``` | ||
|
|
||
| Knative Serving operator prevents unsafe removal of Knative serving resources. Even if the operator CR is successfully | ||
| removed, all the CRDs in Knative Serving are still kept in the cluster. All your resources relying on Knative CRDs | ||
| can still work. | ||
|
|
||
| ### Removing the Knative Serving Operator: | ||
|
|
||
| If you have installed Knative Serving using the Release page, remove the operator using the following command: | ||
|
|
||
| ``` | ||
| kubectl delete -f https://github.com/knative/serving-operator/releases/download/v0.13.0/serving-operator.yaml | ||
| ``` | ||
|
|
||
| If you have installed Knative Serving from source, uninstall it using the following command while in the root directory | ||
| for the source: | ||
|
|
||
| ``` | ||
| ko delete -f config/ | ||
| ``` | ||
|
|
||
| ### Removing Knative Eventing component | ||
|
|
||
| Remove the Knative Eventing CR: | ||
|
|
||
| ``` | ||
| kubectl delete KnativeEventing knative-eventing -n knative-eventing | ||
| ``` | ||
|
|
||
| Knative Eventing operator also prevents unsafe removal of Knative Eventing resources by keeping the Knative Eventing CRDs. | ||
|
|
||
| ### Removing Knative Eventing Operator: | ||
|
|
||
| If you have installed Knative Eventing using the Release page, remove the operator using the following command: | ||
|
|
||
| ``` | ||
| kubectl delete -f https://github.com/knative/eventing-operator/releases/download/v0.13.0/eventing-operator.yaml | ||
| ``` | ||
|
|
||
| If you have installed Knative Eventing from source, uninstall it using the following command while in the root directory | ||
| for the source: | ||
|
|
||
| ``` | ||
| ko delete -f config/ | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be
{{< version >}}to auto-substitute in the release version, IIRC.Even better, there is an
{{< artifact >}}tag, like so:I'll send this as a PR on the upstream docs, so this is mostly FYI.