{"_id":"@azer-tab/aks-nodepool-monitor","name":"@azer-tab/aks-nodepool-monitor","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@azer-tab/aks-nodepool-monitor","version":"1.0.0","description":"CLI tool to detect AKS node pool provisioning issues and analyze workload resilience.","main":"dist/index.js","bin":{"aks-nodepool-monitor":"dist/index.js"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"ts-node src/index.ts","test":"jest --passWithNoTests","prepack":"npm run build"},"dependencies":{"@azure/arm-containerservice":"^22.2.0","@azure/arm-network":"^34.2.0","@azure/identity":"^4.6.0","@kubernetes/client-node":"^0.22.0","dotenv":"^17.4.2","ts-node":"^10.9.2","winston":"^3.17.0"},"devDependencies":{"@types/jest":"^27.5.2","@types/node":"^20.17.10","jest":"^27.5.1","ts-jest":"^27.1.5","typescript":"^4.9.5"},"engines":{"node":">=18.0.0"},"license":"MIT","types":"dist/index.d.ts","keywords":["aks","azure","kubernetes","nodepool","cli","monitoring"],"_id":"@azer-tab/aks-nodepool-monitor@1.0.0","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-jY/gwZXHBP28pV5oJmCZRTyPaYrKCc9ck8axah+i23QTPKPxVZDQXgzVrLyZHYhKgEvINGBEZcqm1C6cI6egpA==","shasum":"81394205bfc81a6dbbb841d2117eb59b84a38133","tarball":"https://registry.npmjs.org/@azer-tab/aks-nodepool-monitor/-/aks-nodepool-monitor-1.0.0.tgz","fileCount":42,"unpackedSize":42397,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDQoS0XQTSKvAL0bXuvhZr6AitkltdBL+2wSTAL3llUtgIhAPTfBJVDTl6azxpUQ9mrvOOnwYJIQCXJamsnIv4XdNdb"}]},"_npmUser":{"name":"azer-tab","email":"taboubi.azer@gmail.com"},"directories":{},"maintainers":[{"name":"azer-tab","email":"taboubi.azer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/aks-nodepool-monitor_1.0.0_1782306038789_0.25010597006223123"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-24T13:00:38.614Z","1.0.0":"2026-06-24T13:00:38.945Z","modified":"2026-06-24T13:00:39.167Z"},"maintainers":[{"name":"azer-tab","email":"taboubi.azer@gmail.com"}],"description":"CLI tool to detect AKS node pool provisioning issues and analyze workload resilience.","keywords":["aks","azure","kubernetes","nodepool","cli","monitoring"],"license":"MIT","readme":"# AKS Nodepool Monitor\n\nA production-ready Node.js/TypeScript CLI for inspecting an Azure Kubernetes Service cluster and generating a JSON report about node pool health, subnet IP usage, and workload resilience signals.\n\nThe CLI reads configuration from command-line arguments first, then falls back to environment variables or values loaded from `.env`.\n\n## What it checks\n\n- AKS node pools and provisioning state.\n- Node pool node count, `maxPods`, and autoscaler settings.\n- VNet subnet details used by node pools.\n- Estimated subnet IP usage from subnet CIDR and IP configurations.\n- Kubernetes deployments with exactly one replica.\n- PodDisruptionBudgets across all namespaces.\n- Number of Kubernetes nodes per AKS agent pool.\n\n`recentFailures` is currently a placeholder and returns an empty list. Azure Activity Log querying can be added later if historical provisioning-failure analysis is required.\n\n## Requirements\n\n- Node.js 18 or newer.\n- Azure CLI.\n- kubectl.\n- Access to the target Azure subscription.\n- Kubernetes access to list deployments, PodDisruptionBudgets, and nodes.\n\nAuthentication uses Azure SDK `DefaultAzureCredential`. For local use, `az login` is usually enough.\n\n## Install from source\n\n```bash\nnpm install\nnpm run build\nnpm link\n```\n\nAfter linking, the command is available globally:\n\n```bash\naks-nodepool-monitor --help\n```\n\n## Run with CLI arguments\n\n```bash\naks-nodepool-monitor \\\n  --subscription-id 00000000-0000-0000-0000-000000000000 \\\n  --resource-group my-resource-group \\\n  --cluster-name my-aks-cluster \\\n  --report-path ./reports/aks-nodepool-report.json\n```\n\nShort flags are also available:\n\n```bash\naks-nodepool-monitor \\\n  -s 00000000-0000-0000-0000-000000000000 \\\n  -g my-resource-group \\\n  -n my-aks-cluster \\\n  -o report.json\n```\n\n## Run with environment variables\n\n```bash\nexport AZURE_SUBSCRIPTION_ID=\"00000000-0000-0000-0000-000000000000\"\nexport AKS_RESOURCE_GROUP=\"my-resource-group\"\nexport AKS_CLUSTER_NAME=\"my-aks-cluster\"\nexport REPORT_PATH=\"report.json\"\n\naks-nodepool-monitor\n```\n\nCLI arguments override environment variables.\n\n## `.env` support\n\nCopy the example file:\n\n```bash\ncp .env.example .env\n```\n\nThen edit the values:\n\n```env\nAZURE_SUBSCRIPTION_ID=00000000-0000-0000-0000-000000000000\nAKS_RESOURCE_GROUP=my-resource-group\nAKS_CLUSTER_NAME=my-aks-cluster\nREPORT_PATH=report.json\nPRINT_CONSOLE=true\n```\n\nDo not commit `.env`.\n\n## CLI options\n\n| Option | Env fallback | Required | Description |\n|---|---|---:|---|\n| `-s, --subscription-id <id>` | `AZURE_SUBSCRIPTION_ID` | Yes | Azure subscription ID containing the AKS cluster. |\n| `-g, --resource-group <name>` | `AKS_RESOURCE_GROUP` | Yes | Resource group containing the AKS cluster. |\n| `-n, --cluster-name <name>` | `AKS_CLUSTER_NAME` | Yes | AKS cluster name. |\n| `-o, --report-path <path>` | `REPORT_PATH` | No | Output JSON path. Defaults to `report.json`. |\n| `--print-console` | `PRINT_CONSOLE` | No | Print JSON report to stdout. Defaults to true. |\n| `--no-print-console` | none | No | Disable stdout report printing. |\n| `-h, --help` | none | No | Show help. |\n| `-v, --version` | none | No | Show version. |\n\n## Prepare Azure and Kubernetes access\n\nLogin to Azure:\n\n```bash\naz login\naz account set --subscription \"00000000-0000-0000-0000-000000000000\"\n```\n\nDownload AKS credentials:\n\n```bash\naz aks get-credentials \\\n  --resource-group my-resource-group \\\n  --name my-aks-cluster \\\n  --overwrite-existing\n```\n\nVerify access:\n\n```bash\nkubectl config current-context\nkubectl get nodes\nkubectl get deployments --all-namespaces\nkubectl get pdb --all-namespaces\n```\n\n## Development\n\n```bash\nnpm install\nnpm run build\nnpm test\n```\n\nRun without installing globally:\n\n```bash\nnpm run build\nnode dist/index.js --help\n```\n\n## Package for sharing\n\n```bash\nnpm pack\n```\n\nThis creates a `.tgz` package that another user can install:\n\n```bash\nnpm install -g ./azer-tab-aks-nodepool-monitor-1.0.0.tgz\naks-nodepool-monitor --help\n```\n\n## Project structure\n\n```text\n.\n├── package.json\n├── tsconfig.json\n├── .env.example\n├── src/\n│   ├── index.ts\n│   ├── cli.ts\n│   ├── config.ts\n│   ├── collectors/\n│   ├── analyzers/\n│   ├── reporters/\n│   ├── models/\n│   └── utils/\n└── dist/\n```\n\n## Troubleshooting\n\n### Missing required configuration\n\nRun:\n\n```bash\naks-nodepool-monitor --help\n```\n\nThen pass the required flags or set the matching environment variables.\n\n### Azure authentication failure\n\nRun:\n\n```bash\naz login\naz account show\n```\n\nMake sure the active account can read the target AKS cluster and related VNet subnets.\n\n### Kubernetes access failure\n\nThe CLI shells out to these commands:\n\n```bash\nkubectl get deployments --all-namespaces -o json\nkubectl get pdb --all-namespaces -o json\nkubectl get nodes -o json\n```\n\nMake sure your current kubeconfig context points to the target AKS cluster and has list permissions for these resources.\n","readmeFilename":"README.md","_rev":"1-08ad3c7c8921c6eb505b04185296107e"}