Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 9235ab0

Browse files
authored
Merge pull request #1083 from flanksource/disable-kube-state-metrics
fix: add flag to disable kube-state-metrics deployment
2 parents 33d14a2 + 171f634 commit 9235ab0

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

manifests/monitoring/kube-state-metrics.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,4 @@ spec:
273273
jobLabel: k8s-app
274274
selector:
275275
matchLabels:
276-
k8s-app: kube-state-metrics
276+
k8s-app: kube-state-metrics

pkg/phases/monitoring/monitoring.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ func Install(p *platform.Platform) error {
6767
return nil
6868
}
6969

70+
if p.Monitoring.DisableKubeStateMetrics {
71+
for i, v := range specs {
72+
if v == "kube-state-metrics.yaml" {
73+
specs = append(specs[:i], specs[i+1:]...)
74+
break
75+
}
76+
}
77+
}
78+
7079
if p.Monitoring.Karma.Version == "" {
7180
p.Monitoring.Karma.Version = "v0.63"
7281
}

pkg/types/types.go

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -506,20 +506,21 @@ func (dns DynamicDNS) IsEnabled() bool {
506506
}
507507

508508
type Monitoring struct {
509-
Disabled Boolean `yaml:"disabled,omitempty" json:"disabled,omitempty"`
510-
AlertEmail string `yaml:"alert_email,omitempty" json:"alert_email,omitempty"`
511-
Version string `yaml:"version,omitempty" json:"version,omitempty"`
512-
Prometheus Prometheus `yaml:"prometheus,omitempty" json:"prometheus,omitempty"`
513-
Karma Karma `yaml:"karma,omitempty" json:"karma,omitempty"`
514-
Grafana Grafana `yaml:"grafana,omitempty" json:"grafana,omitempty"`
515-
AlertManager AlertManager `yaml:"alertmanager,omitempty" json:"alertManager,omitempty"`
516-
KubeStateMetrics string `yaml:"kubeStateMetrics,omitempty" json:"kubeStateMetrics,omitempty"`
517-
KubeRbacProxy string `yaml:"kubeRbacProxy,omitempty" json:"kubeRbacProxy,omitempty"`
518-
NodeExporter string `yaml:"nodeExporter,omitempty" json:"nodeExporter,omitempty"`
519-
AddonResizer string `yaml:"addonResizer,omitempty" json:"addonResizer,omitempty"`
520-
ExcludeAlerts []string `yaml:"excludeAlerts,omitempty" json:"excludeAlerts,omitempty"`
521-
PushGateway PushGateway `yaml:"pushGateway,omitempty" json:"pushGateway,omitempty"`
522-
E2E MonitoringE2E `yaml:"e2e,omitempty" json:"e2e,omitempty"`
509+
Disabled Boolean `yaml:"disabled,omitempty" json:"disabled,omitempty"`
510+
AlertEmail string `yaml:"alert_email,omitempty" json:"alert_email,omitempty"`
511+
Version string `yaml:"version,omitempty" json:"version,omitempty"`
512+
Prometheus Prometheus `yaml:"prometheus,omitempty" json:"prometheus,omitempty"`
513+
Karma Karma `yaml:"karma,omitempty" json:"karma,omitempty"`
514+
Grafana Grafana `yaml:"grafana,omitempty" json:"grafana,omitempty"`
515+
AlertManager AlertManager `yaml:"alertmanager,omitempty" json:"alertManager,omitempty"`
516+
KubeStateMetrics string `yaml:"kubeStateMetrics,omitempty" json:"kubeStateMetrics,omitempty"`
517+
DisableKubeStateMetrics Boolean `yaml:"disableKubeStateMetrics,omitempty" json:"disableKubeStateMetrics,omitempty"`
518+
KubeRbacProxy string `yaml:"kubeRbacProxy,omitempty" json:"kubeRbacProxy,omitempty"`
519+
NodeExporter string `yaml:"nodeExporter,omitempty" json:"nodeExporter,omitempty"`
520+
AddonResizer string `yaml:"addonResizer,omitempty" json:"addonResizer,omitempty"`
521+
ExcludeAlerts []string `yaml:"excludeAlerts,omitempty" json:"excludeAlerts,omitempty"`
522+
PushGateway PushGateway `yaml:"pushGateway,omitempty" json:"pushGateway,omitempty"`
523+
E2E MonitoringE2E `yaml:"e2e,omitempty" json:"e2e,omitempty"`
523524
}
524525

525526
func (m Monitoring) IsDisabled() bool {

0 commit comments

Comments
 (0)