-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add kube-prometheus-stack, loki-stack & monitoring-config
Kube-prometheus-stack helm release values have been updated to deploy kube-state-metrics to watch flux custom resources only. loki-stack has be copied from flux2 configuration. monitoring-config has been updated to use the kube-state-metrics flux resource metrics in the cluster dashboard. Signed-off-by: Sunny <[email protected]>
- Loading branch information
Showing
12 changed files
with
3,030 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: monitoring | ||
resources: | ||
- namespace.yaml | ||
- repository.yaml | ||
- release.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: monitoring | ||
labels: | ||
app.kubernetes.io/component: monitoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
apiVersion: helm.toolkit.fluxcd.io/v2beta1 | ||
kind: HelmRelease | ||
metadata: | ||
name: kube-prometheus-stack | ||
spec: | ||
interval: 5m | ||
chart: | ||
spec: | ||
version: "48.x" | ||
chart: kube-prometheus-stack | ||
sourceRef: | ||
kind: HelmRepository | ||
name: prometheus-community | ||
interval: 60m | ||
install: | ||
crds: Create | ||
upgrade: | ||
crds: CreateReplace | ||
# https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml | ||
values: | ||
alertmanager: | ||
enabled: false | ||
prometheus: | ||
prometheusSpec: | ||
retention: 24h | ||
resources: | ||
requests: | ||
cpu: 200m | ||
memory: 200Mi | ||
podMonitorNamespaceSelector: {} | ||
podMonitorSelector: | ||
matchLabels: | ||
app.kubernetes.io/component: monitoring | ||
grafana: | ||
defaultDashboardsEnabled: false | ||
kube-state-metrics: | ||
collectors: [] | ||
extraArgs: | ||
- --custom-resource-state-only=true | ||
rbac: | ||
extraRules: | ||
- apiGroups: | ||
- source.toolkit.fluxcd.io | ||
- kustomize.toolkit.fluxcd.io | ||
- helm.toolkit.fluxcd.io | ||
- image.toolkit.fluxcd.io | ||
- notification.toolkit.fluxcd.io | ||
resources: | ||
- gitrepositories | ||
- buckets | ||
- helmrepositories | ||
- helmcharts | ||
- ocirepositories | ||
- kustomizations | ||
- helmreleases | ||
- imagerepositories | ||
- imagepolicies | ||
- imageupdateautomations | ||
- alerts | ||
- providers | ||
- receivers | ||
verbs: ["list", "watch"] | ||
customResourceState: | ||
enabled: true | ||
config: | ||
spec: | ||
resources: | ||
- &metric | ||
groupVersionKind: | ||
group: source.toolkit.fluxcd.io | ||
version: "v1" | ||
kind: GitRepository | ||
metricNamePrefix: gotk | ||
metrics: | ||
- name: "resource_info" | ||
help: "The current state of a GitOps Toolkit resource." | ||
each: | ||
type: Info | ||
info: | ||
labelsFromPath: | ||
name: [metadata, name] | ||
labelsFromPath: | ||
exported_namespace: [metadata, namespace] | ||
ready: [status, conditions, "[type=Ready]", status] | ||
- <<: *metric | ||
groupVersionKind: | ||
group: source.toolkit.fluxcd.io | ||
version: "v1beta2" | ||
kind: Bucket | ||
- <<: *metric | ||
groupVersionKind: | ||
group: source.toolkit.fluxcd.io | ||
version: "v1beta2" | ||
kind: HelmRepository | ||
- <<: *metric | ||
groupVersionKind: | ||
group: source.toolkit.fluxcd.io | ||
version: "v1beta2" | ||
kind: HelmChart | ||
- <<: *metric | ||
groupVersionKind: | ||
group: source.toolkit.fluxcd.io | ||
version: "v1beta2" | ||
kind: OCIRepository | ||
- <<: *metric | ||
groupVersionKind: | ||
group: kustomize.toolkit.fluxcd.io | ||
version: "v1" | ||
kind: Kustomization | ||
- <<: *metric | ||
groupVersionKind: | ||
group: helm.toolkit.fluxcd.io | ||
version: "v2beta1" | ||
kind: HelmRelease | ||
- <<: *metric | ||
groupVersionKind: | ||
group: image.toolkit.fluxcd.io | ||
version: "v1beta2" | ||
kind: ImageRepository | ||
- <<: *metric | ||
groupVersionKind: | ||
group: image.toolkit.fluxcd.io | ||
version: "v1beta2" | ||
kind: ImagePolicy | ||
- <<: *metric | ||
groupVersionKind: | ||
group: image.toolkit.fluxcd.io | ||
version: "v1beta1" | ||
kind: ImageUpdateAutomation | ||
- <<: *metric | ||
groupVersionKind: | ||
group: notification.toolkit.fluxcd.io | ||
version: "v1beta2" | ||
kind: Alert | ||
- <<: *metric | ||
groupVersionKind: | ||
group: notification.toolkit.fluxcd.io | ||
version: "v1beta2" | ||
kind: Provider | ||
- <<: *metric | ||
groupVersionKind: | ||
group: notification.toolkit.fluxcd.io | ||
version: "v1" | ||
kind: Receiver | ||
postRenderers: | ||
- kustomize: | ||
patches: | ||
- target: | ||
# Ignore these objects from Flux diff as they are mutated from chart hooks | ||
kind: (ValidatingWebhookConfiguration|MutatingWebhookConfiguration) | ||
name: kube-prometheus-stack-admission | ||
patch: | | ||
- op: add | ||
path: /metadata/annotations/helm.toolkit.fluxcd.io~1driftDetection | ||
value: disabled | ||
- target: | ||
# Ignore these objects from Flux diff as they are mutated at apply time but not at dry-run time | ||
kind: PrometheusRule | ||
patch: | | ||
- op: add | ||
path: /metadata/annotations/helm.toolkit.fluxcd.io~1driftDetection | ||
value: disabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: source.toolkit.fluxcd.io/v1beta2 | ||
kind: HelmRepository | ||
metadata: | ||
name: prometheus-community | ||
spec: | ||
interval: 120m | ||
type: default | ||
url: https://prometheus-community.github.io/helm-charts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: monitoring | ||
resources: | ||
- repository.yaml | ||
- release.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: helm.toolkit.fluxcd.io/v2beta1 | ||
kind: HelmRelease | ||
metadata: | ||
name: loki-stack | ||
spec: | ||
interval: 5m | ||
dependsOn: | ||
- name: kube-prometheus-stack | ||
chart: | ||
spec: | ||
version: "2.x" | ||
chart: loki-stack | ||
sourceRef: | ||
kind: HelmRepository | ||
name: grafana-charts | ||
interval: 60m | ||
# https://github.com/grafana/helm-charts/blob/main/charts/loki-stack/values.yaml | ||
# https://github.com/grafana/loki/blob/main/production/helm/loki/values.yaml | ||
values: | ||
promtail: | ||
enabled: true | ||
loki: | ||
enabled: true | ||
isDefault: false | ||
serviceMonitor: | ||
enabled: true | ||
additionalLabels: | ||
app.kubernetes.io/part-of: kube-prometheus-stack | ||
config: | ||
chunk_store_config: | ||
max_look_back_period: 0s | ||
table_manager: | ||
retention_deletes_enabled: true | ||
retention_period: 12h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: source.toolkit.fluxcd.io/v1beta2 | ||
kind: HelmRepository | ||
metadata: | ||
name: grafana-charts | ||
spec: | ||
interval: 120m0s | ||
url: https://grafana.github.io/helm-charts |
Oops, something went wrong.