Creating an Azure cluster is a straightforward process that can be completed through the Azure portal. You can also use the Azure CLI or PowerShell to create a cluster.
To start, you'll need to choose the correct region for your cluster. This is crucial because it determines the location of your cluster's resources.
Choose a suitable virtual machine size for your cluster, considering factors like performance and cost.
You can select from various virtual machine sizes, including Standard_DS2_v2, Standard_DS3_v2, and Standard_DS4_v2.
Azure Cluster Basics
When creating an Azure Kubernetes cluster, you'll need to set up some basic information. This includes selecting your subscription and resource group.
You'll need to enter a unique name for your cluster within the selected resource group. This name will be used to generate a unique fully qualified domain name (FQDN) for your cluster.
The region where your cluster will be deployed is also crucial. This will determine the location of your cluster and should be selected carefully.
For the Kubernetes version, it's recommended to select one of the newest versions to avoid having to upgrade your cluster by multiple versions later.
The DNS name prefix should be prefilled from the name you entered, but you're free to change it if needed.
You'll need to select a node size for the primary node pool, which will directly affect the initial size of your Kubernetes cluster. For testing, consider using a smaller instance size like B2s.
Cluster Configuration
To configure kubectl for your Azure Kubernetes cluster, you'll need to install it first, either from a binary or using the Azure CLI.
The Azure CLI provides a convenient way to install and set up kubectl for AKS clusters.
You can use the get-credentials command from the Azure CLI to set up your local kubectl configuration.
Replace MyCluster with the name of your cluster and MyResourceGroup with the name of the resource group your cluster is deployed in.
If you have multiple Kubernetes clusters in your local configuration, you can specify the optional parameter --context to explicitly set the name of the context that will be created in your kubectl configuration.
It will default to using the cluster name if you don't specify the context name.
Once you've set up your local kubectl configuration, you can verify it's the correct cluster by using the get nodes command.
Monitoring and Management
AKS includes node CPU and memory monitoring at no additional cost.
You can optionally enable container monitoring at cluster creation, which sends additional container metrics and logs using Log Analytics, a service with fees based on the amount of data ingested.
With container monitoring enabled, you can view CPU and memory usage per node, controller, or pod, and create alerts with Azure Monitor that aren't available otherwise.
A Prometheus integration with container insights is also in public beta, which can help close the gap on monitoring for many use cases.
CPU, Memory, and Container Monitoring
Monitoring your Azure Kubernetes Service (AKS) cluster is crucial for its performance and security. AKS includes node CPU and memory monitoring at no additional cost.
Enabling container monitoring allows you to view CPU and memory usage per node, controller, or pod. This feature sends additional container metrics and logs using Log Analytics.
With container monitoring enabled, you can create alerts with Azure Monitor that aren't available otherwise. This helps you stay on top of potential issues before they become major problems.
Azure Monitor can also help you view metrics, giving you a deeper understanding of your cluster's performance. The Prometheus integration with container insights is in public beta, which can help close the monitoring gap for many use cases.
To get started with monitoring, simply enable container monitoring and select or create a log analytics workspace to store your AKS data.
Reviewing and Saving
Reviewing your AKS cluster takes just a few clicks. You can view your cluster from the Kubernetes services list UI after cluster creation is done, which can take as long as 15 minutes.
To review your cluster, you'll need to validate its status. Ensure the Cluster Status field displays the value Running.
To do this, you can follow these steps:
- Log in to Palette.
- Ensure you are in the correct project scope.
- From the left Main Menu, select Clusters.
- Select the Azure AKS cluster you deployed to review its details.
Once you've validated your cluster's status, you can rest assured that it's running smoothly.
Security and Access
Securing your Azure cluster is crucial, especially when running production workloads. A secure cluster is your responsibility, and it's especially important when you're running production workloads on the cluster.
You can secure your cluster by using client-to-node security, which authenticates clients and helps secure communication between a client and individual nodes in the cluster. This type of security helps ensure that only authorized users can access the cluster and the applications that are deployed on the cluster.
To authenticate clients, you can use X.509 certificate security credentials or Microsoft Entra ID. Additionally, you can use Azure role-based access control (Azure RBAC) to assign fine-grained access controls on Azure resources and limit access to certain cluster operations for different groups of users.
Here are some key points to keep in mind when securing your Azure cluster:
- Client certificates can be used to authenticate admin or user clients with the cluster.
- Microsoft Entra ID can also be configured to authenticate clients with the cluster.
- Azure RBAC allows you to assign different access rules to subscriptions, resource groups, and resources.
Managed
Managed clusters in Azure Kubernetes Service (AKS) offer a range of benefits, including the ability to easily create, maintain, scale, and monitor your AKS cluster.
The Check Point Cluster template automatically deploys the Virtual Machine with a system-assigned managed identity and assigns a Contributor role to the Cluster resource group, eliminating the need to create your own service principal.
AKS integrates seamlessly with Active Directory to manage AKS cluster access, allowing you to configure the service principal and delegate access to other Azure resources.
To enable role-based access control in the cluster, you should always enable RBAC, even for test or dev clusters.
Here are some key facts to keep in mind about managed identities in AKS:
- Service principals never expire.
- Deleting the Cluster Member's Virtual Machine deletes the credentials.
- We recommend using the default managed identity as a best practice.
Managed clusters follow their own Kubernetes version support policy, and you can find the supported versions in your cluster's location using the Azure portal or CLI.
Authentication in
Authentication in Service Fabric is a crucial aspect of security. It ensures that only authorized users can access and manage the cluster.
To secure a cluster, you need to use X.509 certificates, which provide cluster and server authentication. Self-signed certificates are acceptable for test clusters, but a certificate from a trusted certificate authority is recommended for production clusters.
Client-to-node security is another important aspect of authentication in Service Fabric. It authenticates clients and secures communication between a client and individual nodes in the cluster. Clients are uniquely identified through their X.509 certificate security credentials.
The following table summarizes the different types of authentication in Service Fabric:
Azure Credentials and the Automatic Service Principal are also used for authentication in Service Fabric. The Check Point Cluster template automatically deploys the Virtual Machine with a system-assigned managed identity and assigns a Contributor role to the Cluster resource group.
Service Fabric also supports access control to limit access to certain cluster operations for different groups of users. This helps make the cluster more secure. Two access control types are supported for clients that connect to a cluster: Administrator role and User role.
Load Balancing
Load Balancing is a crucial aspect of Azure Clusters, ensuring that traffic is distributed efficiently among VM instances. This is achieved through the use of Load Balancers, which are associated with public IP addresses and DNS labels.
The Load Balancer is a key component in routing traffic to VMs, whether it's for management or service traffic. It's also responsible for creating NAT rules to forward traffic to the right web server.
In Azure, you can configure the Load Balancer to listen on multiple public IP addresses, which is useful if you want to secure multiple web applications. This is done by allocating a new public IP address and adding a load balancing rule.
Here's an example of how to configure the Load Balancer to listen on a second public IP address:
The Load Balancer Conditions also play a crucial role in determining how traffic is routed to the right web server. This is achieved through the use of NAT rules, which are defined with the special Dynamic ObjectSpecial object type.
Here's an example of how the Load Balancer Conditions are set up:
Note that when Floating IP is enabled, the Original Destination should be set to the External Load Balancer Frontend IP Address.
Networking and Routing
To set up internal subnets and route tables in Azure, you can use the Azure portal or the CLI. This involves creating Azure routing tables with User-Defined Routes (UDRs) for each internal subnet.
You'll need to create the following routes for each subnet:
- A local route for the subnet's private address space (e.g., 10.0.3.0/24 for the Web subnet)
- A route to the entire Virtual Network (10.0.0.0/16)
- A default route to the Internet (0.0.0.0/0)
Here's an example of the routes you might create for the Web subnet:
Similarly, you'll need to create routes for the App subnet.
To configure routes on Cluster Members, you'll need to connect over SSH to each member and log in to Gaia Clish or Expert mode. Then, you can add a static route to the Virtual Network's private address space (e.g., 10.0.0.0/16) with a nexthop gateway address of 10.0.2.1.
Here's an example of the command you might use:
`set static-route 10.0.0.0/16 nexthop gateway address 10.0.2.1 on`
You'll also need to configure NAT rules to avoid NAT in the Virtual Network and to translate traffic between subnets. This involves creating automatic address translation rules for each subnet.
For example, you might create the following NAT rules:
To configure multiple VIPs, you'll need to edit the $FWDIR/conf/azure-ha.json file and add new VIPs to the "clusterNetworkInterfaces" field. Then, you can attach the new VIPs to the active member in the Azure portal and run the $FWDIR/scripts/azure_ha_cli.py restart command on both instances.
Components and Resources
A Service Fabric cluster on Azure is an Azure resource that uses and interacts with other Azure resources.
A cluster interacts with virtual machine scale sets, which are a way to manage multiple virtual machines as a single resource.
The cluster also uses virtual networks, which are a way to connect and manage Azure resources in a secure and organized way.
Load balancers are another important resource that the cluster interacts with, helping to distribute traffic and ensure high availability.
Storage accounts are also crucial, as each cluster node type is supported by an Azure storage account and managed disks.
Here are some of the key Azure resources that a Service Fabric cluster interacts with:
- VMs and virtual network cards
- Virtual machine scale sets
- Virtual networks
- Load balancers
- Storage accounts
- Public IP addresses
Scaling and Upgrades
Scaling your Azure cluster is a powerful feature that allows you to adapt to changing application demands. You can scale the cluster horizontally by changing the number of nodes or vertically by changing the resources of the nodes.
You can scale the cluster at any time, even when workloads are running on the cluster. This is great for handling increased application workload or network traffic.
AKS provides a unique feature called Virtual nodes that lets you schedule pods onto nodes you don't manage, paying per second of execution time. This can speed up scaling time since you don't have to wait for the cluster autoscaler to detect a capacity need and then wait for a VM to launch.
You can also use VM Scale Sets, which are the standard scaling option for AKS and don't incur any additional charges. This allows you to manage multiple node pools for your cluster so you can run different-sized instances simultaneously.
Scaling
Scaling is a critical aspect of managing your cluster resources. It allows you to adjust the number of nodes or resources to meet changing application demands.
You can scale your cluster horizontally by changing the number of nodes, or vertically by adjusting the resources of the nodes. This can be done at any time, even when workloads are running on the cluster.
Virtual nodes are a feature in AKS that lets you schedule pods onto nodes you don't manage, paying per second of execution time. This can speed up scaling time.
VM Scale Sets are the standard scaling option for AKS and don't incur any additional charges. You can use them to manage multiple node pools for your cluster, running different-sized instances simultaneously.
You can also scale your cluster vertically by changing the resources of the nodes, which can be useful for workloads with specific resource requirements. For example, you might have one node type for small, front-end VMs and another for large, back-end VMs.
Each node type is mapped to a virtual machine scale set, and you can independently scale each node type up or down. You can also change the OS SKU running on each cluster node or have different sets of ports open.
Upgrading
Upgrading your Azure Service Fabric cluster is a straightforward process.
You have control over how your cluster is upgraded, with Microsoft responsible for patching the underlying OS and performing Service Fabric runtime upgrades.
Microsoft can automatically upgrade your cluster to the latest runtime version when a new version is released.
Alternatively, you can choose to select a supported runtime version that you want to use.
Updating cluster configuration, such as certificates or application ports, is also possible.
For more information on the specifics of upgrading, be sure to read the relevant documentation.
Frequently Asked Questions
What is the difference between Azure instance and cluster?
Azure instances and clusters differ in scale, with instances having a single node and clusters having multiple nodes for more powerful training capabilities
What is the difference between a cluster and a node?
A cluster is a group of servers that work together to provide continuous service, while a node is an individual server within that cluster. Understanding the difference between a cluster and a node is crucial for designing and managing high-availability systems.
What is an Azure Kubernetes cluster?
An Azure Kubernetes cluster is a managed environment for deploying and managing containerized applications, simplifying the process of container orchestration. It's a cloud-based solution that offloads much of the operational overhead, making it easy to use for developers of all levels.
Sources
- https://www.bluematador.com/blog/creating-a-kubernetes-cluster-in-azure-kubernetes-service
- https://sc1.checkpoint.com/documents/IaaS/WebAdminGuides/EN/CP_CloudGuard_Network_for_Azure_HA_Cluster/Content/Topics-Azure-HA/Workflow.htm
- https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-azure-clusters-overview
- https://github.com/kubernetes-sigs/cluster-api-provider-azure
- https://docs.spectrocloud.com/clusters/public-cloud/azure/aks/
Featured Images: pexels.com