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

Commit

Permalink
Merge pull request #1083 from flanksource/disable-kube-state-metrics
Browse files Browse the repository at this point in the history
fix: add flag to disable kube-state-metrics deployment
  • Loading branch information
moshloop authored Sep 5, 2023
2 parents 33d14a2 + 171f634 commit 9235ab0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion manifests/monitoring/kube-state-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,4 @@ spec:
jobLabel: k8s-app
selector:
matchLabels:
k8s-app: kube-state-metrics
k8s-app: kube-state-metrics
9 changes: 9 additions & 0 deletions pkg/phases/monitoring/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ func Install(p *platform.Platform) error {
return nil
}

if p.Monitoring.DisableKubeStateMetrics {
for i, v := range specs {
if v == "kube-state-metrics.yaml" {
specs = append(specs[:i], specs[i+1:]...)
break
}
}
}

if p.Monitoring.Karma.Version == "" {
p.Monitoring.Karma.Version = "v0.63"
}
Expand Down
29 changes: 15 additions & 14 deletions pkg/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,20 +506,21 @@ func (dns DynamicDNS) IsEnabled() bool {
}

type Monitoring struct {
Disabled Boolean `yaml:"disabled,omitempty" json:"disabled,omitempty"`
AlertEmail string `yaml:"alert_email,omitempty" json:"alert_email,omitempty"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
Prometheus Prometheus `yaml:"prometheus,omitempty" json:"prometheus,omitempty"`
Karma Karma `yaml:"karma,omitempty" json:"karma,omitempty"`
Grafana Grafana `yaml:"grafana,omitempty" json:"grafana,omitempty"`
AlertManager AlertManager `yaml:"alertmanager,omitempty" json:"alertManager,omitempty"`
KubeStateMetrics string `yaml:"kubeStateMetrics,omitempty" json:"kubeStateMetrics,omitempty"`
KubeRbacProxy string `yaml:"kubeRbacProxy,omitempty" json:"kubeRbacProxy,omitempty"`
NodeExporter string `yaml:"nodeExporter,omitempty" json:"nodeExporter,omitempty"`
AddonResizer string `yaml:"addonResizer,omitempty" json:"addonResizer,omitempty"`
ExcludeAlerts []string `yaml:"excludeAlerts,omitempty" json:"excludeAlerts,omitempty"`
PushGateway PushGateway `yaml:"pushGateway,omitempty" json:"pushGateway,omitempty"`
E2E MonitoringE2E `yaml:"e2e,omitempty" json:"e2e,omitempty"`
Disabled Boolean `yaml:"disabled,omitempty" json:"disabled,omitempty"`
AlertEmail string `yaml:"alert_email,omitempty" json:"alert_email,omitempty"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
Prometheus Prometheus `yaml:"prometheus,omitempty" json:"prometheus,omitempty"`
Karma Karma `yaml:"karma,omitempty" json:"karma,omitempty"`
Grafana Grafana `yaml:"grafana,omitempty" json:"grafana,omitempty"`
AlertManager AlertManager `yaml:"alertmanager,omitempty" json:"alertManager,omitempty"`
KubeStateMetrics string `yaml:"kubeStateMetrics,omitempty" json:"kubeStateMetrics,omitempty"`
DisableKubeStateMetrics Boolean `yaml:"disableKubeStateMetrics,omitempty" json:"disableKubeStateMetrics,omitempty"`
KubeRbacProxy string `yaml:"kubeRbacProxy,omitempty" json:"kubeRbacProxy,omitempty"`
NodeExporter string `yaml:"nodeExporter,omitempty" json:"nodeExporter,omitempty"`
AddonResizer string `yaml:"addonResizer,omitempty" json:"addonResizer,omitempty"`
ExcludeAlerts []string `yaml:"excludeAlerts,omitempty" json:"excludeAlerts,omitempty"`
PushGateway PushGateway `yaml:"pushGateway,omitempty" json:"pushGateway,omitempty"`
E2E MonitoringE2E `yaml:"e2e,omitempty" json:"e2e,omitempty"`
}

func (m Monitoring) IsDisabled() bool {
Expand Down

0 comments on commit 9235ab0

Please sign in to comment.