How to Create an AKS Cluster with Kubenet¶
WHAT TO EXPECT
In this section, users will learn how to deploy an AKS Cluster with Kubenet as the default network plugin.
Creating an AKS Cluster¶
cloudSwXtch VM Minimum Requirements
Before you start, ensure that your cloudSwXtch has met the following minimum requirements:
- Must have at least 4, preferably 8 cores.
- Must have at least 2 NICs. Both NICs must share a single subnet. The 2nd one must support accelerated networking.
- Must run one of the operating systems listed in cloudSwXtch System Requirements.
A cloudSwXtch must be created before you install the xNIC on the AKS Cluster. For more information on Azure cloudSwXtch installation, see: cloudSwXtch on Azure
Users will need two items in order to create the AKS Cluster with Kubenet: AZ CLI and kubectl.
AZ CLI comes installed on Azure Cloudshell, while kubectl can be either installed on your active Cloudshell session, or on any VM that you want to use for managing the K8s cluster.
Prior to running the script, ensure the following are already created in Azure:
- Azure Resource Group (must be the same as the one used to create the cloudSwXtch)
- Azure VNET (must be the same as the one used to create the cloudSwXtch)
- Azure Control Subnet (must be the same as the one used to create the cloudSwXtch)
Each of the components must match the one used to create the cloudSwXtch on Azure.
The cluster nodes must be able to reach the cloudSwXtch control IP on TCP 9443 (control) and TCP 443 (the cloudSwXtch's xNIC image registry).
AKS with Kubenet CNI Creation¶
-
Log into the Azure Portal.
-
Open cloudshell as bash.

- Run the following command to download the kubectl binary:
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
-
Install AZ CLI by following instructions in the link: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli
-
Run the following script replacing the following:
-
: User-assigned name for AKS Cluster : Azure Resource Group : Azure VNET : Azure CONTROL Subnet
This is to install a simple 2-node AKS with Kubenet CNI.
export NAME="<cluster_name>"
export AZURE_RESOURCE_GROUP="<cloudswxtch_RG>"
# Get the Subnet id
export SUBNET_ID="$(az network vnet subnet show -g ${AZURE_RESOURCE_GROUP} -n <cloudswxtch_subnet> --vnet-name <cloudswxtch_vnet> --query id --output tsv)"
# Create AKS cluster
az aks create \
--generate-ssh-keys \
--resource-group "${AZURE_RESOURCE_GROUP}" \
--name "${NAME}" \
--vnet-subnet-id "${SUBNET_ID}" \
--node-vm-size Standard_Ds2_v2 \
--node-count 2
# Get the credentials to access the cluster with kubectl
az aks get-credentials --resource-group "${AZURE_RESOURCE_GROUP}" --name "${NAME}"
After executing the script with the replaced values, the AKS Cluster will be created. Users will get the following line as confirmation.
Note: The user in this example used the name "sample-kubenet" for their
- Confirm the cluster is available and reachable by running the following command:
Example Response¶
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* sample-kubenet sample-kubenet clusterUser_swxtch-bosch_sample-kubenet
$
Installing xNIC in Kubernetes Cluster
After creating an AKS Cluster with Kubenet CNI, continue on to Installing xNIC on Kubernetes Cluster for instructions on how to deploy an xNIC.