Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AD KSM port choice #1308

Merged
merged 1 commit into from
Mar 27, 2018
Merged

Fix AD KSM port choice #1308

merged 1 commit into from
Mar 27, 2018

Conversation

mfpierre
Copy link
Contributor

What does this PR do?

This fixes DataDog/datadog-agent#1523

Versioning

  • Bumped the check version in manifest.json
  • Bumped the check version in datadog_checks/{integration}/__init__.py
  • Updated CHANGELOG.md. Please use Unreleased as the date in the title
    for the new section.
  • If PR impacts documentation, docs team has been notified or an issue has been opened on the documentation repo

Additional Notes

Anything else we should know when reviewing?

@mfpierre mfpierre force-pushed the mfpierre/fix-ksm-ad branch from b273067 to 132f3a3 Compare March 27, 2018 17:21
@mfpierre mfpierre added this to the 6.1.1 milestone Mar 27, 2018
Copy link
Contributor

@CharlyF CharlyF left a comment

Choose a reason for hiding this comment

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

Fantastic.

@mfpierre mfpierre merged commit 8ea2bcc into master Mar 27, 2018
@mfpierre mfpierre deleted the mfpierre/fix-ksm-ad branch March 27, 2018 17:54
@@ -5,7 +5,7 @@ init_config:

instances:
# To enable Kube State metrics you must specify the url exposing the API
- kube_state_url: http://%%host%%:%%port%%/metrics
- kube_state_url: http://%%host%%:8080/metrics
Copy link
Contributor

@pdecat pdecat Apr 4, 2018

Choose a reason for hiding this comment

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

It would have probably been better to use %%port_0%% instead of a hard-coded value here.

DataDog/datadog-agent#1523 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the initial approach but we decided to go with the hardcoded port because we would have a similar issue if one day KSM exposes a port < 8080

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough. Yet it will also break if someone customizes the value of the http-metrics port on the kube-state-metrics deployment.

It would be awesome if datadog auto discovery would allow specifying ports by their name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pdecat indeed it would be great for kubernetes annotation to support this, adding it to the backlog.

Copy link
Member

Choose a reason for hiding this comment

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

Yet it will also break if someone customizes the value of the http-metrics port on the kube-state-metrics deployment.

That's true, in this case your best bet for now would be to use explicit annotations to override the auto_conf, and hardcode the port you customized in the kube-state-metrics deployment.

Copy link

Choose a reason for hiding this comment

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

@hkaj I'm having a bit of trouble overriding the auto_conf. I have a second container, kube-rbac-proxy, (https://github.com/brancz/kube-rbac-proxy) in my kube-state-metrics deployment that listens on 8443. The container name is kube-rbac-proxy-main. Following the AD datadog docs I tried the below annotations and a few variations of it. The agent always tries to hit port 8080 though :(

    ad.datadoghq.com/kube-rbac-proxy-main.check_names: '["kubernetes_state"]'
    ad.datadoghq.com/kube-rbac-proxy-main.init_configs: '[{}]'
    ad.datadoghq.com/kube-rbac-proxy-main.instances: '[{"kubernetes_state_url": "http://%%host%%:%%port%%/metrics"}]'

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe it's because of your usage of kubernetes_state_url instead of kube_state_url.

Copy link

@jdamata jdamata Feb 13, 2019

Choose a reason for hiding this comment

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

Still didn't work. I opted to mount a configmap and overwrite the config manually. I believe theres a bigger block here for me. Kube-rbac-proxy requires the client to authenticate via client TLS or rbac token. I can't find any documentation on how to send the rbac token as a header in the request within datadog. Going to open a new issue for this

#3113

Copy link

@chiefy chiefy May 3, 2019

Choose a reason for hiding this comment

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

I'm having a problem w/ this as well - we're using the prometheus-operator which deploys kube-state-metrics service exposing ports 8443/9443 for https we defintely don't want two deployments of KSM running in our cluster. EDIT: looks like that's actually kube-rbac-proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kube-state-metrics publishes on 8080 by default, but datadog-agent looks on 8081
6 participants