MCPcopy Index your code
hub / github.com/caas-team/GoKubeDownscaler

github.com/caas-team/GoKubeDownscaler @v1.3.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.4 ↗ · + Follow
623 symbols 1,734 edges 94 files 305 documented · 49%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GoKubeDownscaler Logo

GitHub Release GitHub License Contributors Stars go-kube-downscaler Slack Workspace

A horizontal autoscaler for Kubernetes workloads, saving cloud costs by scaling workloads down after hours. This is a golang port and successor of the popular (py-)kube-downscaler with improvements and quality of life changes.

Documentation and Guides

The documentation and guides can be found on our website.

An offline copy of the documentation and blogs can be found in website/content and website/blog. In there are Markdown files which can be viewed in any text editor or inside of a Markdown Viewer.

Installation

Installation is done via the Helm Chart. Information on how to install the Downscaler is on our website.

Missing Features

GoKubeDownscaler is now GA. This means that the core py-kube-downscaler features are all present, though there’s a chance we might have missed something You can find a list of the known-missing features under the missing feature label. If you think that any other features are missing, or you have an idea for a new feature, feel free to open an Issue.

Developing

This section covers the basics of developing on this repo, a more detailed guide can be found on our website.

Please read the contribution manifest.

Cloning the Repository

git clone https://github.com/caas-team/GoKubeDownscaler.git
cd GoKubeDownscaler

Setting up Pre-Commit

brew install pre-commit
pre-commit install
brew install golangci-lint
brew install gofumpt

Testing the Downscaler

Running the Unit Tests

go test -v --cover ./...

Running the Downscaler Locally

The downscaler can be run locally by specifying a kubeconfig to use. The kubeconfig should have at least the permissions as the Helm Charts role.yaml. The downscaler will use the current-context in the kubeconfig.

go run -k=path/to/kubeconfig # ... additional configuration

Testing the Website

Installing Dependencies

npm install --prefix website

Running It Locally

npm run --prefix website start

after that the website is available on localhost:3000/GoKubeDownscaler

Extension points exported contracts — how you extend this code

Workload (Interface)
Workload provides all functions needed to scale the workload. [2 implementers]
internal/pkg/scalable/workload.go
Client (Interface)
Client is an interface representing a high-level client to get and modify Kubernetes resources. nolint: interfacebloat / [1 …
internal/api/kubernetes/client.go
GithubLabelProps (Interface)
(no doc)
website/src/types/components/common.d.ts
TimeSpan (Interface)
(no doc) [2 implementers]
internal/pkg/values/timespan.go
RedirectToFirstDocProps (Interface)
(no doc)
website/src/types/components/RedirectToFirstDoc.d.ts
ParentWorkload (Interface)
(no doc) [1 implementers]
internal/pkg/scalable/workload.go
SupportedResourceGroupProps (Interface)
(no doc)
website/src/types/components/HomepageFeatures.d.ts
PercentageWorkload (Interface)
(no doc) [1 implementers]
internal/pkg/scalable/workload.go

Core symbols most depended-on inside this repo

GetDefaultScope
called by 121
internal/pkg/values/scope.go
GetNamespace
called by 96
internal/pkg/scalable/workload.go
GetName
called by 62
internal/pkg/scalable/workload.go
Error
called by 30
cmd/kubedownscaler/errors.go
String
called by 26
internal/pkg/values/replicas.go
newNilUnderlyingObjectError
called by 24
internal/pkg/scalable/errors.go
Set
called by 24
internal/pkg/util/regexList.go
newReviewResponse
called by 24
internal/api/kubernetes/admission/admissionHandler.go

Shape

Method 290
Function 226
Struct 71
Interface 22
TypeAlias 12
FuncType 2

Languages

Go91%
TypeScript9%

Modules by API surface

internal/api/kubernetes/client.go30 symbols
internal/pkg/scalable/workload.go26 symbols
internal/pkg/values/replicas.go25 symbols
internal/pkg/values/timespan.go22 symbols
internal/pkg/values/scope.go22 symbols
internal/api/kubernetes/admission/errors.go20 symbols
internal/pkg/values/errors.go18 symbols
internal/pkg/metrics/namespaceMetricsHolder.go17 symbols
internal/pkg/scalable/errors.go15 symbols
cmd/admissioncontroller/main_test.go15 symbols
internal/pkg/scalable/util.go14 symbols
internal/pkg/scalable/poddisruptionbudgets.go14 symbols

For agents

$ claude mcp add GoKubeDownscaler \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page