<!-- Space: CLDCOE -->
<!-- Parent: NIQ Managed Actions -->
<!-- Type: page -->
<!-- Layout: article -->
# akskubeconfig
<!-- Include: disclaimer.tmpl -->
<!-- Include: ac:toc -->
A utility to generate a kubeconfig file for all AKS clusters in one or more Azure subscriptions.
## Why
Managing and updating a Kubernetes configuration file for AKS clusters can be a
nightmare when you manage multiple clusters across multiple subscriptions. This
tool aims to simplify the process by generating a kubeconfig file for all AKS
clusters that you have access to in all subscriptions that you have access to.
While checking all subscriptions is default behavior, you can also specify a
list of subscriptions to check. This can be useful if you have access to a large
number of subscriptions and only want to check a subset of them.
It also supports generating that kubeconfig file using a number of different
authentication flows, including:
- Default (using the default authentication flow)
- Device Flow (using the device flow authentication flow)
- Interactive (using the interactive web browser authentication flow)
- Service Principal Secret (using a service principal secret to authenticate)
- Service Principal PFX (using a service principal pfx certificate to authenticate)
- Managed Identity (using a managed identity to authenticate)
- Managed Identity ID (using a managed identity to authenticate)
- Azure CLI (using the Azure CLI to authenticate)
- Workload Identity (using a workload identity to authenticate)
This can be useful for a number of reasons, such as generating a bulk kubeconfig
file on-the-fly for CI/CD pipelines, or for generating a kubeconfig file for a
specific cluster in a specific subscription.
## Installation
`akskubeconfig` is implemented in Python. Assuming you have a
Python interpreter and pip installed you should be able to install with:
```shell
pip install akskubeconfig
```
> This has not yet been widely tested and is currently in a _works on my
machine_ state.
## Usage
The simplest usage is to just run the tool and specify an output file for it to write to:
```shell
akskubeconfig -o ~/.kube/config
```
This will generate a set of schemas in a `schemas` directory. The tool
provides a number of options to modify the output:
```shell
akskubeconfig --help
usage: akskubeconfig [-h] [-v] [-s SUBSCRIPTIONS] [--client-id CLIENT_ID] [--tenant-id TENANT_ID] [--client-secret CLIENT_SECRET] [--certificate-path CERTIFICATE_PATH]
[--server-id SERVER_ID] [--environment ENVIRONMENT]
[--default | --device-flow | --interactive | --sp-secret | --sp-pfx | --managed-identity | --managed-identity-id | --az-cli | --workload-identity --json | --yaml]
[-m MAX_THREADS] [-o OUTFILE]
options:
-h, --help show this help message and exit
-v, --verbose Increase output verbosity
-s SUBSCRIPTIONS, --subscriptions SUBSCRIPTIONS
A comma separated list of subscription to use. If omitted, all subscriptions will be checked.
--client-id CLIENT_ID
Override the client id to write into the kubeconfig. Only applicable if required by the selected authentication flow.
--tenant-id TENANT_ID
Override the tenant id to write into the kubeconfig. Only applicable if required by the selected authentication flow.
--client-secret CLIENT_SECRET
Override the client secret to write into the kubeconfig. Only applicable if required by the selected authentication flow.
--certificate-path CERTIFICATE_PATH
Override the certificate path to write into the kubeconfig. Only applicable if required by the selected authentication flow.
--server-id SERVER_ID
Override the server id to write into the kubeconfig.
--environment ENVIRONMENT
Override the environment to write into the kubeconfig.
--default Use the default flow authenticate within the generated kubeconfig (default)
--device-flow Use device flow to authenticate within the generated kubeconfig
--interactive Use the interactive web browser flow to authenticate within the generated kubeconfig
--sp-secret Use a service principal secret to authenticate within the generated kubeconfig
--sp-pfx Use a service principal pfx certificate to authenticate within the generated kubeconfig
--managed-identity Use a managed identity to authenticate within the generated kubeconfig
--managed-identity-id
Use a managed identity to authenticate within the generated kubeconfig
--az-cli Use the Azure CLI to authenticate within the generated kubeconfig
--workload-identity Use a workload identity to authenticate within the generated kubeconfig
--json Output as JSON
--yaml Output as YAML (default)
-m MAX_THREADS, --max-threads MAX_THREADS
Maximum number of threads to use
-o OUTFILE, --outfile OUTFILE
Output file
```
<!-- Include: footer.tmpl -->
Raw data
{
"_id": null,
"home_page": "https://github.com/niq-ccoe-platform-engineering/akskubeconfig",
"name": "akskubeconfig",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "aks, kubeconfig, kubernetes",
"author": "Cameron Larsen",
"author_email": "cameron.larsen@nielseniq.com",
"download_url": "https://files.pythonhosted.org/packages/4e/1a/298b3909206c64502d085ff8f00804e0f61d208962ed5cf31091cfc2dd3a/akskubeconfig-1.0.5.tar.gz",
"platform": null,
"description": "<!-- Space: CLDCOE -->\n<!-- Parent: NIQ Managed Actions -->\n<!-- Type: page -->\n<!-- Layout: article -->\n# akskubeconfig\n<!-- Include: disclaimer.tmpl -->\n<!-- Include: ac:toc -->\n\nA utility to generate a kubeconfig file for all AKS clusters in one or more Azure subscriptions.\n\n## Why\n\nManaging and updating a Kubernetes configuration file for AKS clusters can be a\nnightmare when you manage multiple clusters across multiple subscriptions. This\ntool aims to simplify the process by generating a kubeconfig file for all AKS\nclusters that you have access to in all subscriptions that you have access to.\n\nWhile checking all subscriptions is default behavior, you can also specify a\nlist of subscriptions to check. This can be useful if you have access to a large\nnumber of subscriptions and only want to check a subset of them.\n\nIt also supports generating that kubeconfig file using a number of different\nauthentication flows, including:\n\n- Default (using the default authentication flow)\n- Device Flow (using the device flow authentication flow)\n- Interactive (using the interactive web browser authentication flow)\n- Service Principal Secret (using a service principal secret to authenticate)\n- Service Principal PFX (using a service principal pfx certificate to authenticate)\n- Managed Identity (using a managed identity to authenticate)\n- Managed Identity ID (using a managed identity to authenticate)\n- Azure CLI (using the Azure CLI to authenticate)\n- Workload Identity (using a workload identity to authenticate)\n\nThis can be useful for a number of reasons, such as generating a bulk kubeconfig\nfile on-the-fly for CI/CD pipelines, or for generating a kubeconfig file for a\nspecific cluster in a specific subscription.\n\n## Installation\n\n`akskubeconfig` is implemented in Python. Assuming you have a\nPython interpreter and pip installed you should be able to install with:\n\n```shell\npip install akskubeconfig\n```\n\n> This has not yet been widely tested and is currently in a _works on my\nmachine_ state.\n\n## Usage\n\nThe simplest usage is to just run the tool and specify an output file for it to write to:\n\n```shell\nakskubeconfig -o ~/.kube/config\n```\n\nThis will generate a set of schemas in a `schemas` directory. The tool\nprovides a number of options to modify the output:\n\n```shell\nakskubeconfig --help\nusage: akskubeconfig [-h] [-v] [-s SUBSCRIPTIONS] [--client-id CLIENT_ID] [--tenant-id TENANT_ID] [--client-secret CLIENT_SECRET] [--certificate-path CERTIFICATE_PATH]\n [--server-id SERVER_ID] [--environment ENVIRONMENT]\n [--default | --device-flow | --interactive | --sp-secret | --sp-pfx | --managed-identity | --managed-identity-id | --az-cli | --workload-identity --json | --yaml]\n [-m MAX_THREADS] [-o OUTFILE]\n\noptions:\n -h, --help show this help message and exit\n -v, --verbose Increase output verbosity\n -s SUBSCRIPTIONS, --subscriptions SUBSCRIPTIONS\n A comma separated list of subscription to use. If omitted, all subscriptions will be checked.\n --client-id CLIENT_ID\n Override the client id to write into the kubeconfig. Only applicable if required by the selected authentication flow.\n --tenant-id TENANT_ID\n Override the tenant id to write into the kubeconfig. Only applicable if required by the selected authentication flow.\n --client-secret CLIENT_SECRET\n Override the client secret to write into the kubeconfig. Only applicable if required by the selected authentication flow.\n --certificate-path CERTIFICATE_PATH\n Override the certificate path to write into the kubeconfig. Only applicable if required by the selected authentication flow.\n --server-id SERVER_ID\n Override the server id to write into the kubeconfig.\n --environment ENVIRONMENT\n Override the environment to write into the kubeconfig.\n --default Use the default flow authenticate within the generated kubeconfig (default)\n --device-flow Use device flow to authenticate within the generated kubeconfig\n --interactive Use the interactive web browser flow to authenticate within the generated kubeconfig\n --sp-secret Use a service principal secret to authenticate within the generated kubeconfig\n --sp-pfx Use a service principal pfx certificate to authenticate within the generated kubeconfig\n --managed-identity Use a managed identity to authenticate within the generated kubeconfig\n --managed-identity-id\n Use a managed identity to authenticate within the generated kubeconfig\n --az-cli Use the Azure CLI to authenticate within the generated kubeconfig\n --workload-identity Use a workload identity to authenticate within the generated kubeconfig\n --json Output as JSON\n --yaml Output as YAML (default)\n -m MAX_THREADS, --max-threads MAX_THREADS\n Maximum number of threads to use\n -o OUTFILE, --outfile OUTFILE\n Output file\n```\n\n<!-- Include: footer.tmpl -->\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A utility to genearate kubeconfig for AKS clusters in bulk across one or multiple subscriptions",
"version": "1.0.5",
"project_urls": {
"Homepage": "https://github.com/niq-ccoe-platform-engineering/akskubeconfig",
"Repository": "https://github.com/niq-ccoe-platform-engineering/akskubeconfig"
},
"split_keywords": [
"aks",
" kubeconfig",
" kubernetes"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a9d899123e916e67cf8c5a35f55c6f46f81a0f882fe3fbd0b3422aeb34f71f08",
"md5": "03769520786614cd47e43066a85344ac",
"sha256": "0c60df8b462c15cc2afe14c4a24c59a9339ef19059917dd1fa60974aaa782c09"
},
"downloads": -1,
"filename": "akskubeconfig-1.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "03769520786614cd47e43066a85344ac",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 21388,
"upload_time": "2024-12-16T16:13:29",
"upload_time_iso_8601": "2024-12-16T16:13:29.921826Z",
"url": "https://files.pythonhosted.org/packages/a9/d8/99123e916e67cf8c5a35f55c6f46f81a0f882fe3fbd0b3422aeb34f71f08/akskubeconfig-1.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4e1a298b3909206c64502d085ff8f00804e0f61d208962ed5cf31091cfc2dd3a",
"md5": "1260ecada876aad70bb992b3099d5ca9",
"sha256": "1167ed080ab7e74fe8e0b0d77947c5b3f09aa3058a0754ad165e54b22b535d4f"
},
"downloads": -1,
"filename": "akskubeconfig-1.0.5.tar.gz",
"has_sig": false,
"md5_digest": "1260ecada876aad70bb992b3099d5ca9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 18842,
"upload_time": "2024-12-16T16:13:31",
"upload_time_iso_8601": "2024-12-16T16:13:31.169859Z",
"url": "https://files.pythonhosted.org/packages/4e/1a/298b3909206c64502d085ff8f00804e0f61d208962ed5cf31091cfc2dd3a/akskubeconfig-1.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-16 16:13:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "niq-ccoe-platform-engineering",
"github_project": "akskubeconfig",
"github_not_found": true,
"lcname": "akskubeconfig"
}