Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Make kube-state-metrics optional for installation #387

Merged
merged 1 commit into from
Jul 13, 2020
Merged

Make kube-state-metrics optional for installation #387

merged 1 commit into from
Jul 13, 2020

Conversation

SergK
Copy link
Contributor

@SergK SergK commented Nov 27, 2019

In the most cases kube-state-metrics is already installed on the
cluster, so let's just re-use it, instead of installing another
one copy. By default, kube-state-metrics are installed as dependency,
so this PR doesn't change the default behaviour

Signed-off-by: Sergiy Kulanov sergey@kulanov.org.ua

  • [*] Chart version not bumped (the versions are all bumped and released at the same time)
  • [*] README.md updated with any new values or changes
  • [*] Updated template tests in ${CHART}/tests/*.py
  • Updated integration tests in ${CHART}/examples/*/test/goss.yaml

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@jmlrt
Copy link
Member

jmlrt commented Dec 18, 2019

jenkins test this please

@@ -92,7 +92,11 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: KUBE_STATE_METRICS_HOSTS
{{- if .Values.kube_state_metrics.enabled }}
value: "$({{ .Release.Name | replace "-" "_" | upper }}_KUBE_STATE_METRICS_SERVICE_HOST):$({{ .Release.Name | replace "-" "_" | upper }}_KUBE_STATE_METRICS_SERVICE_PORT_HTTP)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make more sense here to just use the kube_state_metrics_host value even if we are installing the sub-chart? In that case, what is the value that gets passed to the subchart as the service 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.

Hi @pbecotte . The general idea is to preserve upstream behavior as much as possible,
so when user disables kube_state_metrics installation then he/she needs to provide
existing endpoint for kube_state_metrics

@jmlrt jmlrt added the enhancement New feature or request label Jan 20, 2020
@botelastic
Copy link

botelastic bot commented Apr 16, 2020

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. To track this PR (even if closed), please open a corresponding issue if one does not already exist.

@erihanse
Copy link
Contributor

erihanse commented Jul 8, 2020

Is there something needed to get progress on this feature?

@jmlrt
Copy link
Member

jmlrt commented Jul 8, 2020

Hi @erihanse

Is there something needed to get progress on this feature?

The first thing is to have time for a proper review, tests and impacts analysis. This one is pretty old and important, it is in the top of the backlog and we should be able to review it soon.

@SergK, I'm sorry for the delay, Metricbeat had a lot of changes since you created this PR. Can you merge master on your branch and fix the conflicts?

@SergK
Copy link
Contributor Author

SergK commented Jul 10, 2020

@jmlrt done!

@jmlrt
Copy link
Member

jmlrt commented Jul 13, 2020

jenkins test this please

@jmlrt
Copy link
Member

jmlrt commented Jul 13, 2020

Some changes are required to make Black formatter happy in elastic+helm-charts+pull-request+lint-python/361.

Can you run black tests/metricbeat_test.py and update your PR?

@SergK
Copy link
Contributor Author

SergK commented Jul 13, 2020

Sure!

@jmlrt
Copy link
Member

jmlrt commented Jul 13, 2020

jenkins test this please

Copy link
Member

@jmlrt jmlrt left a comment

Choose a reason for hiding this comment

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

My tests are OK, I have a last small request to replace kube_state_metrics_host by kube_state_metrics.hostso we can have nested values like that:

kube_state_metrics:
  enabled: true
  # is used only when kube_state_metrics.enabled: false
  host: ""

instead of:

# is used only when kube_state_metrics.enabled: false
kube_state_metrics_host: ""

kube_state_metrics:
  enabled: true

metricbeat/values.yaml Outdated Show resolved Hide resolved
In the most cases kube-state-metrics is already installed on the
cluster, so let's just re-use it, instead of installing another
one copy. By default, kube-state-metrics are installed as dependency,
so this PR doesn't change the default behaviour

Signed-off-by: Sergiy Kulanov <sergey@kulanov.org.ua>
@jmlrt
Copy link
Member

jmlrt commented Jul 13, 2020

jenkins test this please

Copy link
Member

@jmlrt jmlrt left a comment

Choose a reason for hiding this comment

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

LGTM⛴

@jmlrt jmlrt merged commit 01ed638 into elastic:master Jul 13, 2020
jmlrt pushed a commit that referenced this pull request Jul 13, 2020
In the most cases kube-state-metrics is already installed on the
cluster, so let's just re-use it, instead of installing another
one copy. By default, kube-state-metrics are installed as dependency,
so this PR doesn't change the default behaviour

Signed-off-by: Sergiy Kulanov <sergey@kulanov.org.ua>
jmlrt pushed a commit that referenced this pull request Jul 13, 2020
In the most cases kube-state-metrics is already installed on the
cluster, so let's just re-use it, instead of installing another
one copy. By default, kube-state-metrics are installed as dependency,
so this PR doesn't change the default behaviour

Signed-off-by: Sergiy Kulanov <sergey@kulanov.org.ua>
jmlrt pushed a commit that referenced this pull request Jul 13, 2020
In the most cases kube-state-metrics is already installed on the
cluster, so let's just re-use it, instead of installing another
one copy. By default, kube-state-metrics are installed as dependency,
so this PR doesn't change the default behaviour

Signed-off-by: Sergiy Kulanov <sergey@kulanov.org.ua>
@jmlrt
Copy link
Member

jmlrt commented Jul 13, 2020

backported to 6.8, 7.8and 7.x branches

This was referenced Jul 16, 2020
This was referenced Jul 27, 2020
@jmlrt jmlrt mentioned this pull request Oct 28, 2020
This was referenced Nov 17, 2020
@jmlrt jmlrt mentioned this pull request Feb 8, 2021
This was referenced Mar 15, 2021
@jmlrt jmlrt mentioned this pull request May 25, 2021
@jmlrt jmlrt mentioned this pull request Mar 8, 2022
@jmlrt jmlrt mentioned this pull request Apr 21, 2022
This was referenced Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants