Install on Azure Kubernetes Service (AKS)

Before you begin

Knative requires a Kubernetes cluster v1.11 or newer. kubectl v1.10 is also
required. This guide walks you through creating a cluster with the correct
specifications for Knative on Azure Kubernetes Service (AKS).

This guide assumes you are using bash in a Mac or Linux environment; some
commands will need to be adjusted for use in a Windows environment.

Installing the Azure CLI

If you already have azure cli version 2.0.41 or later installed, you can
skip to the next section and install kubectl

Install az by following the instructions for your operating system. See the
full installation instructions
if yours isn’t listed below. You will need az cli version 2.0.37 or greater.

Installing kubectl

If you already have kubectl, run kubectl version to check your client
version. If you have kubectl v1.10 installed, you can skip to the next
section and create an AKS cluster

az aks install-cli

Cluster Setup

Now that we have all the tools, we need a Kubernetes cluster to install Knative.

Configure your Azure account

First let’s identify your Azure subscription and save it for use later.

Run az login and follow the instructions in the command output to authorize
az to use your account

List your Azure subscriptions:

az account list -o table

Create a Resource Group for AKS

To simplify the command lines for this walkthrough, we need to define a few
environment variables. First determine which region you’d like to run AKS in,
along with the resource group you’d like to use.

Create a resource group with the az cli using the following command if you
are using a new resource group.

az group create --name $RESOURCE_GROUP --location $LOCATION

Create a Kubernetes cluster using AKS

Next we will create a managed Kubernetes cluster using AKS. To make sure the
cluster is large enough to host all the Knative and Istio components, the
recommended configuration for a cluster is:

Kubernetes version 1.11 or later

Three or more nodes

Standard_DS3_v2 nodes

RBAC enabled

Enable AKS in your subscription, use the following command with the az cli:
bash az provider register -n Microsoft.ContainerService You should also
ensure that the Microsoft.Compute and Microsoft.Network providers are
registered in your subscription. If you need to enable them:
bash az provider register -n Microsoft.Compute az provider register -n Microsoft.Network

Installing Istio

If you prefer to install Istio manually, if your cloud provider doesn’t offer a
managed Istio installation, or if you’re installing Knative locally using
Minkube or similar, see the
Installing Istio for Knative guide.

You must install Istio on your Kubernetes cluster before continuing with these
instructions to install Knative.

Installing Knative

If you are upgrading from Knative 0.3.x: Update your domain and static IP
address to be associated with the LoadBalancer istio-ingressgateway instead
of knative-ingressgateway. Then run the following to clean up leftover
resources:
```

If you have the Knative Eventing Sources component installed, you will also
need to delete the following resource before upgrading:

kubectl delete statefulset/controller-manager -n knative-sources

While the deletion of this resource during the upgrade process will not
prevent modifications to Eventing Source resources, those changes will not be
completed until the upgrade process finishes.
1. To install Knative, first install the CRDs by running the `kubectl apply`
command once with the `--selector knative.dev/crd-install=true` flag. This
prevents race conditions during the install, which cause intermittent errors:
```bash
kubectl apply --selector knative.dev/crd-install=true \
--filename https://github.com/knative/serving/releases/download/v0.8.0/serving.yaml \
--filename https://github.com/knative/eventing/releases/download/v0.8.0/release.yaml \
--filename https://github.com/knative/serving/releases/download/v0.8.0/monitoring.yaml

To complete the install of Knative and its dependencies, run the
kubectl apply command again, this time without the
--selector knative.dev/crd-install=true flag, to complete the install of
Knative and its dependencies: