Change the document to install Knative Operator (#2419)

* Add the document to install All-In-One Knative Operator

* Add the description about Alpha phase for operators

* Rewrite the installation guide of Knative Operator

* Update the docs based on comments
This commit is contained in:
Vincent 2020-05-04 15:28:44 -04:00 committed by GitHub
parent 992620e24a
commit ab01ec5013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 66 additions and 105 deletions

View File

@ -1,55 +1,56 @@
--- ---
title: "Installing Knative components using Operators" title: "Installing Knative components using Operator"
weight: 10 weight: 10
type: "docs" type: "docs"
--- ---
Knative provides operators as tools to install, configure and manage Knative. This guide explains how to install and Knative provides an [operator](https://github.com/knative-sandbox/operator) as a tool to install, configure and manage Knative. The Knative operator leverages custom objects
uninstall Knative using Knative operators. in the cluster to define and manage the installed Knative software. This guide explains how to install and uninstall
Knative using Knative operator.
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 ## Before you begin
Knative installation using Operators requires the following: Knative installation using the Operator 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 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, 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 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. 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. - The Kubernetes cluster must be able to access the internet, since the Knative operator downloads images online.
- Istio: - Istio:
- [Download and install Istio](https://knative.dev/development/install/installing-istio/#downloading-istio-and-installing-crds). Go through all the 4 sub-steps. - [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). - [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: ## Limitations of Knative Operator:
Knative Operators use custom resources (CRs) to configure your Knative deployment. 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.
- Currently, the CRs included with Knative Operators do not provide high availability (HA) capabilities. ## Install Knative with the Knative Operator
- 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: You can find the release information of Knative Operator on the [Releases page](https://github.com/knative-sandbox/operator/releases).
Information about Knative Serving Operator releases can be found on the [Releases page](https://github.com/knative/serving-operator/releases). ### Installing the Knative Operator
### Installing the Knative Serving Operator
__From releases__: __From releases__:
Replace \<version\> with the latest version or the version you would like to install, and run the following command to Install the latest Knative operator with the following command:
install Knative Serving Operator:
``` ```
kubectl apply -f https://github.com/knative/serving-operator/releases/download/<version>/serving-operator.yaml kubectl apply -f {{< artifact org="knative-sandbox" repo="operator" file="operator.yaml" >}}
``` ```
__From source code__: __From source code__:
You can also install Knative Operators from source using `ko`. You can also install Knative Operator from source using `ko`.
1. Install the [ko](https://github.com/google/ko) build tool. 1. Install the [ko](https://github.com/google/ko) build tool.
1. Download the source code using the following command:
```
git clone https://github.com/knative-sandbox/operator.git
```
1. Install the operator in the root directory of the source using the following command: 1. Install the operator in the root directory of the source using the following command:
``` ```
@ -58,17 +59,17 @@ ko apply -f config/
### Verify the operator installation ### Verify the operator installation
Verify the installation of Knative Serving Operator using the command: Verify the installation of Knative Operator using the command:
``` ```
kubectl get deployment knative-serving-operator kubectl get deployment knative-operator
``` ```
If the operator is installed correctly, the deployment should show a `Ready` status. Here is a sample output: 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 NAME READY UP-TO-DATE AVAILABLE AGE
knative-serving-operator 1/1 1 1 19h knative-operator 1/1 1 1 19h
``` ```
### Track the log ### Track the log
@ -76,7 +77,7 @@ knative-serving-operator 1/1 1 1 19h
Use the following command to track the log of the operator: Use the following command to track the log of the operator:
``` ```
kubectl logs -f $(kubectl get pods -l name=knative-serving-operator -o name) kubectl logs -f deploy/knative-operator
``` ```
### Installing the Knative Serving component ### Installing the Knative Serving component
@ -109,61 +110,26 @@ is a sample output:
``` ```
NAME READY UP-TO-DATE AVAILABLE AGE NAME READY UP-TO-DATE AVAILABLE AGE
activator 1/1 1 1 19h activator 1/1 1 1 18s
autoscaler 1/1 1 1 19h autoscaler 1/1 1 1 18s
autoscaler-hpa 1/1 1 1 19h autoscaler-hpa 1/1 1 1 14s
controller 1/1 1 1 19h controller 1/1 1 1 18s
networking-istio 1/1 1 1 19h istio-webhook 1/1 1 1 12s
webhook 1/1 1 1 19h networking-istio 1/1 1 1 12s
webhook 1/1 1 1 17s
``` ```
## Install Knative Eventing with Operator: 3. Check the status of Knative Serving Custom Resource:
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__:
Replace \<version\> with the latest version or the version you would like to install, and run the following command to
install Knative Eventing Operator:
``` ```
kubectl apply -f https://github.com/knative/eventing-operator/releases/download/<version>/eventing-operator.yaml kubectl get KnativeServing knative-serving -n knative-serving
``` ```
__From source code__: If Knative Serving is successfully installed, you should see:
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/ NAME VERSION READY REASON
``` knative-serving <version number> True
### 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 ### Installing the Knative Eventing component
@ -196,11 +162,27 @@ is a sample output:
``` ```
NAME READY UP-TO-DATE AVAILABLE AGE NAME READY UP-TO-DATE AVAILABLE AGE
broker-controller 1/1 1 1 42h broker-controller 1/1 1 1 63s
eventing-controller 1/1 1 1 42h broker-filter 1/1 1 1 62s
eventing-webhook 1/1 1 1 42h broker-ingress 1/1 1 1 62s
imc-controller 1/1 1 1 42h eventing-controller 1/1 1 1 67s
imc-dispatcher 1/1 1 1 42h 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
```
3. Check the status of Knative Eventing Custom Resource:
```
kubectl get KnativeEventing knative-eventing -n knative-eventing
```
If Knative Eventing is successfully installed, you should see:
```
NAME VERSION READY REASON
knative-eventing <version number> True
``` ```
## Uninstall Knative ## Uninstall Knative
@ -213,27 +195,6 @@ Remove the Knative Serving CR:
kubectl delete KnativeServing knative-serving -n knative-serving 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/<version>/serving-operator.yaml
```
Replace <version> with the version number of Knative Serving you have installed.
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 ### Removing Knative Eventing component
Remove the Knative Eventing CR: Remove the Knative Eventing CR:
@ -242,19 +203,19 @@ Remove the Knative Eventing CR:
kubectl delete KnativeEventing knative-eventing -n knative-eventing 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. Knative operator prevents unsafe removal of Knative resources. Even if the Knative Serving and Knative Eventing CRs are
successfully removed, all the CRDs in Knative are still kept in the cluster. All your resources relying on Knative CRDs
can still work.
### Removing Knative Eventing Operator: ### Removing the Knative Operator:
If you have installed Knative Eventing using the Release page, remove the operator using the following command: If you have installed Knative using the Release page, remove the operator using the following command:
``` ```
kubectl delete -f https://github.com/knative/eventing-operator/releases/download/<version>/eventing-operator.yaml kubectl delete -f {{< artifact org="knative-sandbox" repo="operator" file="operator.yaml" >}}
``` ```
Replace <version> with the version number of Knative Eventing you have installed. If you have installed Knative from source, uninstall it using the following command while in the root directory
If you have installed Knative Eventing from source, uninstall it using the following command while in the root directory
for the source: for the source:
``` ```