Catégorie : Azure (Page 53 of 112)

AKS | Azure Spot Instances

[English below]

Salut,

Dans cet article, nous allons voir ensemble comment créer un cluster AKS utilisant un pool de spot instances. L’intérêt est d’utiliser des instances de type spot afin de pouvoir bénéficier de puissance de calcul non utilisé par le fournisseur de cloud et ainsi obtenir un rabais important sur le prix de cette instance.

Azure ChannelsAzure Spot VMs Disponibilité
Enterprise AgreementYes
Pay As You GoYes
Cloud Service Provider (CSP)Contact your partner
BenefitsNot available
SponsoredNot available
Free TrialNot available

L’objectif de cet article est de vous présenter comment créer un pool d’instances de type spot pour vos workloads AKS qui sont non critiques. Au moment où j’écris cet article, cette fonctionnalité est encore en public preview et nous n’avons pas de SLA disponible pour les instances de type spot.

# - Create a Ressource Group
az group create --name aksspot --location eastus

# - Create an AKS cluster
az aks create --resource-group aksspot --name aksdemospot --node-vm-size Standard_A2_v2 --node-count 2 --generate-ssh-keys

# - Register Spotpoolpreview
az feature register --namespace "Microsoft.ContainerService" --name "spotpoolpreview"

az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/spotpoolpreview')].{Name:name,State:properties.state}"

# - Install the aks-preview extension
az extension add --name aks-preview
 
# - Update the extension to make sure you have the latest version installed
az extension update --name aks-preview

# - Add spot pool to an existing AKS Cluster
az aks nodepool add \
    --resource-group aksspot \
    --cluster-name aksdemospot \
    --name spotnodepool \
    --priority Spot \
    --eviction-policy Delete \
    --spot-max-price -1 \
    --enable-cluster-autoscaler \
    --node-vm-size Standard_D2_v3 \
    --min-count 1 \
    --max-count 3 \
    --no-wait

# - Show AKS NodePool
az aks nodepool show --resource-group aksspot --cluster-name aksdemospot --name spotnodepool

Dans cet exemple, vous avez pu constater que le paramètre « spot-max-price » est à « -1 ». Le prix maximal sera le prix actuel (au maximum, le prix des machines virtuelles standards). 

Vous pouvez tout à fait remplacer ce paramètre directement par le prix maximum que vous souhaitez payer. Par exemple pour 0.98765, vous vous engagez à payer au maximum un prix de 0.98765$USD par heure.

Si le prix de votre machine dépasse le prix définit, votre machine virtuelle sera supprimée « –eviction-policy Delete ». Dans le cas où vous ne souhaitez pas que celle-ci soit supprimée mais désallouée, vous pouvez remplacer « –eviction-policy Delete » par « eviction-policy Deallocate ».

Maxime.


Hello,

In this article, I am explaining how you can create an AKS cluster with a pool of spot instances. The principal advantage here is to use unallocated compute ressources with a low price.

Azure ChannelsAzure Spot VMs Availability
Enterprise AgreementYes
Pay As You GoYes
Cloud Service Provider (CSP)Contact your partner
BenefitsNot available
SponsoredNot available
Free TrialNot available

The goal of this article is to explain how to create a spot pool for your non critical workloads. This feature is available only in preview and we don’t have SLA support at the time I am writing this article.

# - Create a Ressource Group
az group create --name aksspot --location eastus

# - Create an AKS cluster
az aks create --resource-group aksspot --name aksdemospot --node-vm-size Standard_A2_v2 --node-count 2 --generate-ssh-keys

# - Register Spotpoolpreview
az feature register --namespace "Microsoft.ContainerService" --name "spotpoolpreview"

az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/spotpoolpreview')].{Name:name,State:properties.state}"

# - Install the aks-preview extension
az extension add --name aks-preview

# - Update the extension to make sure you have the latest version installed
az extension update --name aks-preview

# - Add spot pool to an existing AKS Cluster
az aks nodepool add \
--resource-group aksspot \
--cluster-name aksdemospot \
--name spotnodepool \
--priority Spot \
--eviction-policy Delete \
--spot-max-price -1 \
--enable-cluster-autoscaler \
--node-vm-size Standard_D2_v3 \
--min-count 1 \
--max-count 3 \
--no-wait

# - Show AKS NodePool
az aks nodepool show --resource-group aksspot --cluster-name aksdemospot --name spotnodepool

In this example, the parameter « spot-max-price » is set to: « -1 ». The maximum price of this virtual machine will match the current price on the market.

