refactor: moved aks section to the specific file and expanded

This commit is contained in:
Michele Cereda
2023-09-14 22:41:26 +02:00
parent 72f0f8af7b
commit cbf731ea40
4 changed files with 129 additions and 48 deletions

View File

@@ -8,9 +8,56 @@ Managed Kubernetes solution offered by Azure.
1. [Troubleshooting](#troubleshooting)
1. [_Subnet XXX does not have enough capacity for YY IP addresses_ while updating the credentials for an existing Service Principal](#subnet-xxx-does-not-have-enough-capacity-for-yy-ip-addresses-while-updating-the-credentials-for-an-existing-service-principal)
1. [Further readings](#further-readings)
1. [Sources](#sources)
## TL;DR
```sh
# List the available AKS versions.
az aks get-versions --location 'location' -o 'table'
# Show the details of an AKS cluster.
az aks show -g 'resource_group_name' -n 'cluster_name'
# Get credentials for an AKS cluster.
az aks get-credentials \
--resource-group 'resource_group_name' --name 'cluster_name'
az aks get-credentials … --overwrite-existing --admin
# Wait for the cluster to be ready.
az aks wait --created --interval 10 --timeout 1800 \
-g 'resource_group_name' -n 'cluster_name'
# Move the cluster to its goal state *without* changing its configuration.
# Can be used to move out of a non succeeded state.
az aks update --resource-group 'resource_group_name' --name 'cluster_name' --yes
# Delete AKS clusters.
az aks delete -y -g 'resource_group_name' -n 'cluster_name'
# Validate an ACR is accessible from an AKS cluster.
az aks check-acr --acr 'acr_name' \
--resource-group 'resource_group_name' --name 'cluster_name'
az aks check-acr … --node-name 'node_name'
# Add a new AKS extensions.
az aks extension add --name 'k8s-extension'
# Show the details of an installed AKS extensions.
az aks extension show --name 'k8s-extension'
# List Kubernetes extensions of an AKS cluster.
az k8s-extension list --cluster-type 'managedClusters' \
--resource-group 'resource_group_name' --name 'cluster_name'
# List Flux configurations in an AKS cluster.
az k8s-configuration flux list --cluster-type 'managedClusters' \
--resource-group 'resource_group_name' --name 'cluster_name'
# Show the details of a Feature.
az feature show -n 'AKS-ExtensionManager' --namespace 'Microsoft.ContainerService'
```
## Troubleshooting
### _Subnet XXX does not have enough capacity for YY IP addresses_ while updating the credentials for an existing Service Principal
@@ -22,11 +69,25 @@ Make sure you have enough space in your cluster's Subnet for at least one new No
## Further readings
- [Kubernetes]
- [Update or rotate the credentials for an AKS cluster]
## Sources
All the references in the [further readings] section, plus the following:
- [`az aks` command reference][az aks reference]
<!--
References
-->
<!-- Upstream -->
[Update or rotate the credentials for an AKS cluster]: https://learn.microsoft.com/en-us/azure/aks/update-credentials
[az aks reference]: https://learn.microsoft.com/en-us/cli/azure/aks
[update or rotate the credentials for an aks cluster]: https://learn.microsoft.com/en-us/azure/aks/update-credentials
<!-- In-article sections -->
[further readings]: #further-readings
<!-- Knowledge base -->
[kubernetes]: ../kubernetes/README.md

View File

@@ -8,6 +8,7 @@ Queries (`az … --query …`) use the [JMESPath] query language for JSON.
1. [Installation](#installation)
1. [Extensions](#extensions)
1. [Pipelines](#pipelines)
1. [AKS](#aks)
1. [APIs](#apis)
1. [Further readings](#further-readings)
1. [Sources](#sources)
@@ -16,11 +17,11 @@ Queries (`az … --query …`) use the [JMESPath] query language for JSON.
```sh
# Install the CLI.
asdf plugin add 'azure-cli' && asdf install 'azure-cli' '2.43.0'
brew install 'azure-cli'
docker run -v "${HOME}/.azure:/root/.azure" 'mcr.microsoft.com/azure-cli:2.40.0'
pip install 'azure-cli'
pipx install 'azure-cli'
brew install 'azure-cli'
asdf plugin add 'azure-cli' && asdf install 'azure-cli' '2.43.0'
docker run -v "${HOME}/.azure:/root/.azure" 'mcr.microsoft.com/azure-cli:2.40.0'
# Disable certificates check upon connection.
# Use it for proxies with doubtful certificates.
@@ -264,47 +265,6 @@ az acr helm list -n 'acr_name' -s 'subscription_uuid_or_name' -o 'json' \
# Push a helm chart to an ACR.
az acr helm push -n 'acr_name' 'chart.tgz' --force
# List the available AKS versions.
az aks get-versions --location 'location' -o 'table'
# Show the details of an AKS cluster.
az aks show -g 'resource_group_name' -n 'cluster_name'
# Get credentials for an AKS cluster.
az aks get-credentials \
--resource-group 'resource_group_name' --name 'cluster_name'
az aks get-credentials … --overwrite-existing --admin
# Wait for the cluster to be ready.
az aks wait --created --interval 10 --timeout 1800 \
-g 'resource_group_name' -n 'cluster_name'
# Move the cluster to its goal state *without* changing its configuration.
# Can be used to move out of a non succeeded state.
az aks update --resource-group 'resource_group_name' --name 'cluster_name' --yes
# Delete AKS clusters.
az aks delete -y -g 'resource_group_name' -n 'cluster_name'
# Validate an ACR is accessible from an AKS cluster.
az aks check-acr --acr 'acr_name' \
--resource-group 'resource_group_name' --name 'cluster_name'
az aks check-acr … --node-name 'node_name'
# Add a new AKS extensions.
az aks extension add --name 'k8s-extension'
# Show the details of an installed AKS extensions.
az aks extension show --name 'k8s-extension'
# List Kubernetes extensions of an AKS cluster.
az k8s-extension list --cluster-type 'managedClusters' \
--resource-group 'resource_group_name' --name 'cluster_name'
# List Flux configurations in an AKS cluster.
az k8s-configuration flux list --cluster-type 'managedClusters' \
--resource-group 'resource_group_name' --name 'cluster_name'
# List the available Features in a Subscription.
az feature list
@@ -469,7 +429,11 @@ az config set 'extension.run_after_dynamic_install=no'
## Pipelines
See [devops].
See [DevOps].
## AKS
See [AKS].
## APIs
@@ -523,7 +487,6 @@ All the references in the [further readings] section, plus the following:
- [How to manage Azure subscriptions with the Azure CLI]
- [Authenticate with an Azure container registry]
- [Remove a member]
- [`az aks` command reference][az aks reference]
- [Create and manage Azure Pipelines from the command line]
<!--
@@ -532,7 +495,6 @@ All the references in the [further readings] section, plus the following:
<!-- Upstream -->
[authenticate with an azure container registry]: https://learn.microsoft.com/en-us/azure/container-registry/container-registry-authentication?tabs=azure-cli
[az aks reference]: https://learn.microsoft.com/en-us/cli/azure/aks
[az reference]: https://learn.microsoft.com/en-us/cli/azure/reference-index
[get started with azure cli]: https://learn.microsoft.com/en-us/cli/azure/get-started-with-azure-cli
[how to manage azure subscriptions with the azure cli]: https://learn.microsoft.com/en-us/cli/azure/manage-azure-subscriptions-azure-cli
@@ -545,6 +507,7 @@ All the references in the [further readings] section, plus the following:
[further readings]: #further-readings
<!-- Knowledge base -->
[aks]: aks.md
[az bicep]: bicep.md#tldr
[devops]: devops.md
[devops cli extension]: devops.md#tldr

24
knowledge base/gitops.md Normal file
View File

@@ -0,0 +1,24 @@
# The GitOps approach
Approach for implementing Continuous Deployment for cloud native applications.
The core idea is having a Git repository that contains **declarative** descriptions of the currently desired state of one or more environments, plus automated processes to make the environment match the described state in the repository.
## Table of contents <!-- omit in toc -->
1. [Further readings](#further-readings)
## Further readings
- [Website]
- [Flux]
<!--
References
-->
<!-- Upstream -->
[website]: https://www.gitops.tech/
<!-- Knowledge base -->
[flux]: kubernetes/flux.md

View File

@@ -0,0 +1,33 @@
# Flux
## Table of contents <!-- omit in toc -->
1. [TL;DR](#tldr)
1. [Further readings](#further-readings)
## TL;DR
```sh
# Check the extension is enabled.
kubectl -n 'flux-system' get extensionconfig 'fluxextension'
# Check the configuration is rolled out and properly configured.
kubectl -n 'default' get fluxconfig 'baseline-configuration'
```
## Further readings
- [Website]
- [Kubernetes]
- [The GitOps approach][gitops]
<!--
References
-->
<!-- Upstream -->
[website]: https://fluxcd.io/
<!-- Knowledge base -->
[gitops]: ../gitops.md
[kubernetes]: README.md