This step explains how to set up your shell environment and create a Microsoft® Azure Kubernetes Service (AKS) cluster suitable for testing Apigee hybrid.
Set up your terminal shell
Be sure you have the
Azure CLI (az) and kubectl
tool installed in your local shell. The Azure CLI
tool provides the primary command-line interface for Azure, and
kubectl provides the primary
command-line interface for running commands against Kubernetes clusters.
Create a resource group
Create a resource group either using Azure console or with the Azure CLI using the following command:
az group create --name my-hybrid-rg --location eastus
Create a virtual network
Create a virtual network with a non-conflicting CIDR range.
az network vnet create \ --name vnet-name \ --resource-group my-hybrid-rg \ --address-prefixes vnet-address-range \ --subnet-name vnet-subnet-name \ --subnet-prefix subnet-address-range
az network vnet create \ --name my-hybrid-rg-vnet \ --resource-group my-hybrid-rg \ --address-prefixes 184.108.40.206/14 \ --subnet-name my-hybrid-rg-vnet-subnet \ --subnet-prefix 220.127.116.11/16
my-hybrid-rgis the name of the virtual network.
vnet-address-rangeis a list of address blocks reserved for this virtual network in CIDR notation.
vnet-subnet-nameis the name of the subnet within the virtual network.
subnet-address-rangeis a list of address blocks reserved for this subnet in CIDR notation.
Create an AKS cluster
In this step, you will create an AKS cluster.
- Open the Microsoft® Azure Portal.
- Click Kubernetes services.
- Create a cluster with the following minimum configuration settings.
Recommended minimum storage: Review the AKS disk specifications and choose a storage volume size based on your IOPs and cost requirements.
Tab Attribute Value Basics Subscription Your subscription name Resource group The resource group you created previously Region The region you specified previously. For example: (US) East US Kubernetes cluster name The name of the cluster. For example:
Kubernetes version Choose version 1.16.x or a later version DNS name prefix The DNS name prefix. For example:
Node count 3 Node size DS3 Standard Scale Virtual nodes Disabled VM scale sets Enabled Authentication Enable RBAC Yes Service principal Default Networking HTTP application routing No Load balancer Standard Network configuration Azure CNI Virtual network The virtual network name. You can select the virtual network you created previously, or create a new one by clicking the Create new link. For example:
Cluster subnet Example:
Kubernetes service address range The service address range. Be sure to use a non-competing address range. For example:
Kubernetes DNS service IP address For example:
Docker Bridge address For example:
Monitoring Enable container monitoring Yes Log Analytics workspace For example:
- Click Review and Create.
- When the cluster creation completes, go to the next step.
Set cluster credentials
Add the Kubernetes cluster credentials for the newly created cluster using the following command if not already added:
az aks get-credentials --resource-group my-hybrid-rg --name my-hybrid-aks-cluster
Set the current context
A context is a group of access parameters. Each context contains a Kubernetes cluster,
a user, and a namespace. The current context is the cluster that is currently the default for
kubectl commands run against that cluster.
Make sure the current context is set to the cluster you just created using the following command:
kubectl config current-context my-hybrid-aks-cluster-context
If the context is not set to your cluster as expected, follow these steps to change it:
- List all the contexts to determine which is the current context. In the
following example, the context is set to the
kubectl config get-contexts CURRENT NAME CLUSTER AUTHINFO my-hybrid-aks-cluster my-hybrid-aks-cluster clusterUser_my-hybrid-rg2_myhybrid-aks-cluster * my-hybrid-aks-ext01 my-hybrid-aks-ext01 clusterUser_my-hybrid-rg_my-hybrid-aks-ext01
- If necessary, set the current context to the cluster you just created (the cluster
into which you intend to install Apigee hybrid). Assuming the previous
get-contextsoutput, if the cluster name you created were
my-hybrid-aks-cluster, you would switch to the
my-hybrid-aks-clustercontext, as follows:
kubectl config use-context my-hybrid-aks-cluster
my-hybrid-aks-clusteris the name of the cluster context to switch to.
You now have a Kubernetes cluster running in AKS. Your shell environment is set up, and you are ready to install the Apigee hybrid runtime software on your local machine.