influxdata / influxdata/kapacitor
K8SAutoscale InCluster Configuration Problem
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
I'm currently not able to get the `k8sAutoscale()` node to work. When the `TICK` script is enabled, I get an error returned.
```
cannot use the k8sAutoscale node, could not create kubernetes client: unknown kubernetes cluster ""
```
I've configured `kapacitord` using environment variables. With my kapacitor docker container launched within my Kubernetes cluster. I verified the environment variables exist.
```
printenv | grep KAPACITOR_KUBERNETES
KAPACITOR_KUBERNETES_ENABLED=true
KAPACITOR_KUBERNETES_IN_CLUSTER=true
```
I tried to find the initializer for the In-Cluster configuration and found this line. Should this reference the `os.Getenv("KUBERNETES_SERVICE_HOST")` instead of having `http://kubernetes` hardcoded in as the url?
https://github.com/influxdata/kapacitor/blob/master/services/k8s/client/client.go#L95
*Version*
Using official `kapacitor:1.3` image
```
kapacitor version
Kapacitor 1.3.3 (git: HEAD ce586f35e89e75a1779e2b493caba15d66295a15)
```
*Environment*
Running inside Kubernetes 1.7.x within AWS
Contributor guide
Research direction
Start in services/k8s/client/client.go at the initializer around line 95, then reproduce the k8sAutoscale error with KAPACITOR_KUBERNETES_ENABLED, KAPACITOR_KUBERNETES_IN_CLUSTER, and the Kubernetes environment variables set. Done means the in-cluster Kubernetes client initializes without the unknown cluster error and the k8sAutoscale node can run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100