From cbf731ea408c4a42d5c3e5bd8b5a573a760c010b Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Thu, 14 Sep 2023 22:41:26 +0200 Subject: [PATCH] refactor: moved aks section to the specific file and expanded --- knowledge base/azure/aks.md | 63 ++++++++++++++++++++++++++++++- knowledge base/azure/cli.md | 57 +++++----------------------- knowledge base/gitops.md | 24 ++++++++++++ knowledge base/kubernetes/flux.md | 33 ++++++++++++++++ 4 files changed, 129 insertions(+), 48 deletions(-) create mode 100644 knowledge base/gitops.md create mode 100644 knowledge base/kubernetes/flux.md diff --git a/knowledge base/azure/aks.md b/knowledge base/azure/aks.md index d07a76c..8f77e97 100644 --- a/knowledge base/azure/aks.md +++ b/knowledge base/azure/aks.md @@ -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] + -[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 + + +[further readings]: #further-readings + + +[kubernetes]: ../kubernetes/README.md diff --git a/knowledge base/azure/cli.md b/knowledge base/azure/cli.md index aaa6285..b1397db 100644 --- a/knowledge base/azure/cli.md +++ b/knowledge base/azure/cli.md @@ -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] [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 +[aks]: aks.md [az bicep]: bicep.md#tldr [devops]: devops.md [devops cli extension]: devops.md#tldr diff --git a/knowledge base/gitops.md b/knowledge base/gitops.md new file mode 100644 index 0000000..4affe13 --- /dev/null +++ b/knowledge base/gitops.md @@ -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 + +1. [Further readings](#further-readings) + +## Further readings + +- [Website] +- [Flux] + + + + +[website]: https://www.gitops.tech/ + + +[flux]: kubernetes/flux.md diff --git a/knowledge base/kubernetes/flux.md b/knowledge base/kubernetes/flux.md new file mode 100644 index 0000000..a6b206c --- /dev/null +++ b/knowledge base/kubernetes/flux.md @@ -0,0 +1,33 @@ +# Flux + +## Table of contents + +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] + + + + +[website]: https://fluxcd.io/ + + +[gitops]: ../gitops.md +[kubernetes]: README.md