{"id":18637118,"url":"https://github.com/openshift/cluster-autoscaler-operator","last_synced_at":"2025-04-04T06:08:13.704Z","repository":{"id":33692673,"uuid":"153519576","full_name":"openshift/cluster-autoscaler-operator","owner":"openshift","description":"Manage Kubernetes cluster-autoscaler deployments","archived":false,"fork":false,"pushed_at":"2025-03-06T15:33:21.000Z","size":42733,"stargazers_count":41,"open_issues_count":2,"forks_count":73,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T05:11:18.490Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openshift.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2018-10-17T20:28:54.000Z","updated_at":"2025-02-19T20:16:39.000Z","dependencies_parsed_at":"2023-02-18T08:15:34.583Z","dependency_job_id":"2cbca3fb-c7b3-46b4-8a0f-fc133d4f16aa","html_url":"https://github.com/openshift/cluster-autoscaler-operator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift%2Fcluster-autoscaler-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift%2Fcluster-autoscaler-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift%2Fcluster-autoscaler-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift%2Fcluster-autoscaler-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openshift","download_url":"https://codeload.github.com/openshift/cluster-autoscaler-operator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128747,"owners_count":20888235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-07T05:33:33.623Z","updated_at":"2025-04-04T06:08:13.681Z","avatar_url":"https://github.com/openshift.png","language":"Go","readme":"# Cluster Autoscaler Operator\n\nThe cluster-autoscaler-operator manages deployments of the OpenShift\n[Cluster Autoscaler][1] using the [cluster-api][2] provider.\n\n[1]: https://github.com/openshift/kubernetes-autoscaler/tree/master/cluster-autoscaler\n[2]: https://github.com/kubernetes-sigs/cluster-api\n\n\n## Custom Resource Definitions\n\nThe operator manages the following custom resources:\n\n- __ClusterAutoscaler__: This is a singleton resource which controls the\n  configuration of the cluster's autoscaler instance.  The operator will\n  only respond to the ClusterAutoscaler resource named \"default\" in the\n  managed namespace, i.e. the value of the `WATCH_NAMESPACE` environment\n  variable.  ([Example][ClusterAutoscaler])\n\n  The fields in the spec for ClusterAutoscaler resources correspond to\n  command-line arguments to the cluster-autoscaler.  The example\n  linked above results in the following invocation:\n\n  ```\n    Command:\n      cluster-autoscaler\n    Args:\n      --logtostderr\n      --balance-similar-node-groups=true\n      --v=1\n      --cloud-provider=clusterapi\n      --namespace=openshift-machine-api\n      --leader-elect-lease-duration=137s\n      --leader-elect-renew-deadline=107s\n      --leader-elect-retry-period=26s\n      --expendable-pods-priority-cutoff=-10\n      --max-nodes-total=24\n      --cores-total=8:128\n      --memory-total=4:256\n      --gpu-total=nvidia.com/gpu:0:16\n      --gpu-total=amd.com/gpu:0:4\n      --scale-down-enabled=true\n      --scale-down-delay-after-add=10s\n      --scale-down-delay-after-delete=10s\n      --scale-down-delay-after-failure=10s\n      --scale-down-utilization-threshold=0.4\n      --ignore-daemonsets-utilization=false\n      --skip-nodes-with-local-storage=true\n  ```\n\n- __MachineAutoscaler__: This resource targets a node group and manages\n  the annotations to enable and configure autoscaling for that group,\n  e.g. the min and max size.  Currently only `MachineSet` objects can be\n  targeted.  ([Example][MachineAutoscaler])\n\n[ClusterAutoscaler]: https://github.com/openshift/cluster-autoscaler-operator/blob/master/examples/clusterautoscaler.yaml\n[MachineAutoscaler]: https://github.com/openshift/cluster-autoscaler-operator/blob/master/examples/machineautoscaler.yaml\n\n\n## Development\n\n```sh-session\n## Build, Test, \u0026 Run\n$ make build\n$ make test\n\n$ export WATCH_NAMESPACE=openshift-machine-api\n$ ./bin/cluster-autoscaler-operator -alsologtostderr\n```\n\nThe Cluster Autoscaler Operator is designed to be deployed on\nOpenShift by the [Cluster Version Operator][CVO], but it's possible to\nrun it directly on any vanilla Kubernetes cluster that has the\n[machine-api][machine-api] components available.  To do so, apply the\nmanifests in the install directory: `kubectl apply -f ./install`\n\nThis will create the `openshift-machine-api` namespace, register the\ncustom resource definitions, configure RBAC policies, and create a\ndeployment for the operator.\n\n[CVO]: https://github.com/openshift/cluster-version-operator\n[machine-api]: https://github.com/openshift/cluster-api\n[cluster-api]: https://github.com/kubernetes-sigs/cluster-api\n\n\n### End-to-End Tests\n\nYou can run the e2e test suite with `make test-e2e`.  These tests\nassume the presence of a cluster already running the operator, and\nthat the `KUBECONFIG` environment variable points to a configuration\ngranting admin rights on said cluster.\n\nIf running make targets in container with podman and encountering permission issues, see [hacking-guide](https://github.com/openshift/machine-api-operator/blob/master/docs/dev/hacking-guide.md#troubleshooting-make-targets).\n\n\n## Validating Webhooks\n\nBy default the operator starts an HTTP server for webhooks and\nregisters a `ValidatingWebhookConfiguration` with the API server for\nboth the `ClusterAutoscaler` and `MachineAutoscaler` types.  This can\nbe disabled via the `WEBHOOKS_ENABLED` environment variable.  At the\nmoment, reconciliation of the webhook configuration is only performed\nonce at startup after leader-election has succeeded.\n\nIf the webhook server is enabled, you must provide a TLS certificate\nand key as well as a CA certificate to the operator.  The location of\nthese is controlled by the `WEBHOOKS_CERT_DIR` environment variable,\nwhich defaults to: `/etc/cluster-autoscaler-operator/tls`\n\nThe files must be in the following locations:\n\n  - `${WEBHOOKS_CERT_DIR}/tls.crt`\n  - `${WEBHOOKS_CERT_DIR}/tls.key`\n  - `${WEBHOOKS_CERT_DIR}/service-ca/ca-cert.pem`\n\nThe default cluster-autoscaler-operator deployment on OpenShift will\ngenerate the TLS assets automatically with the help of the OpenShift\n[service-ca-operator][service-ca-operator].  This works by annotating\nthe `Service` object associated with the operator, which causes the\nservice-ca-operator to generate a TLS certificate and inject it into a\n`Secret`, which is then mounted into the operator pod.  Additionally,\nthe service-ca-operator injects its CA certificate into a `ConfigMap`,\nwhich is also mounted.  The operator then uses the TLS certificate and\nkey to secure the webhook HTTP server, and injects the CA certificate\ninto the webhook configuration registered with the API server.\n\nUpdates to the TLS certificate and key are handled transparently.  The\n[controller-runtime][controller-runtime] library the operator is based\non watches the files mounted in the pod for changes and updates HTTP\nserver's TLS configuration.  Updates to the CA certificate are not\nhandled automatically, however a restart of the operator will load the\nnew CA certificate and update the webhook configuration.  This is not\nusually a problem in practice because CA certificates are generally\nlong-lived and the webhook configuration is set to ignore\ncommunication failures as the validations are merely a convenience.\n\n[service-ca-operator]: https://github.com/openshift/service-ca-operator\n[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenshift%2Fcluster-autoscaler-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenshift%2Fcluster-autoscaler-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenshift%2Fcluster-autoscaler-operator/lists"}