{"id":51547050,"url":"https://github.com/dcelasun/knbud","last_synced_at":"2026-07-09T19:02:03.656Z","repository":{"id":369145394,"uuid":"1288589056","full_name":"dcelasun/knbud","owner":"dcelasun","description":"K8s NFS Buddy - scales Kubernetes workloads down safely before NFS maintenance and scales them back up afterwards","archived":false,"fork":false,"pushed_at":"2026-07-03T20:27:19.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-03T21:11:39.256Z","etag":null,"topics":["argocd","fluxcd","gitops","helm","k8s","kustomization","nfs","storageclass"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcelasun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-03T18:55:01.000Z","updated_at":"2026-07-03T20:27:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dcelasun/knbud","commit_stats":null,"previous_names":["dcelasun/knbud"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dcelasun/knbud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcelasun%2Fknbud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcelasun%2Fknbud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcelasun%2Fknbud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcelasun%2Fknbud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcelasun","download_url":"https://codeload.github.com/dcelasun/knbud/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcelasun%2Fknbud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35309828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argocd","fluxcd","gitops","helm","k8s","kustomization","nfs","storageclass"],"created_at":"2026-07-09T19:02:02.833Z","updated_at":"2026-07-09T19:02:03.634Z","avatar_url":"https://github.com/dcelasun.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# knbud - K8s NFS Buddy\n\n`knbud` scales Kubernetes workloads down safely before NFS maintenance and scales them back up afterwards.\n\nIt supports Deployments, StatefulSets, and CronJobs.\n\n## Installation\n\n### Releases (recommended)\n\nDownload an archive from the [latest release](https://github.com/dcelasun/knbud/releases/latest).\n\nChoose `linux`, `macos`, or `windows`, then choose your CPU architecture:\n\n- `x86_64` for Intel or AMD\n- `arm64` for ARM or Apple Silicon\n\nOn Linux or macOS:\n\n```sh\ntar -xzf knbud_\u003cversion\u003e_\u003cos\u003e_\u003carchitecture\u003e.tar.gz\nchmod +x knbud\n./knbud --help\n```\n\nOn Windows, extract the `.zip` file and run:\n\n```powershell\n.\\knbud.exe --help\n```\n\n### Distro packages\n\n- [Arch Linux (AUR)](https://aur.archlinux.org/packages/knbud)\n\n### Building manually\n\n```sh\nmake vet\nmake test\nmake build\n```\n\nThe binary is written to `./knbud`.\n\n## Discover\n\nThe first stage. `discover` reads the live cluster.\n\nInspect the cluster without writing a file:\n\n```sh\n./knbud discover --dry-run\n```\n\nCreate or update `knbud.yaml`:\n\n```sh\n./knbud discover\n```\n\nHigh-confidence dependencies are saved automatically. Unclear dependencies are shown for review. Flux support and hidden dependencies are handled by short prompts.\n\nUse flags for a non-interactive run:\n\n```sh\n./knbud discover --accept-suggestions\n./knbud discover --ignore-suggestions\n```\n\nAny dependency not auto-discovered must be added to `customDependencies`, see [Configuration](#configuration).\n\n## Scale down and up\n\nPlan commands use only the saved relationships in `knbud.yaml`.\n\nPrint a scale down plan:\n\n```sh\n./knbud plan down --dry-run\n```\n\nPrint and apply it:\n\n```sh\n./knbud plan down\n```\n\nOnce the NFS service is online again, scale back up:\n\n```sh\n./knbud plan up\n```\n\nSkip the confirmation prompt:\n\n```sh\n./knbud plan down --yes\n./knbud plan up --yes\n```\n\nUseful flags:\n\n| Option | Default | Use |\n| --- | --- | --- |\n| `--config` | `knbud.yaml` | Config file |\n| `--kubeconfig` | client-go default | Kubeconfig file |\n| `--context` | current context | Kubernetes context |\n| `--output` | `human` | `human` or `json` |\n| `--parallelism` | `8` | Actions per wave |\n| `--timeout` | `5m` | Timeout per workload |\n\n## Configuration\n\n```yaml\nversion: 1\n\nstorageClasses:\n  - shared-nfs\n\ninference:\n  serviceReferences: true\n\ngitOps:\n  flux:\n    enabled: true\n    mode: auto\n\ncustomGroups:\n  web:\n    selectors:\n      - kind: Deployment\n        namespace: example\n        matchLabels:\n          app.kubernetes.io/part-of: web\n  database:\n    resources:\n      - kind: StatefulSet\n        namespace: example\n        name: database\n\ncustomDependencies:\n  - consumer: web\n    provider: database\n\ninclude:\n  - kind: Deployment\n    namespace: example\n    name: storage-operator\n\nexclude:\n  - kind: Deployment\n    namespace: example\n    name: unmanaged\n```\n\n`groups` and `dependencies` are managed by `discover`.\n\nUse `customGroups` and `customDependencies` for hand-written rules. `discover` preserves them.\n\nA dependency points from consumer to provider. Consumers scale down first. Providers scale up first.\n\n`include` adds a workload to the scale down plan. `exclude` keeps it out. Saved state still allows an excluded workload to be scaled up.\n\nSelectors support `name`, `matchLabels`, or `labelSelector`. A missing namespace matches every namespace.\n\n## Discovery rules\n\nNFS use is found from:\n\n- PVC storage classes\n- NFS persistent volumes\n- inline NFS volumes\n- the NFS CSI driver\n- StatefulSet claim templates\n\nService dependencies are found in container commands, arguments, environment values, and ConfigMaps. The Service must be in the same namespace. A single matching workload is accepted automatically.\n\nAmbiguous Services and Ingress hostnames require review. Suggestions that cannot change the plan are hidden.\n\nSecrets are never read. Add dependencies stored in Secrets or application settings by hand.\n\nPushgateway and Alertmanager endpoints are treated as telemetry, not runtime dependencies.\n\nAccepted and inferred dependencies are saved in `knbud.yaml`. Planning does not infer them again.\n\n## GitOps\n\nFlux auto mode suspends owners of workloads in the plan:\n\n```yaml\ngitOps:\n  flux:\n    enabled: true\n    mode: auto\n```\n\nFlux and Argo CD can use an explicit list:\n\n```yaml\ngitOps:\n  flux:\n    enabled: true\n    mode: explicit\n    resources:\n      - kind: Kustomization\n        namespace: gitops-system\n        name: example\n  argoCD:\n    enabled: true\n    mode: explicit\n    resources:\n      - kind: Application\n        namespace: argocd\n        name: example\n```\n\nArgo CD supports explicit mode only.\n\n## Safety\n\nScaling down (`plan down`) runs consumers before providers. Scaling up (`plan up`) uses the reverse order. Workloads in one wave run in parallel.\n\nOriginal replica and suspension values are stored in annotations. They are removed only after a successful scale up. Interrupted operations can be run again.\n\nHorizontalPodAutoscalers block planning. Active CronJob Jobs must finish before scale down completes.\n\nOperator-managed workloads produce warnings. Include the operator and add a dependency in `customDependencies` when it must scale down first.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcelasun%2Fknbud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcelasun%2Fknbud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcelasun%2Fknbud/lists"}