If you want, you can replace this parameter by the maximum price you want to paid. For example, if you indicate 0.98765, in this case your maximum price will be 0.98765$USD per hour.

In the case of different prices, i.e. the maximum price is higher than the define one, your virtual machine will be deleted « –eviction-policy Delete ». If you don’t want to delete the virtual machine but only desallocate it, you can replace « –eviction-policy Delete » by « eviction-policy Deallocate ».

Maxime.

AKS | Webinar – 16 Security Best Practices for Azure Kubernetes Service

[English below]

Salut,

Aujourd’hui, j’ai eu le plaisir de donner une conférence en direct avec Microsoft Teams Live Event! J’étais accompagné de Mathieu Benoit, Cloud Architect chez Microsoft Canada.

Au programme, nous avons pu parcourir ensemble 16 bonnes pratiques de sécurité pour déployer et exploiter un cluster Azure Kubernetes Service (AKS) en toute sécurité.

Vous pouvez retrouver l’ensemble des slides ci-dessous:

Chargeur En cours de chargement…
Logo EAD Cela prend trop de temps ?

Recharger Recharger le document
| Ouvert Ouvrir dans un nouvel onglet

Un grand merci à nos nombreux participants et prenez soin de vous!

Maxime.


Hi,

Today, I’ve had the pleasure to give a live conference with Microsoft Team Live Event! My pleasure was shared with Mathieu Benoit, Cloud Architect at Microsoft Canada.

During this conference, we presented 16 security best practices to deploy and secure an Azure Kubernetes Service (AKS) cluster.

Please, find below the slides of this presentation:

Chargeur En cours de chargement…
Logo EAD Cela prend trop de temps ?

Recharger Recharger le document
| Ouvert Ouvrir dans un nouvel onglet

Thank you to all the attendees and stay safe!

Maxime.

AKS | Managed Identity GA

Hello,

Il y a quelques mois j’avais pu écrire un article le sujet des managed identity pour un cluster AKS. Je vous invite à consulter cette article si vous souhaitez avoir plus de détails AKS Cluster Managed Identity

Depuis le début du mois de Mars, cette fonctionnalité est désormais disponible en General Availability, c’est à dire que vous pouvez utiliser cette fonctionnalité avec vos clusters de productions.

Dans cet article, je vous propose de déployer un cluster AKS avec cette fonctionnalités.

# Create an Azure resource group 
az group create --name aksdemomsi --location canadacentral

# Create an AKS cluster with managed-identity
az aks create -g aksdemomsi -n aksmsi --enable-managed-identity

Si nous connectons sur un des nodes de notre cluster, nous pouvons constater que le service principal qui était « hard-coded » dans le fichier /etc/kubernetes/azure.json n’est plus présent.

root@aks-nodepool1-83146928-vmss000001:/host/etc/kubernetes# cat azure.json
{
"cloud":"AzurePublicCloud",
"tenantId": "00000000-0000-0000-0000-000000000000",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"aadClientId": "msi",
"aadClientSecret": "msi",
"resourceGroup": "MC_aksdemomsi_aksmsi_canadacentral",
"location": "canadacentral",
"vmType": "vmss",
"subnetName": "aks-subnet",
"securityGroupName": "aks-agentpool-83146928-nsg",
"vnetName": "aks-vnet-83146928",
"vnetResourceGroup": "",
"routeTableName": "aks-agentpool-83146928-routetable",
"primaryAvailabilitySetName": "",
"primaryScaleSetName": "aks-nodepool1-83146928-vmss",
"cloudProviderBackoffMode": "v2",
"cloudProviderBackoff": true,
"cloudProviderBackoffRetries": 6,
"cloudProviderBackoffDuration": 5,
"cloudProviderRatelimit": true,
"cloudProviderRateLimitQPS": 10,
"cloudProviderRateLimitBucket": 100,
"cloudProviderRatelimitQPSWrite": 10,
"cloudProviderRatelimitBucketWrite": 100,
"useManagedIdentityExtension": true,
"userAssignedIdentityID": "9a9eb45f-5464-433d-ba76-ba5f9922fe2d",
"useInstanceMetadata": true,
"loadBalancerSku": "Standard",
"disableOutboundSNAT": false,
"excludeMasterFromStandardLB": true,
"providerVaultName": "",
"maximumLoadBalancerRuleCount": 250,
"providerKeyName": "k8s",
"providerKeyVersion": ""
}

On peut également constater la présence d’un nouvel objet Managed Identity dans notre ressource group:

Maxime.

« Older posts Newer posts »

© 2025 ZiGMaX IT Blog

Theme by Anders NorenUp ↑