Skip to content

[util][k8s] Get hostname from kubernetes#283

Closed
zippolyte wants to merge 2 commits intomasterfrom
hippo/k8s_hostname
Closed

[util][k8s] Get hostname from kubernetes#283
zippolyte wants to merge 2 commits intomasterfrom
hippo/k8s_hostname

Conversation

@zippolyte
Copy link
Copy Markdown
Contributor

What does this PR do?

Implements the function GetNodeInfo in util/k8s and use it to fetch the hostname when running on kubernetes

@zippolyte zippolyte force-pushed the hippo/k8s_hostname branch from 178da70 to 6a37463 Compare June 7, 2017 21:46
@zippolyte zippolyte force-pushed the hippo/k8s_hostname branch from 6a37463 to 572b3f7 Compare June 7, 2017 21:50
Copy link
Copy Markdown
Contributor

@xvello xvello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including the kubernetes client makes the dogstats binary size shoot up from 11MB to 31MB, which is above our goal.

Your util/k8s code looks good to me but should not be linked into dogstatsd. We should stick with the downwards API to get the hostname. We just need to add the following to the pod spec:

env:
        - name: DD_HOSTNAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName

For more information: https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/

Could you please instead submit your util/k8s code in a "intial k8s util implementation" PR?

Cheers

@zippolyte
Copy link
Copy Markdown
Contributor Author

Done #285

@zippolyte zippolyte closed this Jun 8, 2017
@zippolyte zippolyte deleted the hippo/k8s_hostname branch June 8, 2017 18:44
s-alad pushed a commit that referenced this pull request Jan 6, 2026
…283)

Bumps [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) from 1.41.3 to 1.41.4.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](aws/aws-sdk-go-v2@service/sts/v1.41.3...service/sts/v1.41.4)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/sts
  dependency-version: 1.41.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants