elastic / elastic/support-diagnostics
identify if a installation is running in Kubernetes
- Dominant language
- Java
- Stars
- 304
- Forks
- 175
- PR merge metrics
- No merged PRs in 30d
Description
[0,2,2,1]
This seems to be related to issue https://github.com/elastic/support-diagnostics/issues/334
At the moment at the moment, there is no identification in the support diagnostics if a container is running in docker or kubernetes.
It would be extremely helpful anyways to identify if a node is running inside a kubernetes pod.
In order to see if there is a cluster executed in a kubernetes cluster
These variables will be exposed to every pod.
https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#environment-variables
```
KUBERNETES_SERVICE_HOST
KUBERNETES_SERVICE_PORT
```
We have already docker enablement in place.
So we just can do a
`docker exec -it printenv | grep KUBERNETES_SERVICE`
So if it returns something like that:
```
KUBERNETES_SERVICE_HOST=10.96.0.1
KUBERNETES_SERVICE_PORT=443
KUBERNETES_SERVICE_PORT_HTTPS=443
```
we know that this container is running under Kubernetes.
Contributor guide
Assessment
This issue has not been assessed yet.