Add support for injecting the host IP address into k8s pods as an environment variable

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Release notes

Host IP address can be added as an environment variable accessible to pods.

Problem to solve

Customer comment (summarized):

To work around Gitlab CI metrics being a bit subpar, we have started to use the Datadog CI (https://www.datadoghq.com/product/ci-cd-monitoring/) offering. This builds on top of their k8s integration. That integration works by installing a daemonset into a cluster on each node, and metrics from the language runtimes (e.g. Javascript, Python) are shipped to the pods of the daemonset. Datadog bakes in a pretty strong assumption that metrics sent by a language runtime package get sent to the agent running on the same node -- which allows them to do things like correlate how your pod metrics (in this case, a pod for a Gitlab CI job) interact with host-level metrics. In regular k8s one can use the downward API and inject the host IP address into a pod as an environment variable. Gitlab does not offer such a facility, so the best we seem able to do at the moment is to send metrics to a k8s service that fronts the daemonset. This breaks the datadog architecture as then our language runtime metrics can get shipped to any pod in the daemonset, leaving us unable to build a full picture of host-level activity and the interactions between pods on a host.

Proposal

Add a configmap value that allows pods to access the host IP as an environment variable.

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Status update (revised 2022-08-01)

  • Needs triage.
Edited by 🤖 GitLab Bot 🤖