influxdata / influxdata/kapacitor
K8sAutoscaleNode no longer functions in newer Kubernetes APIs
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Since [Kubernetes 1.16](https://v1-16.docs.kubernetes.io/docs/setup/release/notes/#deprecations-and-removals), when `apps/v1beta1/Deployment` and `apps/v1beta1/Statefulset` were deprecated and moved to `apps/v1`, the `k8sAutoscale` node fails with the following error:
`ts=2021-02-26T10:31:13.206Z lvl=error msg="error handling point" service=kapacitor task_master=main task=task_name node=k8s_autoscale14 err="could not determine initial scale for \"namespace/deployments/name\": failed to get scale namespace/deployments/name: the server could not find the requested resource"`
It appears that the current implementation of this node is still using the deprecated API ([`services/k8s/client/client.go:26`](https://github.com/influxdata/kapacitor/blob/120d771ff67eb1dbbe8b7d5893309d5057cf9277/services/k8s/client/client.go#L26)). Can this be updated to the new API spec, or to switch behaviours based on which K8s it's currently running against?
Contributor guide
Research direction
Start by reading services/k8s/client/client.go at line 26 and trace how the k8sAutoscale node requests the scale resource. Compare that client behavior with the Kubernetes apps/v1 API and determine whether compatibility behavior is needed. Done means k8sAutoscale can determine the initial scale on newer Kubernetes APIs without the reported resource error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100