|
1 | 1 | ---
|
2 | 2 | title: Certificate Rotation in Azure Kubernetes Service (AKS)
|
3 |
| -description: Learn certificate rotation in an Azure Kubernetes Service (AKS) cluster. |
| 3 | +description: Learn about certificate rotation in an Azure Kubernetes Service (AKS) cluster. |
| 4 | +author: tamram |
| 5 | + |
| 6 | +ms.author: tamram |
4 | 7 | ms.topic: article
|
5 | 8 | ms.subservice: aks-security
|
6 | 9 | ms.custom: devx-track-azurecli
|
7 |
| -ms.date: 01/19/2023 |
| 10 | +ms.date: 06/05/2024 |
8 | 11 | ---
|
9 | 12 |
|
10 | 13 | # Certificate rotation in Azure Kubernetes Service (AKS)
|
11 | 14 |
|
12 |
| -Azure Kubernetes Service (AKS) uses certificates for authentication with many of its components. RBAC-enabled clusters created after March 2022 are enabled with certificate auto-rotation. You may need to periodically rotate those certificates for security or policy reasons. For example, you may have a policy to rotate all your certificates every 90 days. |
| 15 | +Azure Kubernetes Service (AKS) uses certificates for authentication with many of its components. Clusters with Azure role-based access control (Azure RBAC) that were created after March 2022 are enabled with certificate auto-rotation. You may need to periodically rotate those certificates for security or policy reasons. For example, you may have a policy to rotate all your certificates every 90 days. |
13 | 16 |
|
14 | 17 | > [!NOTE]
|
15 |
| -> Certificate auto-rotation is *only* enabled by default for RBAC enabled AKS clusters. |
| 18 | +> Certificate auto-rotation is enabled by default only for RBAC-enabled AKS clusters. |
16 | 19 |
|
17 | 20 | This article shows you how certificate rotation works in your AKS cluster.
|
18 | 21 |
|
@@ -66,15 +69,15 @@ Microsoft maintains all certificates mentioned in this section, except for the c
|
66 | 69 | az vm run-command invoke --resource-group MC_rg_myAKSCluster_region --name vm-name --command-id RunShellScript --query 'value[0].message' -otsv --scripts "openssl x509 -in /etc/kubernetes/certs/apiserver.crt -noout -enddate"
|
67 | 70 | ```
|
68 | 71 |
|
69 |
| -### Check Virtual Machine Scale Set agent node certificate expiration date |
| 72 | +### Check certificate expiration for the virtual machine scale set agent node |
70 | 73 |
|
71 |
| -* Check the expiration date of the Virtual Machine Scale Set agent node certificate using the `az vm run-command invoke` command. |
| 74 | +* Check the expiration date of the virtual machine scale set agent node certificate using the `az vm run-command invoke` command. |
72 | 75 |
|
73 | 76 | ```azurecli-interactive
|
74 | 77 | az vmss run-command invoke --resource-group "MC_rg_myAKSCluster_region" --name "vmss-name" --command-id RunShellScript --instance-id 1 --scripts "openssl x509 -in /etc/kubernetes/certs/apiserver.crt -noout -enddate" --query "value[0].message"
|
75 | 78 | ```
|
76 | 79 |
|
77 |
| -## Certificate Auto Rotation |
| 80 | +## Certificate auto-rotation |
78 | 81 |
|
79 | 82 | For AKS to automatically rotate non-CA certificates, the cluster must have [TLS Bootstrapping](https://kubernetes.io/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/), which is enabled by default in all Azure regions.
|
80 | 83 |
|
@@ -103,7 +106,7 @@ For any AKS clusters created or upgraded after March 2022, Azure Kubernetes Serv
|
103 | 106 | ## Manually rotate your cluster certificates
|
104 | 107 |
|
105 | 108 | > [!WARNING]
|
106 |
| -> Rotating your certificates using `az aks rotate-certs` recreates all of your nodes, Virtual Machine Scale Sets and Disks and can cause up to *30 minutes of downtime* for your AKS cluster. |
| 109 | +> Rotating your certificates using `az aks rotate-certs` recreates all of your nodes, virtual machine scale sets, and disks and can cause up to *30 minutes of downtime* for your AKS cluster. |
107 | 110 |
|
108 | 111 | 1. Connect to your cluster using the [`az aks get-credentials`][az-aks-get-credentials] command.
|
109 | 112 |
|
@@ -149,7 +152,7 @@ For any AKS clusters created or upgraded after March 2022, Azure Kubernetes Serv
|
149 | 152 |
|
150 | 153 | ## Next steps
|
151 | 154 |
|
152 |
| -This article showed you how to automatically rotate your cluster certificates, CAs, and SAs. For more information, see [Best practices for cluster security and upgrades in Azure Kubernetes Service (AKS)][aks-best-practices-security-upgrades]. |
| 155 | +This article showed you how to manually and automatically rotate your cluster certificates, CAs, and SAs. For more information, see [Best practices for cluster security and upgrades in Azure Kubernetes Service (AKS)][aks-best-practices-security-upgrades]. |
153 | 156 |
|
154 | 157 | <!-- LINKS - internal -->
|
155 | 158 | [azure-cli-install]: /cli/azure/install-azure-cli
|
|
0 commit comments