diff --git a/packages/rancher-grafana/generated-changes/exclude/ci/default-values.yaml b/packages/rancher-grafana/generated-changes/exclude/ci/default-values.yaml new file mode 100644 index 0000000000..fc2ba605ad --- /dev/null +++ b/packages/rancher-grafana/generated-changes/exclude/ci/default-values.yaml @@ -0,0 +1 @@ +# Leave this file empty to ensure that CI runs builds against the default configuration in values.yaml. diff --git a/packages/rancher-grafana/generated-changes/exclude/ci/with-dashboard-json-values.yaml b/packages/rancher-grafana/generated-changes/exclude/ci/with-dashboard-json-values.yaml new file mode 100644 index 0000000000..e0c4e41687 --- /dev/null +++ b/packages/rancher-grafana/generated-changes/exclude/ci/with-dashboard-json-values.yaml @@ -0,0 +1,53 @@ +dashboards: + my-provider: + my-awesome-dashboard: + # An empty but valid dashboard + json: | + { + "__inputs": [], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "6.3.5" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "links": [], + "panels": [], + "schemaVersion": 19, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": ["5s"] + }, + "timezone": "", + "title": "Dummy Dashboard", + "uid": "IdcYQooWk", + "version": 1 + } + datasource: Prometheus diff --git a/packages/rancher-grafana/generated-changes/exclude/ci/with-dashboard-values.yaml b/packages/rancher-grafana/generated-changes/exclude/ci/with-dashboard-values.yaml new file mode 100644 index 0000000000..7b662c5fd4 --- /dev/null +++ b/packages/rancher-grafana/generated-changes/exclude/ci/with-dashboard-values.yaml @@ -0,0 +1,19 @@ +dashboards: + my-provider: + my-awesome-dashboard: + gnetId: 10000 + revision: 1 + datasource: Prometheus +dashboardProviders: + dashboardproviders.yaml: + apiVersion: 1 + providers: + - name: 'my-provider' + orgId: 1 + folder: '' + type: file + updateIntervalSeconds: 10 + disableDeletion: true + editable: true + options: + path: /var/lib/grafana/dashboards/my-provider diff --git a/packages/rancher-grafana/generated-changes/exclude/ci/with-image-renderer-values.yaml b/packages/rancher-grafana/generated-changes/exclude/ci/with-image-renderer-values.yaml new file mode 100644 index 0000000000..32f3074347 --- /dev/null +++ b/packages/rancher-grafana/generated-changes/exclude/ci/with-image-renderer-values.yaml @@ -0,0 +1,19 @@ +podLabels: + customLableA: Aaaaa +imageRenderer: + enabled: true + env: + RENDERING_ARGS: --disable-gpu,--window-size=1280x758 + RENDERING_MODE: clustered + podLabels: + customLableB: Bbbbb + networkPolicy: + limitIngress: true + limitEgress: true + resources: + limits: + cpu: 1000m + memory: 1000Mi + requests: + cpu: 500m + memory: 50Mi diff --git a/packages/rancher-monitoring/generated-changes/overlay/charts/grafana/templates/nginx-config.yaml b/packages/rancher-grafana/generated-changes/overlay/templates/nginx-config.yaml similarity index 100% rename from packages/rancher-monitoring/generated-changes/overlay/charts/grafana/templates/nginx-config.yaml rename to packages/rancher-grafana/generated-changes/overlay/templates/nginx-config.yaml diff --git a/packages/rancher-grafana/generated-changes/patch/Chart.yaml.patch b/packages/rancher-grafana/generated-changes/patch/Chart.yaml.patch new file mode 100644 index 0000000000..0408f3e009 --- /dev/null +++ b/packages/rancher-grafana/generated-changes/patch/Chart.yaml.patch @@ -0,0 +1,15 @@ +--- charts-original/Chart.yaml ++++ charts/Chart.yaml +@@ -1,5 +1,11 @@ ++annotations: ++ catalog.rancher.io/certified: rancher ++ catalog.rancher.io/namespace: cattle-monitoring-system ++ catalog.rancher.io/release-name: rancher-grafana ++ catalog.cattle.io/hidden: "true" ++ catalog.cattle.io/os: linux + apiVersion: v2 +-name: grafana ++name: rancher-grafana + version: 6.6.4 + appVersion: 7.4.5 + kubeVersion: '^1.8.0-0' diff --git a/packages/rancher-grafana/generated-changes/patch/templates/_helpers.tpl.patch b/packages/rancher-grafana/generated-changes/patch/templates/_helpers.tpl.patch new file mode 100644 index 0000000000..dd510e2b2a --- /dev/null +++ b/packages/rancher-grafana/generated-changes/patch/templates/_helpers.tpl.patch @@ -0,0 +1,35 @@ +--- charts-original/templates/_helpers.tpl ++++ charts/templates/_helpers.tpl +@@ -1,3 +1,32 @@ ++# Rancher ++{{- define "system_default_registry" -}} ++{{- if .Values.global.cattle.systemDefaultRegistry -}} ++{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}} ++{{- end -}} ++{{- end -}} ++ ++# Windows Support ++ ++{{/* ++Windows cluster will add default taint for linux nodes, ++add below linux tolerations to workloads could be scheduled to those linux nodes ++*/}} ++ ++{{- define "linux-node-tolerations" -}} ++- key: "cattle.io/os" ++ value: "linux" ++ effect: "NoSchedule" ++ operator: "Equal" ++{{- end -}} ++ ++{{- define "linux-node-selector" -}} ++{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} ++beta.kubernetes.io/os: linux ++{{- else -}} ++kubernetes.io/os: linux ++{{- end -}} ++{{- end -}} ++ + {{/* vim: set filetype=mustache: */}} + {{/* + Expand the name of the chart. diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/grafana/templates/_pod.tpl.patch b/packages/rancher-grafana/generated-changes/patch/templates/_pod.tpl.patch similarity index 92% rename from packages/rancher-monitoring/generated-changes/patch/charts/grafana/templates/_pod.tpl.patch rename to packages/rancher-grafana/generated-changes/patch/templates/_pod.tpl.patch index 1e49e4b53e..7bf4467132 100644 --- a/packages/rancher-monitoring/generated-changes/patch/charts/grafana/templates/_pod.tpl.patch +++ b/packages/rancher-grafana/generated-changes/patch/templates/_pod.tpl.patch @@ -1,11 +1,11 @@ ---- charts-original/charts/grafana/templates/_pod.tpl -+++ charts/charts/grafana/templates/_pod.tpl +--- charts-original/templates/_pod.tpl ++++ charts/templates/_pod.tpl @@ -1,4 +1,3 @@ - {{- define "grafana.pod" -}} {{- if .Values.schedulerName }} schedulerName: "{{ .Values.schedulerName }}" -@@ -21,12 +20,13 @@ +@@ -21,9 +20,9 @@ {{- if ( and .Values.persistence.enabled .Values.initChownData.enabled ) }} - name: init-chown-data {{- if .Values.initChownData.image.sha }} @@ -17,11 +17,7 @@ {{- end }} imagePullPolicy: {{ .Values.initChownData.image.pullPolicy }} securityContext: -+ runAsNonRoot: false - runAsUser: 0 - command: ["chown", "-R", "{{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.runAsGroup }}", "/var/lib/grafana"] - resources: -@@ -41,9 +41,9 @@ +@@ -42,9 +41,9 @@ {{- if .Values.dashboards }} - name: download-dashboards {{- if .Values.downloadDashboardsImage.sha }} @@ -33,7 +29,7 @@ {{- end }} imagePullPolicy: {{ .Values.downloadDashboardsImage.pullPolicy }} command: ["/bin/sh"] -@@ -73,9 +73,9 @@ +@@ -79,11 +78,16 @@ {{- if .Values.sidecar.datasources.enabled }} - name: {{ template "grafana.name" . }}-sc-datasources {{- if .Values.sidecar.image.sha }} @@ -44,8 +40,15 @@ + image: "{{ template "system_default_registry" . }}{{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }}" {{- end }} imagePullPolicy: {{ .Values.sidecar.imagePullPolicy }} ++ {{- if .Values.sidecar.datasources.envFromSecret }} ++ envFrom: ++ - secretRef: ++ name: {{ tpl .Values.sidecar.datasources.envFromSecret . }} ++ {{- end }} env: -@@ -108,9 +108,9 @@ + - name: METHOD + value: LIST +@@ -118,9 +122,9 @@ {{- if .Values.sidecar.notifiers.enabled }} - name: {{ template "grafana.name" . }}-sc-notifiers {{- if .Values.sidecar.image.sha }} @@ -57,7 +60,7 @@ {{- end }} imagePullPolicy: {{ .Values.sidecar.imagePullPolicy }} env: -@@ -153,9 +153,9 @@ +@@ -163,9 +167,9 @@ {{- if .Values.sidecar.dashboards.enabled }} - name: {{ template "grafana.name" . }}-sc-dashboard {{- if .Values.sidecar.image.sha }} @@ -69,7 +72,7 @@ {{- end }} imagePullPolicy: {{ .Values.sidecar.imagePullPolicy }} env: -@@ -187,9 +187,9 @@ +@@ -205,9 +209,9 @@ {{- end}} - name: {{ .Chart.Name }} {{- if .Values.image.sha }} @@ -81,7 +84,7 @@ {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.command }} -@@ -285,7 +285,7 @@ +@@ -307,7 +311,7 @@ {{- end }} ports: - name: {{ .Values.service.portName }} @@ -90,7 +93,7 @@ protocol: TCP - name: {{ .Values.podPortName }} containerPort: 3000 -@@ -352,17 +352,17 @@ +@@ -380,17 +384,17 @@ {{- with .Values.extraContainers }} {{ tpl . $ | indent 2 }} {{- end }} diff --git a/packages/rancher-grafana/generated-changes/patch/templates/image-renderer-deployment.yaml.patch b/packages/rancher-grafana/generated-changes/patch/templates/image-renderer-deployment.yaml.patch new file mode 100644 index 0000000000..09f917df0d --- /dev/null +++ b/packages/rancher-grafana/generated-changes/patch/templates/image-renderer-deployment.yaml.patch @@ -0,0 +1,44 @@ +--- charts-original/templates/image-renderer-deployment.yaml ++++ charts/templates/image-renderer-deployment.yaml +@@ -42,6 +42,8 @@ + {{- end }} + {{- if .Values.imageRenderer.serviceAccountName }} + serviceAccountName: "{{ .Values.imageRenderer.serviceAccountName }}" ++ {{- else }} ++ serviceAccountName: {{ template "grafana.serviceAccountName" . }} + {{- end }} + {{- if .Values.imageRenderer.securityContext }} + securityContext: +@@ -63,9 +65,9 @@ + containers: + - name: {{ .Chart.Name }}-image-renderer + {{- if .Values.imageRenderer.image.sha }} +- image: "{{ .Values.imageRenderer.image.repository }}:{{ .Values.imageRenderer.image.tag }}@sha256:{{ .Values.imageRenderer.image.sha }}" ++ image: "{{ template "system_default_registry" . }}{{ .Values.imageRenderer.image.repository }}:{{ .Values.imageRenderer.image.tag }}@sha256:{{ .Values.imageRenderer.image.sha }}" + {{- else }} +- image: "{{ .Values.imageRenderer.image.repository }}:{{ .Values.imageRenderer.image.tag }}" ++ image: "{{ template "system_default_registry" . }}{{ .Values.imageRenderer.image.repository }}:{{ .Values.imageRenderer.image.tag }}" + {{- end }} + imagePullPolicy: {{ .Values.imageRenderer.image.pullPolicy }} + {{- if .Values.imageRenderer.command }} +@@ -97,16 +99,16 @@ + resources: + {{ toYaml . | indent 12 }} + {{- end }} +- {{- with .Values.imageRenderer.nodeSelector }} +- nodeSelector: ++ nodeSelector: {{ include "linux-node-selector" . | nindent 8 }} ++ {{- if .Values.imageRenderer.nodeSelector }} + {{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.imageRenderer.affinity }} + affinity: + {{ toYaml . | indent 8 }} + {{- end }} +- {{- with .Values.imageRenderer.tolerations }} +- tolerations: ++ tolerations: {{ include "linux-node-tolerations" . | nindent 8 }} ++ {{- if .Values.imageRenderer.tolerations }} + {{ toYaml . | indent 8 }} + {{- end }} + volumes: diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/grafana/templates/podsecuritypolicy.yaml.patch b/packages/rancher-grafana/generated-changes/patch/templates/podsecuritypolicy.yaml.patch similarity index 82% rename from packages/rancher-monitoring/generated-changes/patch/charts/grafana/templates/podsecuritypolicy.yaml.patch rename to packages/rancher-grafana/generated-changes/patch/templates/podsecuritypolicy.yaml.patch index ff70b8109f..3c492293cf 100644 --- a/packages/rancher-monitoring/generated-changes/patch/charts/grafana/templates/podsecuritypolicy.yaml.patch +++ b/packages/rancher-grafana/generated-changes/patch/templates/podsecuritypolicy.yaml.patch @@ -1,11 +1,11 @@ ---- charts-original/charts/grafana/templates/podsecuritypolicy.yaml -+++ charts/charts/grafana/templates/podsecuritypolicy.yaml +--- charts-original/templates/podsecuritypolicy.yaml ++++ charts/templates/podsecuritypolicy.yaml @@ -6,13 +6,9 @@ namespace: {{ template "grafana.namespace" . }} labels: {{- include "grafana.labels" . | nindent 4 }} - annotations: -- seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default' +- seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default' - seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default' - {{- if .Values.rbac.pspUseAppArmor }} - apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default' diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/grafana/values.yaml.patch b/packages/rancher-grafana/generated-changes/patch/values.yaml.patch similarity index 57% rename from packages/rancher-monitoring/generated-changes/patch/charts/grafana/values.yaml.patch rename to packages/rancher-grafana/generated-changes/patch/values.yaml.patch index 529186b441..5120b4b2c7 100644 --- a/packages/rancher-monitoring/generated-changes/patch/charts/grafana/values.yaml.patch +++ b/packages/rancher-grafana/generated-changes/patch/values.yaml.patch @@ -1,8 +1,16 @@ ---- charts-original/charts/grafana/values.yaml -+++ charts/charts/grafana/values.yaml -@@ -1,7 +1,17 @@ +--- charts-original/values.yaml ++++ charts/values.yaml +@@ -1,9 +1,25 @@ ++global: ++ cattle: ++ systemDefaultRegistry: "" ++ ++autoscaling: ++ enabled: false rbac: create: true + ## Use an existing ClusterRole/Role (depending on rbac.namespaced false/true) + # useExistingRole: name-of-some-(cluster)role pspEnabled: true - pspUseAppArmor: true + pspAnnotations: {} @@ -11,7 +19,7 @@ + ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp + ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl + ## -+ # seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default' ++ # seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default' + # seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default' + # apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default' + # apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default' @@ -19,16 +27,16 @@ namespaced: false extraRoleRules: [] # - apiGroups: [] -@@ -49,7 +59,7 @@ +@@ -52,7 +68,7 @@ # schedulerName: "default-scheduler" image: - repository: grafana/grafana + repository: rancher/mirrored-grafana-grafana - tag: 7.1.5 + tag: 7.4.5 sha: "" pullPolicy: IfNotPresent -@@ -63,12 +73,15 @@ +@@ -66,12 +82,15 @@ testFramework: enabled: true @@ -46,16 +54,16 @@ runAsUser: 472 runAsGroup: 472 fsGroup: 472 -@@ -91,7 +104,7 @@ +@@ -99,7 +118,7 @@ # priorityClassName: downloadDashboardsImage: - repository: curlimages/curl + repository: rancher/mirrored-curlimages-curl - tag: 7.70.0 + tag: 7.73.0 sha: "" pullPolicy: IfNotPresent -@@ -244,7 +257,7 @@ +@@ -284,7 +303,7 @@ ## initChownData container image ## image: @@ -64,12 +72,35 @@ tag: "1.31.1" sha: "" pullPolicy: IfNotPresent -@@ -486,7 +499,7 @@ +@@ -581,7 +600,7 @@ ## Requires at least Grafana 5 to work and can't be used together with parameters dashboardProviders, datasources and dashboards sidecar: image: -- repository: kiwigrid/k8s-sidecar +- repository: quay.io/kiwigrid/k8s-sidecar + repository: rancher/mirrored-kiwigrid-k8s-sidecar - tag: 0.1.151 + tag: 1.10.7 sha: "" imagePullPolicy: IfNotPresent +@@ -639,6 +658,10 @@ + # Otherwise the namespace in which the sidecar is running will be used. + # It's also possible to specify ALL to search in all namespaces + searchNamespace: null ++ ++ ## The name of a secret in the same kubernetes namespace which contain values to be added to the environment ++ ## This can be useful for database passwords, etc. Value is templated. ++ envFromSecret: "" + notifiers: + enabled: false + # label that the configmaps with notifiers are marked with +@@ -663,9 +686,9 @@ + replicas: 1 + image: + # image-renderer Image repository +- repository: grafana/grafana-image-renderer ++ repository: rancher/mirrored-grafana-grafana-image-renderer + # image-renderer Image tag +- tag: latest ++ tag: 2.0.1 + # image-renderer Image sha (optional) + sha: "" + # image-renderer ImagePullPolicy diff --git a/packages/rancher-grafana/package.yaml b/packages/rancher-grafana/package.yaml new file mode 100644 index 0000000000..4fd6a6b950 --- /dev/null +++ b/packages/rancher-grafana/package.yaml @@ -0,0 +1,5 @@ +url: https://github.com/grafana/helm-charts.git +subdirectory: charts/grafana +commit: 837b4ace32278eee14310f1d654d651d0898bb19 +packageVersion: 01 +releaseCandidateVersion: 00 diff --git a/packages/rancher-kube-state-metrics/generated-changes/patch/Chart.yaml.patch b/packages/rancher-kube-state-metrics/generated-changes/patch/Chart.yaml.patch new file mode 100644 index 0000000000..b4ee2f0666 --- /dev/null +++ b/packages/rancher-kube-state-metrics/generated-changes/patch/Chart.yaml.patch @@ -0,0 +1,15 @@ +--- charts-original/Chart.yaml ++++ charts/Chart.yaml +@@ -1,5 +1,11 @@ ++annotations: ++ catalog.rancher.io/certified: rancher ++ catalog.rancher.io/namespace: cattle-monitoring-system ++ catalog.rancher.io/release-name: rancher-kube-state-metrics ++ catalog.cattle.io/hidden: "true" ++ catalog.cattle.io/os: linux + apiVersion: v1 +-name: kube-state-metrics ++name: rancher-kube-state-metrics + description: Install kube-state-metrics to generate and expose cluster-level metrics + keywords: + - metric diff --git a/packages/rancher-kube-state-metrics/generated-changes/patch/templates/_helpers.tpl.patch b/packages/rancher-kube-state-metrics/generated-changes/patch/templates/_helpers.tpl.patch new file mode 100644 index 0000000000..dd510e2b2a --- /dev/null +++ b/packages/rancher-kube-state-metrics/generated-changes/patch/templates/_helpers.tpl.patch @@ -0,0 +1,35 @@ +--- charts-original/templates/_helpers.tpl ++++ charts/templates/_helpers.tpl +@@ -1,3 +1,32 @@ ++# Rancher ++{{- define "system_default_registry" -}} ++{{- if .Values.global.cattle.systemDefaultRegistry -}} ++{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}} ++{{- end -}} ++{{- end -}} ++ ++# Windows Support ++ ++{{/* ++Windows cluster will add default taint for linux nodes, ++add below linux tolerations to workloads could be scheduled to those linux nodes ++*/}} ++ ++{{- define "linux-node-tolerations" -}} ++- key: "cattle.io/os" ++ value: "linux" ++ effect: "NoSchedule" ++ operator: "Equal" ++{{- end -}} ++ ++{{- define "linux-node-selector" -}} ++{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} ++beta.kubernetes.io/os: linux ++{{- else -}} ++kubernetes.io/os: linux ++{{- end -}} ++{{- end -}} ++ + {{/* vim: set filetype=mustache: */}} + {{/* + Expand the name of the chart. diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/kube-state-metrics/templates/deployment.yaml.patch b/packages/rancher-kube-state-metrics/generated-changes/patch/templates/deployment.yaml.patch similarity index 81% rename from packages/rancher-monitoring/generated-changes/patch/charts/kube-state-metrics/templates/deployment.yaml.patch rename to packages/rancher-kube-state-metrics/generated-changes/patch/templates/deployment.yaml.patch index ecbf5335d0..f3598e9a5c 100644 --- a/packages/rancher-monitoring/generated-changes/patch/charts/kube-state-metrics/templates/deployment.yaml.patch +++ b/packages/rancher-kube-state-metrics/generated-changes/patch/templates/deployment.yaml.patch @@ -1,6 +1,6 @@ ---- charts-original/charts/kube-state-metrics/templates/deployment.yaml -+++ charts/charts/kube-state-metrics/templates/deployment.yaml -@@ -44,6 +44,7 @@ +--- charts-original/templates/deployment.yaml ++++ charts/templates/deployment.yaml +@@ -45,6 +45,7 @@ fsGroup: {{ .Values.securityContext.fsGroup }} runAsGroup: {{ .Values.securityContext.runAsGroup }} runAsUser: {{ .Values.securityContext.runAsUser }} @@ -8,16 +8,16 @@ {{- end }} {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} -@@ -154,7 +155,7 @@ - - --pod-namespace=$(POD_NAMESPACE) - {{ end }} +@@ -173,7 +174,7 @@ + readOnly: true + {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}" ports: - containerPort: 8080 livenessProbe: -@@ -181,11 +182,11 @@ +@@ -200,12 +201,12 @@ affinity: {{ toYaml .Values.affinity | indent 8 }} {{- end }} @@ -31,3 +31,4 @@ - tolerations: {{ toYaml .Values.tolerations | indent 8 }} {{- end }} + {{- if .Values.kubeconfig.enabled}} diff --git a/packages/rancher-kube-state-metrics/generated-changes/patch/values.yaml.patch b/packages/rancher-kube-state-metrics/generated-changes/patch/values.yaml.patch new file mode 100644 index 0000000000..f86e310a71 --- /dev/null +++ b/packages/rancher-kube-state-metrics/generated-changes/patch/values.yaml.patch @@ -0,0 +1,23 @@ +--- charts-original/values.yaml ++++ charts/values.yaml +@@ -1,7 +1,11 @@ ++global: ++ cattle: ++ systemDefaultRegistry: "" ++ + # Default values for kube-state-metrics. + prometheusScrape: true + image: +- repository: k8s.gcr.io/kube-state-metrics/kube-state-metrics ++ repository: rancher/mirrored-kube-state-metrics-kube-state-metrics + tag: v1.9.8 + pullPolicy: IfNotPresent + +@@ -84,6 +88,7 @@ + + securityContext: + enabled: true ++ runAsNonRoot: true + runAsGroup: 65534 + runAsUser: 65534 + fsGroup: 65534 diff --git a/packages/rancher-kube-state-metrics/package.yaml b/packages/rancher-kube-state-metrics/package.yaml new file mode 100644 index 0000000000..02b9515c8c --- /dev/null +++ b/packages/rancher-kube-state-metrics/package.yaml @@ -0,0 +1,5 @@ +url: https://github.com/kubernetes/kube-state-metrics.git +subdirectory: charts/kube-state-metrics +commit: bd6335b43ef3eb97639dc41dd605dc12422f60b6 +packageVersion: 01 +releaseCandidateVersion: 00 diff --git a/packages/rancher-monitoring/generated-changes/dependencies/grafana/dependency.yaml b/packages/rancher-monitoring/generated-changes/dependencies/grafana/dependency.yaml index ff88f61f1c..db8b72fbc7 100644 --- a/packages/rancher-monitoring/generated-changes/dependencies/grafana/dependency.yaml +++ b/packages/rancher-monitoring/generated-changes/dependencies/grafana/dependency.yaml @@ -1,2 +1,2 @@ workingDir: "" -url: https://github.com/grafana/helm-charts/releases/download/grafana-5.6.4/grafana-5.6.4.tgz +url: packages/rancher-grafana diff --git a/packages/rancher-monitoring/generated-changes/dependencies/kube-state-metrics/dependency.yaml b/packages/rancher-monitoring/generated-changes/dependencies/kube-state-metrics/dependency.yaml index 5d9b19d41c..6cc57397e1 100644 --- a/packages/rancher-monitoring/generated-changes/dependencies/kube-state-metrics/dependency.yaml +++ b/packages/rancher-monitoring/generated-changes/dependencies/kube-state-metrics/dependency.yaml @@ -1,2 +1,2 @@ workingDir: "" -url: https://charts.helm.sh/stable/packages/kube-state-metrics-2.8.14.tgz +url: packages/rancher-kube-state-metrics diff --git a/packages/rancher-monitoring/generated-changes/dependencies/prometheus-adapter/dependency.yaml b/packages/rancher-monitoring/generated-changes/dependencies/prometheus-adapter/dependency.yaml index b28c4e19ad..e5f3cd523c 100644 --- a/packages/rancher-monitoring/generated-changes/dependencies/prometheus-adapter/dependency.yaml +++ b/packages/rancher-monitoring/generated-changes/dependencies/prometheus-adapter/dependency.yaml @@ -1,2 +1,2 @@ workingDir: "" -url: https://github.com/prometheus-community/helm-charts/releases/download/prometheus-adapter-2.7.1/prometheus-adapter-2.7.1.tgz +url: packages/rancher-prometheus-adapter diff --git a/packages/rancher-monitoring/generated-changes/dependencies/prometheus-node-exporter/dependency.yaml b/packages/rancher-monitoring/generated-changes/dependencies/prometheus-node-exporter/dependency.yaml index f17c9c5bf0..443a61769c 100644 --- a/packages/rancher-monitoring/generated-changes/dependencies/prometheus-node-exporter/dependency.yaml +++ b/packages/rancher-monitoring/generated-changes/dependencies/prometheus-node-exporter/dependency.yaml @@ -1,2 +1,2 @@ workingDir: "" -url: https://github.com/prometheus-community/helm-charts/releases/download/prometheus-node-exporter-1.11.2/prometheus-node-exporter-1.11.2.tgz +url: packages/rancher-node-exporter diff --git a/packages/rancher-monitoring/generated-changes/exclude/Chart.lock b/packages/rancher-monitoring/generated-changes/exclude/Chart.lock new file mode 100644 index 0000000000..b30d86f472 --- /dev/null +++ b/packages/rancher-monitoring/generated-changes/exclude/Chart.lock @@ -0,0 +1,12 @@ +dependencies: +- name: kube-state-metrics + repository: https://kubernetes.github.io/kube-state-metrics + version: 2.13.0 +- name: prometheus-node-exporter + repository: https://prometheus-community.github.io/helm-charts + version: 1.16.2 +- name: grafana + repository: https://grafana.github.io/helm-charts + version: 6.6.3 +digest: sha256:52acbef377da70248ae3fa926dc7f6601df9022b1b1e17224a8fe99e6995d3af +generated: "2021-03-19T17:50:36.8566658+01:00" diff --git a/packages/rancher-monitoring/generated-changes/exclude/ci/01-provision-crds-values.yaml b/packages/rancher-monitoring/generated-changes/exclude/ci/01-provision-crds-values.yaml new file mode 100644 index 0000000000..7b37cf6c62 --- /dev/null +++ b/packages/rancher-monitoring/generated-changes/exclude/ci/01-provision-crds-values.yaml @@ -0,0 +1,41 @@ +alertmanager: + enabled: false +coreDns: + enabled: false +kubeApiServer: + enabled: false +kubeControllerManager: + enabled: false +kubeDns: + enabled: false +kubeEtcd: + enabled: false +kubeProxy: + enabled: false +kubeScheduler: + enabled: false +kubeStateMetrics: + enabled: false +kubelet: + enabled: false +nodeExporter: + enabled: false +grafana: + enabled: false +prometheus: + enabled: false +defaultRules: + create: false +# Default configuration of prometheus operator will create CRDs in the cluster idempotently +prometheusOperator: + enabled: true + serviceMonitor: + selfMonitor: false + tls: + enabled: false + admissionWebhooks: + enabled: false + namespaces: + releaseNamespace: true + additional: + - kube-system diff --git a/packages/rancher-monitoring/generated-changes/exclude/ci/02-test-without-crds-values.yaml b/packages/rancher-monitoring/generated-changes/exclude/ci/02-test-without-crds-values.yaml new file mode 100644 index 0000000000..1ecf199c3d --- /dev/null +++ b/packages/rancher-monitoring/generated-changes/exclude/ci/02-test-without-crds-values.yaml @@ -0,0 +1,10 @@ +prometheusOperator: + namespaces: + releaseNamespace: true + additional: + - kube-system + +prometheus-node-exporter: + service: + targetPort: 9101 + port: 9101 diff --git a/packages/rancher-monitoring/generated-changes/exclude/hack/README.md b/packages/rancher-monitoring/generated-changes/exclude/hack/README.md new file mode 100644 index 0000000000..3d42737410 --- /dev/null +++ b/packages/rancher-monitoring/generated-changes/exclude/hack/README.md @@ -0,0 +1,53 @@ +# kube-prometheus-stack hacks + +## [sync_prometheus_rules.py](sync_prometheus_rules.py) + +This script generates prometheus rules set for alertmanager from any properly formatted kubernetes yaml based on defined input, splitting rules to separate files based on group name. + +Currently following imported: + +- [prometheus-operator/kube-prometheus rules set](https://github.com/prometheus-operator/kube-prometheus/tree/master/manifests/kubernetes-prometheusRule.yaml) + - In order to modify these rules: + - prepare and merge PR into [kubernetes-mixin](https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/rules) master and/or release branch + - run import inside your fork of [prometheus-operator/kube-prometheus](https://github.com/prometheus-operator/kube-prometheus/tree/master) + + ```bash + jb update + make generate + ``` + + - prepare and merge PR with imported changes into `prometheus-operator/kube-prometheus` master and/or release branch + - run sync_prometheus_rules.py inside your fork of this repo + - send PR with changes to this repo +- [etcd-io/website rules set](https://github.com/etcd-io/website/tree/master/content/docs/v3.4.0/etcd-mixin/README.md) + - In order to modify these rules: + - prepare and merge PR into [etcd-io/website](https://github.com/etcd-io/website/blob/master/content/docs/v3.4.0/etcd-mixin/mixin.libsonnet) repo + - run sync_prometheus_rules.py inside your fork of this repo + - send PR with changes to this repo + +## [sync_grafana_dashboards.py](sync_grafana_dashboards.py) + +This script generates grafana dashboards from json files, splitting them to separate files based on group name. + +Currently following imported: + +- [prometheus-operator/kube-prometheus dashboards](https://github.com/prometheus-operator/kube-prometheus/tree/master/manifests/grafana-deployment.yaml) + - In order to modify these dashboards: + - prepare and merge PR into [kubernetes-mixin](https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/dashboards) master and/or release branch + - run import inside your fork of [prometheus-operator/kube-prometheus](https://github.com/prometheus-operator/kube-prometheus/tree/master) + + ```bash + jb update + make generate + ``` + + - prepare and merge PR with imported changes into `prometheus-operator/kube-prometheus` master and/or release branch + - run sync_grafana_dashboards.py inside your fork of this repo + - send PR with changes to this repo +- [etcd-io/website dashboard](https://github.com/etcd-io/website/blob/master/content/docs/v3.4.0/op-guide/grafana.json) + - In order to modify this dashboard: + - prepare and merge PR into [etcd-io/website](https://github.com/etcd-io/website/blob/master/content/docs/v3.4.0/op-guide/grafana.json) repo + - run sync_grafana_dashboards.py inside your fork of this repo + - send PR with changes to this repo + +[CoreDNS dashboard](https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/k8s-coredns.yaml) is the only dashboard which is maintained in this repo and can be changed without import. diff --git a/packages/rancher-monitoring/generated-changes/exclude/hack/minikube/README.md b/packages/rancher-monitoring/generated-changes/exclude/hack/minikube/README.md new file mode 100644 index 0000000000..353967ede5 --- /dev/null +++ b/packages/rancher-monitoring/generated-changes/exclude/hack/minikube/README.md @@ -0,0 +1,5 @@ +# Testing on Minikube + +The configuration in this folder lets you locally test the setup on minikube. Use cmd.sh to set up components and hack a working etcd scrape configuration. Run the commands in the sequence listed in the script to get a local working minikube cluster. + +If you're using windows, there's a commented-out section that you should add to the minikube command. diff --git a/packages/rancher-monitoring/generated-changes/exclude/hack/minikube/cmd.sh b/packages/rancher-monitoring/generated-changes/exclude/hack/minikube/cmd.sh new file mode 100644 index 0000000000..2df3402a73 --- /dev/null +++ b/packages/rancher-monitoring/generated-changes/exclude/hack/minikube/cmd.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash + +HELM_RELEASE_NAME=prom-op +CHART=./ +NAMESPACE=monitoring +VALUES_FILES=./hack/minikube/values.yaml + +if [ "$1" = "reset-minikube" ]; then + minikube delete + minikube start \ + #--vm-driver hyperv --hyperv-virtual-switch "Default Switch" \ + --kubernetes-version=v1.13.3 \ + --memory=4096 --bootstrapper=kubeadm \ + --extra-config=kubelet.authentication-token-webhook=true \ + --extra-config=kubelet.authorization-mode=Webhook \ + --extra-config=scheduler.address=0.0.0.0 \ + --extra-config=controller-manager.address=0.0.0.0 + exit 0 +fi + +if [ "$1" = "init-helm" ]; then + helm init + helm repo update + exit 0 +fi + +if [ "$1" = "init-etcd-secret" ]; then + kubectl create namespace monitoring + kubectl delete secret etcd-certs -nmonitoring + kubectl create secret generic etcd-certs -nmonitoring \ + --from-literal=ca.crt="$(kubectl exec kube-apiserver-minikube -nkube-system -- cat /var/lib/minikube/certs/etcd/ca.crt)" \ + --from-literal=client.crt="$(kubectl exec kube-apiserver-minikube -nkube-system -- cat /var/lib/minikube/certs/apiserver-etcd-client.crt)" \ + --from-literal=client.key="$(kubectl exec kube-apiserver-minikube -nkube-system -- cat /var/lib/minikube/certs/apiserver-etcd-client.key)" + + exit 0 +fi + + +if [ "$1" = "upgrade-install" ]; then + helm upgrade $HELM_RELEASE_NAME $CHART \ + --namespace $NAMESPACE \ + --values $VALUES_FILES \ + --set grafana.podAnnotations.redeploy-hack="$(cat /proc/sys/kernel/random/uuid)" \ + --install --debug + exit 0 +fi + +if [ "$1" = "port-forward" ]; then + killall kubectl &>/dev/null + kubectl port-forward service/prom-op-prometheus-operato-prometheus 9090 &>/dev/null & + kubectl port-forward service/prom-op-prometheus-operato-alertmanager 9093 &>/dev/null & + kubectl port-forward service/prom-op-grafana 3000:80 &>/dev/null & + echo "Started port-forward commands" + echo "localhost:9090 - prometheus" + echo "localhost:9093 - alertmanager" + echo "localhost:3000 - grafana" + exit 0 +fi + +cat << EOF +Usage: + install.sh + +Commands: + reset-minikube - resets minikube with values suitable for running prometheus operator + the normal installation will not allow scraping of the kubelet, + scheduler or controller-manager components + init-helm - initialize helm and update repository so that we can install + the kube-prometheus-stack chart. This has to be run only once after + a minikube installation is done + init-etcd-secret - pulls the certs used to access etcd from the api server and creates + a secret in the monitoring namespace with them. The values files + in the install command assume that this secret exists and is valid. + If not, then prometheus will not start + upgrade-install - install or upgrade the kube-prometheus-stack chart in the cluster + port-forward - starts port-forwarding for prometheus, alertmanager, grafana + localhost:9090 - prometheus + localhost:9093 - alertmanager + localhost:3000 - grafana +EOF + +exit 0 +} + diff --git a/packages/rancher-monitoring/generated-changes/exclude/hack/minikube/values.yaml b/packages/rancher-monitoring/generated-changes/exclude/hack/minikube/values.yaml new file mode 100644 index 0000000000..8bdce3131f --- /dev/null +++ b/packages/rancher-monitoring/generated-changes/exclude/hack/minikube/values.yaml @@ -0,0 +1,9 @@ +prometheus: + prometheusSpec: + secrets: [etcd-certs] +kubeEtcd: + serviceMonitor: + scheme: https + caFile: /etc/prometheus/secrets/etcd-certs/ca.crt + certFile: /etc/prometheus/secrets/etcd-certs/client.crt + keyFile: /etc/prometheus/secrets/etcd-certs/client.key \ No newline at end of file diff --git a/packages/rancher-monitoring/generated-changes/exclude/hack/requirements.txt b/packages/rancher-monitoring/generated-changes/exclude/hack/requirements.txt new file mode 100644 index 0000000000..bc2fde78b5 --- /dev/null +++ b/packages/rancher-monitoring/generated-changes/exclude/hack/requirements.txt @@ -0,0 +1,2 @@ +PyYAML==5.1.2 +requests==2.22.0 diff --git a/packages/rancher-monitoring/generated-changes/exclude/hack/sync_grafana_dashboards.py b/packages/rancher-monitoring/generated-changes/exclude/hack/sync_grafana_dashboards.py new file mode 100644 index 0000000000..6777d8287a --- /dev/null +++ b/packages/rancher-monitoring/generated-changes/exclude/hack/sync_grafana_dashboards.py @@ -0,0 +1,228 @@ +#!/usr/bin/env python3 +"""Fetch dashboards from provided urls into this chart.""" +import json +import textwrap +from os import makedirs, path + +import requests +import yaml +from yaml.representer import SafeRepresenter + + +# https://stackoverflow.com/a/20863889/961092 +class LiteralStr(str): + pass + + +def change_style(style, representer): + def new_representer(dumper, data): + scalar = representer(dumper, data) + scalar.style = style + return scalar + + return new_representer + + +# Source files list +charts = [ + { + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/master/manifests/grafana-dashboardDefinitions.yaml', + 'destination': '../templates/grafana/dashboards-1.14', + 'type': 'yaml', + 'min_kubernetes': '1.14.0-0' + }, + { + 'source': 'https://raw.githubusercontent.com/etcd-io/website/master/content/docs/current/op-guide/grafana.json', + 'destination': '../templates/grafana/dashboards-1.14', + 'type': 'json', + 'min_kubernetes': '1.14.0-0' + }, + { + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/release-0.1/manifests/grafana-dashboardDefinitions.yaml', + 'destination': '../templates/grafana/dashboards', + 'type': 'yaml', + 'min_kubernetes': '1.10.0-0', + 'max_kubernetes': '1.14.0-0' + }, + { + 'source': 'https://raw.githubusercontent.com/etcd-io/website/master/content/docs/current/op-guide/grafana.json', + 'destination': '../templates/grafana/dashboards', + 'type': 'json', + 'min_kubernetes': '1.10.0-0', + 'max_kubernetes': '1.14.0-0' + }, +] + +# Additional conditions map +condition_map = { + 'grafana-coredns-k8s': ' .Values.coreDns.enabled', + 'etcd': ' .Values.kubeEtcd.enabled', + 'apiserver': ' .Values.kubeApiServer.enabled', + 'controller-manager': ' .Values.kubeControllerManager.enabled', + 'kubelet': ' .Values.kubelet.enabled', + 'proxy': ' .Values.kubeProxy.enabled', + 'scheduler': ' .Values.kubeScheduler.enabled', + 'node-rsrc-use': ' .Values.nodeExporter.enabled', + 'node-cluster-rsrc-use': ' .Values.nodeExporter.enabled', + 'prometheus-remote-write': ' .Values.prometheus.prometheusSpec.remoteWriteDashboards' +} + +# standard header +header = '''{{- /* +Generated from '%(name)s' from %(url)s +Do not change in-place! In order to change this file first read following link: +https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack +*/ -}} +{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} +{{- if and (semverCompare ">=%(min_kubernetes)s" $kubeTargetVersion) (semverCompare "<%(max_kubernetes)s" $kubeTargetVersion) .Values.grafana.enabled .Values.grafana.defaultDashboardsEnabled%(condition)s }} +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: {{ template "kube-prometheus-stack.namespace" . }} + name: {{ printf "%%s-%%s" (include "kube-prometheus-stack.fullname" $) "%(name)s" | trunc 63 | trimSuffix "-" }} + annotations: +{{ toYaml .Values.grafana.sidecar.dashboards.annotations | indent 4 }} + labels: + {{- if $.Values.grafana.sidecar.dashboards.label }} + {{ $.Values.grafana.sidecar.dashboards.label }}: "1" + {{- end }} + app: {{ template "kube-prometheus-stack.name" $ }}-grafana +{{ include "kube-prometheus-stack.labels" $ | indent 4 }} +data: +''' + + +def init_yaml_styles(): + represent_literal_str = change_style('|', SafeRepresenter.represent_str) + yaml.add_representer(LiteralStr, represent_literal_str) + + +def escape(s): + return s.replace("{{", "{{`{{").replace("}}", "}}`}}").replace("{{`{{", "{{`{{`}}").replace("}}`}}", "{{`}}`}}") + + +def unescape(s): + return s.replace("\{\{", "{{").replace("\}\}", "}}") + + +def yaml_str_repr(struct, indent=2): + """represent yaml as a string""" + text = yaml.dump( + struct, + width=1000, # to disable line wrapping + default_flow_style=False # to disable multiple items on single line + ) + text = escape(text) # escape {{ and }} for helm + text = unescape(text) # unescape \{\{ and \}\} for templating + text = textwrap.indent(text, ' ' * indent) + return text + + +def patch_json_for_multicluster_configuration(content): + try: + content_struct = json.loads(content) + overwrite_list = [] + for variable in content_struct['templating']['list']: + if variable['name'] == 'cluster': + variable['hide'] = ':multicluster:' + overwrite_list.append(variable) + content_struct['templating']['list'] = overwrite_list + content_array = [] + original_content_lines = content.split('\n') + for i, line in enumerate(json.dumps(content_struct, indent=4).split('\n')): + if ('[]' not in line and '{}' not in line) or line == original_content_lines[i]: + content_array.append(line) + continue + + append = '' + if line.endswith(','): + line = line[:-1] + append = ',' + + if line.endswith('{}') or line.endswith('[]'): + content_array.append(line[:-1]) + content_array.append('') + content_array.append(' ' * (len(line) - len(line.lstrip())) + line[-1] + append) + + content = '\n'.join(content_array) + + multicluster = content.find(':multicluster:') + if multicluster != -1: + content = ''.join(( + content[:multicluster-1], + '\{\{ if .Values.grafana.sidecar.dashboards.multicluster \}\}0\{\{ else \}\}2\{\{ end \}\}', + content[multicluster + 15:] + )) + except (ValueError, KeyError): + pass + + return content + + +def write_group_to_file(resource_name, content, url, destination, min_kubernetes, max_kubernetes): + # initialize header + lines = header % { + 'name': resource_name, + 'url': url, + 'condition': condition_map.get(resource_name, ''), + 'min_kubernetes': min_kubernetes, + 'max_kubernetes': max_kubernetes + } + + content = patch_json_for_multicluster_configuration(content) + + filename_struct = {resource_name + '.json': (LiteralStr(content))} + # rules themselves + lines += yaml_str_repr(filename_struct) + + # footer + lines += '{{- end }}' + + filename = resource_name + '.yaml' + new_filename = "%s/%s" % (destination, filename) + + # make sure directories to store the file exist + makedirs(destination, exist_ok=True) + + # recreate the file + with open(new_filename, 'w') as f: + f.write(lines) + + print("Generated %s" % new_filename) + + +def main(): + init_yaml_styles() + # read the rules, create a new template file per group + for chart in charts: + print("Generating rules from %s" % chart['source']) + response = requests.get(chart['source']) + if response.status_code != 200: + print('Skipping the file, response code %s not equals 200' % response.status_code) + continue + raw_text = response.text + + if ('max_kubernetes' not in chart): + chart['max_kubernetes']="9.9.9-9" + + if chart['type'] == 'yaml': + yaml_text = yaml.full_load(raw_text) + groups = yaml_text['items'] + for group in groups: + for resource, content in group['data'].items(): + write_group_to_file(resource.replace('.json', ''), content, chart['source'], chart['destination'], chart['min_kubernetes'], chart['max_kubernetes']) + elif chart['type'] == 'json': + json_text = json.loads(raw_text) + # is it already a dashboard structure or is it nested (etcd case)? + flat_structure = bool(json_text.get('annotations')) + if flat_structure: + resource = path.basename(chart['source']).replace('.json', '') + write_group_to_file(resource, json.dumps(json_text, indent=4), chart['source'], chart['destination'], chart['min_kubernetes'], chart['max_kubernetes']) + else: + for resource, content in json_text.items(): + write_group_to_file(resource.replace('.json', ''), json.dumps(content, indent=4), chart['source'], chart['destination'], chart['min_kubernetes'], chart['max_kubernetes']) + print("Finished") + + +if __name__ == '__main__': + main() diff --git a/packages/rancher-monitoring/generated-changes/exclude/hack/sync_prometheus_rules.py b/packages/rancher-monitoring/generated-changes/exclude/hack/sync_prometheus_rules.py new file mode 100644 index 0000000000..c35cd0baa6 --- /dev/null +++ b/packages/rancher-monitoring/generated-changes/exclude/hack/sync_prometheus_rules.py @@ -0,0 +1,327 @@ +#!/usr/bin/env python3 +"""Fetch alerting and aggregation rules from provided urls into this chart.""" +import textwrap +from os import makedirs + +import requests +import yaml +from yaml.representer import SafeRepresenter +import re + +# https://stackoverflow.com/a/20863889/961092 +class LiteralStr(str): + pass + + +def change_style(style, representer): + def new_representer(dumper, data): + scalar = representer(dumper, data) + scalar.style = style + return scalar + + return new_representer + + +# Source files list +charts = [ + { + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/master/manifests/kubernetes-prometheusRule.yaml', + 'destination': '../templates/prometheus/rules-1.14', + 'min_kubernetes': '1.14.0-0' + }, + { + 'source': 'https://raw.githubusercontent.com/etcd-io/website/master/content/docs/v3.4.0/op-guide/etcd3_alert.rules.yml', + 'destination': '../templates/prometheus/rules-1.14', + 'min_kubernetes': '1.14.0-0' + }, + { + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/release-0.1/manifests/prometheus-rules.yaml', + 'destination': '../templates/prometheus/rules', + 'min_kubernetes': '1.10.0-0', + 'max_kubernetes': '1.14.0-0' + }, + { + 'source': 'https://raw.githubusercontent.com/etcd-io/website/master/content/docs/v3.4.0/op-guide/etcd3_alert.rules.yml', + 'destination': '../templates/prometheus/rules', + 'min_kubernetes': '1.10.0-0', + 'max_kubernetes': '1.14.0-0' + }, +] + +# Additional conditions map +condition_map = { + 'alertmanager.rules': ' .Values.defaultRules.rules.alertmanager', + 'general.rules': ' .Values.defaultRules.rules.general', + 'k8s.rules': ' .Values.defaultRules.rules.k8s', + 'kube-apiserver.rules': ' .Values.kubeApiServer.enabled .Values.defaultRules.rules.kubeApiserver', + 'kube-apiserver-availability.rules': ' .Values.kubeApiServer.enabled .Values.defaultRules.rules.kubeApiserverAvailability', + 'kube-apiserver-error': ' .Values.kubeApiServer.enabled .Values.defaultRules.rules.kubeApiserverError', + 'kube-apiserver-slos': ' .Values.kubeApiServer.enabled .Values.defaultRules.rules.kubeApiserverSlos', + 'kube-prometheus-general.rules': ' .Values.defaultRules.rules.kubePrometheusGeneral', + 'kube-prometheus-node-alerting.rules': ' .Values.defaultRules.rules.kubePrometheusNodeAlerting', + 'kube-prometheus-node-recording.rules': ' .Values.defaultRules.rules.kubePrometheusNodeRecording', + 'kube-scheduler.rules': ' .Values.kubeScheduler.enabled .Values.defaultRules.rules.kubeScheduler', + 'kube-state-metrics': ' .Values.defaultRules.rules.kubeStateMetrics', + 'kubelet.rules': ' .Values.kubelet.enabled .Values.defaultRules.rules.kubelet', + 'kubernetes-absent': ' .Values.defaultRules.rules.kubernetesAbsent', + 'kubernetes-resources': ' .Values.defaultRules.rules.kubernetesResources', + 'kubernetes-storage': ' .Values.defaultRules.rules.kubernetesStorage', + 'kubernetes-system': ' .Values.defaultRules.rules.kubernetesSystem', + 'kubernetes-system-apiserver': ' .Values.defaultRules.rules.kubernetesSystem', # kubernetes-system was split into more groups in 1.14, one of them is kubernetes-system-apiserver + 'kubernetes-system-kubelet': ' .Values.defaultRules.rules.kubernetesSystem', # kubernetes-system was split into more groups in 1.14, one of them is kubernetes-system-kubelet + 'kubernetes-system-controller-manager': ' .Values.kubeControllerManager.enabled', + 'kubernetes-system-scheduler': ' .Values.kubeScheduler.enabled .Values.defaultRules.rules.kubeScheduler', + 'node-exporter.rules': ' .Values.defaultRules.rules.node', + 'node-exporter': ' .Values.defaultRules.rules.node', + 'node.rules': ' .Values.defaultRules.rules.node', + 'node-network': ' .Values.defaultRules.rules.network', + 'node-time': ' .Values.defaultRules.rules.time', + 'prometheus-operator': ' .Values.defaultRules.rules.prometheusOperator', + 'prometheus.rules': ' .Values.defaultRules.rules.prometheus', + 'prometheus': ' .Values.defaultRules.rules.prometheus', # kube-prometheus >= 1.14 uses prometheus as group instead of prometheus.rules + 'kubernetes-apps': ' .Values.defaultRules.rules.kubernetesApps', + 'etcd': ' .Values.kubeEtcd.enabled .Values.defaultRules.rules.etcd', +} + +alert_condition_map = { + 'KubeAPIDown': '.Values.kubeApiServer.enabled', # there are more alerts which are left enabled, because they'll never fire without metrics + 'KubeControllerManagerDown': '.Values.kubeControllerManager.enabled', + 'KubeSchedulerDown': '.Values.kubeScheduler.enabled', + 'KubeStateMetricsDown': '.Values.kubeStateMetrics.enabled', # there are more alerts which are left enabled, because they'll never fire without metrics + 'KubeletDown': '.Values.prometheusOperator.kubeletService.enabled', # there are more alerts which are left enabled, because they'll never fire without metrics + 'PrometheusOperatorDown': '.Values.prometheusOperator.enabled', + 'NodeExporterDown': '.Values.nodeExporter.enabled', + 'CoreDNSDown': '.Values.kubeDns.enabled', + 'AlertmanagerDown': '.Values.alertmanager.enabled', +} + +replacement_map = { + 'job="prometheus-operator"': { + 'replacement': 'job="{{ $operatorJob }}"', + 'init': '{{- $operatorJob := printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "operator" }}'}, + 'job="prometheus-k8s"': { + 'replacement': 'job="{{ $prometheusJob }}"', + 'init': '{{- $prometheusJob := printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "prometheus" }}'}, + 'job="alertmanager-main"': { + 'replacement': 'job="{{ $alertmanagerJob }}"', + 'init': '{{- $alertmanagerJob := printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "alertmanager" }}'}, + 'namespace="monitoring"': { + 'replacement': 'namespace="{{ $namespace }}"', + 'init': '{{- $namespace := printf "%s" (include "kube-prometheus-stack.namespace" .) }}'}, + 'alertmanager-$1': { + 'replacement': '$1', + 'init': ''}, + 'https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#': { + 'replacement': '{{ .Values.defaultRules.runbookUrl }}', + 'init': ''}, + 'https://github.com/prometheus-operator/kube-prometheus/wiki/': { + 'replacement': '{{ .Values.defaultRules.runbookUrl }}alert-name-', + 'init': ''}, + 'job="kube-state-metrics"': { + 'replacement': 'job="kube-state-metrics", namespace=~"{{ $targetNamespace }}"', + 'limitGroup': ['kubernetes-apps'], + 'init': '{{- $targetNamespace := .Values.defaultRules.appNamespacesTarget }}'}, + 'job="kubelet"': { + 'replacement': 'job="kubelet", namespace=~"{{ $targetNamespace }}"', + 'limitGroup': ['kubernetes-storage'], + 'init': '{{- $targetNamespace := .Values.defaultRules.appNamespacesTarget }}'}, +} + +# standard header +header = '''{{- /* +Generated from '%(name)s' group from %(url)s +Do not change in-place! In order to change this file first read following link: +https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack +*/ -}} +{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} +{{- if and (semverCompare ">=%(min_kubernetes)s" $kubeTargetVersion) (semverCompare "<%(max_kubernetes)s" $kubeTargetVersion) .Values.defaultRules.create%(condition)s }}%(init_line)s +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ printf "%%s-%%s" (include "kube-prometheus-stack.fullname" .) "%(name)s" | trunc 63 | trimSuffix "-" }} + namespace: {{ template "kube-prometheus-stack.namespace" . }} + labels: + app: {{ template "kube-prometheus-stack.name" . }} +{{ include "kube-prometheus-stack.labels" . | indent 4 }} +{{- if .Values.defaultRules.labels }} +{{ toYaml .Values.defaultRules.labels | indent 4 }} +{{- end }} +{{- if .Values.defaultRules.annotations }} + annotations: +{{ toYaml .Values.defaultRules.annotations | indent 4 }} +{{- end }} +spec: + groups: + -''' + + +def init_yaml_styles(): + represent_literal_str = change_style('|', SafeRepresenter.represent_str) + yaml.add_representer(LiteralStr, represent_literal_str) + + +def escape(s): + return s.replace("{{", "{{`{{").replace("}}", "}}`}}").replace("{{`{{", "{{`{{`}}").replace("}}`}}", "{{`}}`}}") + + +def fix_expr(rules): + """Remove trailing whitespaces and line breaks, which happen to creep in + due to yaml import specifics; + convert multiline expressions to literal style, |-""" + for rule in rules: + rule['expr'] = rule['expr'].rstrip() + if '\n' in rule['expr']: + rule['expr'] = LiteralStr(rule['expr']) + + +def yaml_str_repr(struct, indent=4): + """represent yaml as a string""" + text = yaml.dump( + struct, + width=1000, # to disable line wrapping + default_flow_style=False # to disable multiple items on single line + ) + text = escape(text) # escape {{ and }} for helm + text = textwrap.indent(text, ' ' * indent)[indent - 1:] # indent everything, and remove very first line extra indentation + return text + + +def add_rules_conditions(rules, indent=4): + """Add if wrapper for rules, listed in alert_condition_map""" + rule_condition = '{{- if %s }}\n' + for alert_name in alert_condition_map: + line_start = ' ' * indent + '- alert: ' + if line_start + alert_name in rules: + rule_text = rule_condition % alert_condition_map[alert_name] + # add if condition + index = rules.index(line_start + alert_name) + rules = rules[:index] + rule_text + rules[index:] + # add end of if + try: + next_index = rules.index(line_start, index + len(rule_text) + 1) + except ValueError: + # we found the last alert in file if there are no alerts after it + next_index = len(rules) + + # depending on the rule ordering in alert_condition_map it's possible that an if statement from another rule is present at the end of this block. + found_block_end = False + last_line_index = next_index + while not found_block_end: + last_line_index = rules.rindex('\n', index, last_line_index - 1) # find the starting position of the last line + last_line = rules[last_line_index + 1:next_index] + + if last_line.startswith('{{- if'): + next_index = last_line_index + 1 # move next_index back if the current block ends in an if statement + continue + + found_block_end = True + + rules = rules[:next_index] + '{{- end }}\n' + rules[next_index:] + return rules + + +def add_custom_labels(rules, indent=4): + """Add if wrapper for additional rules labels""" + rule_condition = '{{- if .Values.defaultRules.additionalRuleLabels }}\n{{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }}\n{{- end }}' + rule_condition_len = len(rule_condition) + 1 + + separator = " " * indent + "- alert:.*" + alerts_positions = re.finditer(separator,rules) + alert=-1 + for alert_position in alerts_positions: + # add rule_condition at the end of the alert block + if alert >= 0 : + index = alert_position.start() + rule_condition_len * alert - 1 + rules = rules[:index] + "\n" + rule_condition + rules[index:] + alert += 1 + + # add rule_condition at the end of the last alert + if alert >= 0: + index = len(rules) - 1 + rules = rules[:index] + "\n" + rule_condition + rules[index:] + return rules + +def write_group_to_file(group, url, destination, min_kubernetes, max_kubernetes): + fix_expr(group['rules']) + group_name = group['name'] + + # prepare rules string representation + rules = yaml_str_repr(group) + # add replacements of custom variables and include their initialisation in case it's needed + init_line = '' + for line in replacement_map: + if group_name in replacement_map[line].get('limitGroup', [group_name]) and line in rules: + rules = rules.replace(line, replacement_map[line]['replacement']) + if replacement_map[line]['init']: + init_line += '\n' + replacement_map[line]['init'] + # append per-alert rules + rules = add_custom_labels(rules) + rules = add_rules_conditions(rules) + # initialize header + lines = header % { + 'name': group['name'], + 'url': url, + 'condition': condition_map.get(group['name'], ''), + 'init_line': init_line, + 'min_kubernetes': min_kubernetes, + 'max_kubernetes': max_kubernetes + } + + # rules themselves + lines += rules + + # footer + lines += '{{- end }}' + + filename = group['name'] + '.yaml' + new_filename = "%s/%s" % (destination, filename) + + # make sure directories to store the file exist + makedirs(destination, exist_ok=True) + + # recreate the file + with open(new_filename, 'w') as f: + f.write(lines) + + print("Generated %s" % new_filename) + +def write_rules_names_template(): + with open('../templates/prometheus/_rules.tpl', 'w') as f: + f.write('''{{- /* +Generated file. Do not change in-place! In order to change this file first read following link: +https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack +*/ -}}\n''') + f.write('{{- define "rules.names" }}\n') + f.write('rules:\n') + for rule in condition_map: + f.write(' - "%s"\n' % rule) + f.write('{{- end }}') + +def main(): + init_yaml_styles() + # read the rules, create a new template file per group + for chart in charts: + print("Generating rules from %s" % chart['source']) + response = requests.get(chart['source']) + if response.status_code != 200: + print('Skipping the file, response code %s not equals 200' % response.status_code) + continue + raw_text = response.text + yaml_text = yaml.full_load(raw_text) + + if ('max_kubernetes' not in chart): + chart['max_kubernetes']="9.9.9-9" + + # etcd workaround, their file don't have spec level + groups = yaml_text['spec']['groups'] if yaml_text.get('spec') else yaml_text['groups'] + for group in groups: + write_group_to_file(group, chart['source'], chart['destination'], chart['min_kubernetes'], chart['max_kubernetes']) + + # write rules.names named template + write_rules_names_template() + + print("Finished") + + +if __name__ == '__main__': + main() diff --git a/packages/rancher-monitoring/generated-changes/exclude/hack/update_crds.sh b/packages/rancher-monitoring/generated-changes/exclude/hack/update_crds.sh new file mode 100644 index 0000000000..53d63f666f --- /dev/null +++ b/packages/rancher-monitoring/generated-changes/exclude/hack/update_crds.sh @@ -0,0 +1,26 @@ +#!/bin/bash -eu + +VERSION=$1 + +[ -z "${VERSION}" ] && echo "Pass prometheus-operator version as first comandline argument" && exit 1 + +FILES=( + "crd-alertmanagerconfigs.yaml : monitoring.coreos.com_alertmanagerconfigs.yaml" + "crd-alertmanagers.yaml : monitoring.coreos.com_alertmanagers.yaml" + "crd-podmonitors.yaml : monitoring.coreos.com_podmonitors.yaml" + "crd-probes.yaml : monitoring.coreos.com_probes.yaml" + "crd-prometheuses.yaml : monitoring.coreos.com_prometheuses.yaml" + "crd-prometheusrules.yaml : monitoring.coreos.com_prometheusrules.yaml" + "crd-servicemonitors.yaml : monitoring.coreos.com_servicemonitors.yaml" + "crd-thanosrulers.yaml : monitoring.coreos.com_thanosrulers.yaml" +) + +for line in "${FILES[@]}" ; do + DESTINATION=$(echo "${line%%:*}" | xargs) + SOURCE=$(echo "${line##*:}" | xargs) + + URL="https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/$VERSION/example/prometheus-operator-crd/$SOURCE" + echo "# ${URL}" > ../crds/"${DESTINATION}" + curl -L "${URL}" >> ../crds/"${DESTINATION}" + +done diff --git a/packages/rancher-monitoring/generated-changes/exclude/templates/prometheus-operator/cleanup-crds.yaml b/packages/rancher-monitoring/generated-changes/exclude/templates/prometheus-operator/cleanup-crds.yaml deleted file mode 100644 index 4fd21e7730..0000000000 --- a/packages/rancher-monitoring/generated-changes/exclude/templates/prometheus-operator/cleanup-crds.yaml +++ /dev/null @@ -1,49 +0,0 @@ -{{- if and .Values.prometheusOperator.enabled .Values.prometheusOperator.cleanupCustomResource }} -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ template "kube-prometheus-stack.fullname" . }}-operator-cleanup - namespace: {{ template "kube-prometheus-stack.namespace" . }} - annotations: - "helm.sh/hook": pre-delete - "helm.sh/hook-weight": "3" - "helm.sh/hook-delete-policy": hook-succeeded - labels: - app: {{ template "kube-prometheus-stack.name" . }}-operator -{{ include "kube-prometheus-stack.labels" . | indent 4 }} -spec: - template: - metadata: - name: {{ template "kube-prometheus-stack.fullname" . }}-operator-cleanup - labels: - app: {{ template "kube-prometheus-stack.name" . }}-operator -{{ include "kube-prometheus-stack.labels" . | indent 8 }} - spec: - {{- if .Values.global.rbac.create }} - serviceAccountName: {{ template "kube-prometheus-stack.operator.serviceAccountName" . }} - {{- end }} - containers: - - name: kubectl - {{- if .Values.prometheusOperator.hyperkubeImage.sha }} - image: {{ .Values.prometheusOperator.hyperkubeImage.repository }}:{{ .Values.prometheusOperator.hyperkubeImage.tag }}@sha256:{{ .Values.prometheusOperator.hyperkubeImage.sha }} - {{- else }} - image: "{{ .Values.prometheusOperator.hyperkubeImage.repository }}:{{ .Values.prometheusOperator.hyperkubeImage.tag }}" - {{- end }} - imagePullPolicy: "{{ .Values.prometheusOperator.hyperkubeImage.pullPolicy }}" - command: - - /bin/sh - - -c - - > - kubectl delete alertmanager --all; - kubectl delete prometheus --all; - kubectl delete prometheusrule --all; - kubectl delete servicemonitor --all; - sleep 10; - kubectl delete crd alertmanagers.monitoring.coreos.com; - kubectl delete crd prometheuses.monitoring.coreos.com; - kubectl delete crd prometheusrules.monitoring.coreos.com; - kubectl delete crd servicemonitors.monitoring.coreos.com; - kubectl delete crd podmonitors.monitoring.coreos.com; - kubectl delete crd thanosrulers.monitoring.coreos.com; - restartPolicy: OnFailure -{{- end }} diff --git a/packages/rancher-monitoring/generated-changes/exclude/templates/prometheus-operator/crds.yaml b/packages/rancher-monitoring/generated-changes/exclude/templates/prometheus-operator/crds.yaml deleted file mode 100644 index d6bca7ed58..0000000000 --- a/packages/rancher-monitoring/generated-changes/exclude/templates/prometheus-operator/crds.yaml +++ /dev/null @@ -1,6 +0,0 @@ -{{- if and .Values.prometheusOperator.enabled .Values.prometheusOperator.createCustomResource -}} -{{- range $path, $bytes := .Files.Glob "crds/*.yaml" }} -{{ $.Files.Get $path }} ---- -{{- end }} -{{- end }} diff --git a/packages/rancher-monitoring/generated-changes/overlay/CHANGELOG.md b/packages/rancher-monitoring/generated-changes/overlay/CHANGELOG.md index 973b34dfb6..8178169b91 100644 --- a/packages/rancher-monitoring/generated-changes/overlay/CHANGELOG.md +++ b/packages/rancher-monitoring/generated-changes/overlay/CHANGELOG.md @@ -18,7 +18,7 @@ All notable changes from the upstream Prometheus Operator chart will be added to - Added a default template `rancher_defaults.tmpl` to AlertManager that Rancher will offer to users in order to help configure the way alerts are rendered on a notifier. Also updated the default template deployed with this chart to reference that template and added an example of a Slack config using this template as a comment in the `values.yaml`. - Added support for private registries via introducing a new field for `global.cattle.systemDefaultRegistry` that, if supplied, will automatically be prepended onto every image used by the chart. - Added a default `nginx` proxy container deployed with Grafana whose config is set in the `ConfigMap` located in `charts/grafana/templates/nginx-config.yaml`. The purpose of this container is to make it possible to view Grafana's UI through a proxy that has a subpath (e.g. Rancher's proxy). This proxy container is set to listen on port `8080` (with a `portName` of `nginx-http` instead of the default `service`), which is also where the Grafana service will now point to, and will forward all requests to the Grafana container listening on the default port `3000`. -- Added a default `nginx` proxy container deployed with Prometheus whose config is set in the `ConfigMap` located in `templates/prometheus/nginx-config.yaml`. The purpose of this container is to make it possible to view Prometheus's UI through a proxy that has a subpath (e.g. Rancher's proxy). This proxy container is set to listen on port `8080` (with a `portName` of `nginx-http` instead of the default `web`), which is also where the Prometheus service will now point to, and will forward all requests to the Prometheus container listening on the default port `9090`. +- Added a default `nginx` proxy container deployed with Prometheus whose config is set in the `ConfigMap` located in `templates/prometheus/nginx-config.yaml`. The purpose of this container is to make it possible to view Prometheus's UI through a proxy that has a subpath (e.g. Rancher's proxy). This proxy container is set to listen on port `8081` (with a `portName` of `nginx-http` instead of the default `web`), which is also where the Prometheus service will now point to, and will forward all requests to the Prometheus container listening on the default port `9090`. - Added support for passing CIS Scans in a hardened cluster by introducing a Job that patches the default service account within the `cattle-monitoring-system` and `cattle-dashboards` namespaces on install or upgrade and adding a default allow all `NetworkPolicy` to the `cattle-monitoring-system` and `cattle-dashboards` namespaces. ### Modified - Updated the chart name from `prometheus-operator` to `rancher-monitoring` and added the `io.rancher.certified: rancher` annotation to `Chart.yaml` diff --git a/packages/rancher-monitoring/generated-changes/overlay/templates/prometheus/nginx-config.yaml b/packages/rancher-monitoring/generated-changes/overlay/templates/prometheus/nginx-config.yaml index bc169a72d8..3f346ca4c8 100644 --- a/packages/rancher-monitoring/generated-changes/overlay/templates/prometheus/nginx-config.yaml +++ b/packages/rancher-monitoring/generated-changes/overlay/templates/prometheus/nginx-config.yaml @@ -31,7 +31,7 @@ data: proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=my_zone:100m inactive=1d max_size=10g; server { - listen 8080; + listen 8081; access_log off; gzip on; diff --git a/packages/rancher-monitoring/generated-changes/overlay/templates/rancher-monitoring/clusterrole.yaml b/packages/rancher-monitoring/generated-changes/overlay/templates/rancher-monitoring/clusterrole.yaml index e6bc9d4764..a115de7ca9 100644 --- a/packages/rancher-monitoring/generated-changes/overlay/templates/rancher-monitoring/clusterrole.yaml +++ b/packages/rancher-monitoring/generated-changes/overlay/templates/rancher-monitoring/clusterrole.yaml @@ -28,6 +28,9 @@ rules: - podmonitors - prometheusrules - podmonitors + - probes + - probes/finalizers + - alertmanagerconfigs verbs: - '*' --- @@ -61,6 +64,8 @@ rules: - podmonitors - prometheusrules - podmonitors + - probes + - alertmanagerconfigs verbs: - '*' --- @@ -86,6 +91,9 @@ rules: - podmonitors - prometheusrules - podmonitors + - probes + - probes/finalizers + - alertmanagerconfigs verbs: - 'get' - 'list' diff --git a/packages/rancher-monitoring/generated-changes/patch/Chart.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/Chart.yaml.patch index 1c057baf7c..de7862b19c 100644 --- a/packages/rancher-monitoring/generated-changes/patch/Chart.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/Chart.yaml.patch @@ -1,27 +1,19 @@ --- charts-original/Chart.yaml +++ charts/Chart.yaml -@@ -5,18 +5,25 @@ - - name: Upstream Project - url: https://github.com/prometheus-operator/kube-prometheus - artifacthub.io/operator: "true" -+ catalog.cattle.io/certified: rancher -+ catalog.cattle.io/namespace: cattle-monitoring-system -+ catalog.cattle.io/release-name: rancher-monitoring -+ catalog.cattle.io/ui-component: monitoring -+ catalog.cattle.io/provides-gvr: monitoring.coreos.com.prometheus/v1 -+ catalog.cattle.io/display-name: "Monitoring" -+ catalog.cattle.io/auto-install: rancher-monitoring-crd=match -+ catalog.cattle.io/requests-cpu: "4500m" -+ catalog.cattle.io/requests-memory: "4000Mi" - apiVersion: v1 - appVersion: 0.38.1 +@@ -1,17 +1,15 @@ +-name: kube-prometheus-stack ++name: rancher-monitoring + home: https://github.com/prometheus-operator/kube-prometheus + sources: + - https://github.com/prometheus-community/helm-charts + - https://github.com/prometheus-operator/kube-prometheus +-version: 14.5.0 -description: kube-prometheus-stack collects Kubernetes manifests, Grafana dashboards, - and Prometheus rules combined with documentation and scripts to provide easy to - operate end-to-end Kubernetes cluster monitoring with Prometheus using the Prometheus - Operator. ++version: 14.5.1 +description: Collects several related Helm charts, Grafana dashboards, and Prometheus rules combined with documentation and scripts to provide easy to operate end-to-end Kubernetes cluster monitoring with Prometheus using the Prometheus Operator. - home: https://github.com/prometheus-operator/kube-prometheus - icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/assets/prometheus_logo-cb55bb5c346.png keywords: - operator - prometheus @@ -29,15 +21,30 @@ +- monitoring maintainers: - name: vsliouniaev - - name: bismarck -@@ -28,7 +35,9 @@ - name: scottrigby - - email: miroslav.hadzhiev@gmail.com - name: Xtigyro --name: kube-prometheus-stack -+- email: arvind.iyengar@suse.com -+ name: Arvind -+name: rancher-monitoring - sources: - - https://github.com/prometheus-community/helm-charts - - https://github.com/prometheus-operator/kube-prometheus + email: "" +@@ -31,6 +29,9 @@ + - name: Xtigyro + email: miroslav.hadzhiev@gmail.com + url: "" ++- name: Arvind ++ email: arvind.iyengar@suse.com ++ url: "" + icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/assets/prometheus_logo-cb55bb5c346.png + apiversion: v2 + condition: "" +@@ -44,6 +45,15 @@ + - name: Upstream Project + url: https://github.com/prometheus-operator/kube-prometheus + artifacthub.io/operator: "true" ++ catalog.cattle.io/certified: rancher ++ catalog.cattle.io/namespace: cattle-monitoring-system ++ catalog.cattle.io/release-name: rancher-monitoring ++ catalog.cattle.io/ui-component: monitoring ++ catalog.cattle.io/provides-gvr: monitoring.coreos.com.prometheus/v1 ++ catalog.cattle.io/display-name: "Monitoring" ++ catalog.cattle.io/auto-install: rancher-monitoring-crd=match ++ catalog.cattle.io/requests-cpu: "4500m" ++ catalog.cattle.io/requests-memory: "4000Mi" + kubeversion: '>=1.16.0-0' + dependencies: + - name: grafana diff --git a/packages/rancher-monitoring/generated-changes/patch/README.md.patch b/packages/rancher-monitoring/generated-changes/patch/README.md.patch index f6adf953ff..a00130adc6 100644 --- a/packages/rancher-monitoring/generated-changes/patch/README.md.patch +++ b/packages/rancher-monitoring/generated-changes/patch/README.md.patch @@ -1,15 +1,6 @@ --- charts-original/README.md +++ charts/README.md -@@ -15,7 +15,7 @@ - - ```console - helm repo add prometheus-community https://prometheus-community.github.io/helm-charts --helm repo add stable https://kubernetes-charts.storage.googleapis.com/ -+helm repo add stable https://charts.helm.sh/stable/ - helm repo update - ``` - -@@ -127,7 +127,41 @@ +@@ -171,7 +171,41 @@ helm show values prometheus-community/kube-prometheus-stack ``` @@ -52,12 +43,3 @@ ### Multiple releases -@@ -221,7 +255,7 @@ - - #### CoreOS CRDs - --The CRDs are provisioned using crd-install hooks, rather than relying on a separate chart installation. If you already have these CRDs provisioned and don't want to remove them, you can disable the CRD creation by these hooks by setting `prometheusOperator.createCustomResource` to `false` (not required if using Helm v3). -+The CRDs are provisioned using a separate chart installation within the Helm chart `rancher-monitoring-crd` that is packaged alongside this chart. - - #### Kubelet Service - diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/grafana/Chart.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/charts/grafana/Chart.yaml.patch deleted file mode 100644 index ef74ca0c4b..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/charts/grafana/Chart.yaml.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- charts-original/charts/grafana/Chart.yaml -+++ charts/charts/grafana/Chart.yaml -@@ -1,27 +1,17 @@ --name: grafana -+apiVersion: v1 -+appVersion: 7.1.5 -+description: The leading tool for querying and visualizing time series and metrics. - home: https://grafana.net -+icon: https://raw.githubusercontent.com/grafana/grafana/master/public/img/logo_transparent_400x.png -+kubeVersion: ^1.8.0-0 -+maintainers: -+- email: zanhsieh@gmail.com -+ name: zanhsieh -+- email: rluckie@cisco.com -+ name: rtluckie -+- email: maor.friedman@redhat.com -+ name: maorfr -+name: grafana - sources: - - https://github.com/grafana/grafana - version: 5.6.4 --description: The leading tool for querying and visualizing time series and metrics. --keywords: [] --maintainers: --- name: zanhsieh -- email: zanhsieh@gmail.com -- url: "" --- name: rtluckie -- email: rluckie@cisco.com -- url: "" --- name: maorfr -- email: maor.friedman@redhat.com -- url: "" --icon: https://raw.githubusercontent.com/grafana/grafana/master/public/img/logo_transparent_400x.png --apiversion: v1 --condition: "" --tags: "" --appversion: 7.1.5 --deprecated: false --annotations: {} --kubeversion: ^1.8.0-0 --dependencies: [] --type: "" diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/kube-state-metrics/Chart.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/charts/kube-state-metrics/Chart.yaml.patch deleted file mode 100644 index 834f59a25d..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/charts/kube-state-metrics/Chart.yaml.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- charts-original/charts/kube-state-metrics/Chart.yaml -+++ charts/charts/kube-state-metrics/Chart.yaml -@@ -1,31 +1,20 @@ --name: kube-state-metrics --home: https://github.com/kubernetes/kube-state-metrics/ --sources: --- https://github.com/kubernetes/kube-state-metrics/ --version: 2.8.14 -+apiVersion: v1 -+appVersion: 1.9.7 - description: Install kube-state-metrics to generate and expose cluster-level metrics -+home: https://github.com/kubernetes/kube-state-metrics/ - keywords: - - metric - - monitoring - - prometheus - - kubernetes - maintainers: --- name: fiunchinho -- email: jose@armesto.net -- url: "" --- name: tariq1890 -- email: tariq.ibrahim@mulesoft.com -- url: "" --- name: mrueg -- email: manuel@rueg.eu -- url: "" --icon: "" --apiversion: v1 --condition: "" --tags: "" --appversion: 1.9.7 --deprecated: false --annotations: {} --kubeversion: "" --dependencies: [] --type: "" -+- email: jose@armesto.net -+ name: fiunchinho -+- email: tariq.ibrahim@mulesoft.com -+ name: tariq1890 -+- email: manuel@rueg.eu -+ name: mrueg -+name: kube-state-metrics -+sources: -+- https://github.com/kubernetes/kube-state-metrics/ -+version: 2.8.14 diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/kube-state-metrics/values.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/charts/kube-state-metrics/values.yaml.patch deleted file mode 100644 index 7aa1d2e804..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/charts/kube-state-metrics/values.yaml.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- charts-original/charts/kube-state-metrics/values.yaml -+++ charts/charts/kube-state-metrics/values.yaml -@@ -1,7 +1,7 @@ - # Default values for kube-state-metrics. - prometheusScrape: true - image: -- repository: quay.io/coreos/kube-state-metrics -+ repository: rancher/mirrored-coreos-kube-state-metrics - tag: v1.9.7 - pullPolicy: IfNotPresent - -@@ -73,6 +73,7 @@ - - securityContext: - enabled: true -+ runAsNonRoot: true - runAsGroup: 65534 - runAsUser: 65534 - fsGroup: 65534 diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-adapter/Chart.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-adapter/Chart.yaml.patch deleted file mode 100644 index 1542b7841b..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-adapter/Chart.yaml.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- charts-original/charts/prometheus-adapter/Chart.yaml -+++ charts/charts/prometheus-adapter/Chart.yaml -@@ -1,32 +1,20 @@ --name: prometheus-adapter --home: https://github.com/DirectXMan12/k8s-prometheus-adapter --sources: --- https://github.com/kubernetes/charts --- https://github.com/DirectXMan12/k8s-prometheus-adapter --version: 2.7.1 -+apiVersion: v1 -+appVersion: v0.7.0 - description: A Helm chart for k8s prometheus adapter -+home: https://github.com/DirectXMan12/k8s-prometheus-adapter - keywords: - - hpa - - metrics - - prometheus - - adapter - maintainers: --- name: mattiasgees -- email: mattias.gees@jetstack.io -- url: "" -+- email: mattias.gees@jetstack.io -+ name: mattiasgees - - name: steven-sheehy -- email: "" -- url: "" --- name: hectorj2f -- email: hfernandez@mesosphere.com -- url: "" --icon: "" --apiversion: v1 --condition: "" --tags: "" --appversion: v0.7.0 --deprecated: false --annotations: {} --kubeversion: "" --dependencies: [] --type: "" -+- email: hfernandez@mesosphere.com -+ name: hectorj2f -+name: prometheus-adapter -+sources: -+- https://github.com/kubernetes/charts -+- https://github.com/DirectXMan12/k8s-prometheus-adapter -+version: 2.7.1 diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-adapter/values.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-adapter/values.yaml.patch deleted file mode 100644 index 6b4b750648..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-adapter/values.yaml.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- charts-original/charts/prometheus-adapter/values.yaml -+++ charts/charts/prometheus-adapter/values.yaml -@@ -2,7 +2,7 @@ - affinity: {} - - image: -- repository: directxman12/k8s-prometheus-adapter-amd64 -+ repository: rancher/mirrored-directxman12-k8s-prometheus-adapter-amd64 - tag: v0.7.0 - pullPolicy: IfNotPresent - diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-node-exporter/Chart.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-node-exporter/Chart.yaml.patch deleted file mode 100644 index 14d12e06fc..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-node-exporter/Chart.yaml.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- charts-original/charts/prometheus-node-exporter/Chart.yaml -+++ charts/charts/prometheus-node-exporter/Chart.yaml -@@ -1,27 +1,16 @@ --name: prometheus-node-exporter --home: https://github.com/prometheus/node_exporter/ --sources: --- https://github.com/prometheus/node_exporter/ --version: 1.11.2 -+apiVersion: v1 -+appVersion: 1.0.1 - description: A Helm chart for prometheus node-exporter -+home: https://github.com/prometheus/node_exporter/ - keywords: - - node-exporter - - prometheus - - exporter - maintainers: --- name: gianrubio -- email: gianrubio@gmail.com -- url: "" -+- email: gianrubio@gmail.com -+ name: gianrubio - - name: vsliouniaev -- email: "" -- url: "" --icon: "" --apiversion: v1 --condition: "" --tags: "" --appversion: 1.0.1 --deprecated: false --annotations: {} --kubeversion: "" --dependencies: [] --type: "" -+name: prometheus-node-exporter -+sources: -+- https://github.com/prometheus/node_exporter/ -+version: 1.11.2 diff --git a/packages/rancher-monitoring/generated-changes/patch/crds/crd-alertmanager.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/crds/crd-alertmanager.yaml.patch deleted file mode 100644 index 024935e2a9..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/crds/crd-alertmanager.yaml.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- charts-original/crds/crd-alertmanager.yaml -+++ charts/crds/crd-alertmanager.yaml -@@ -4,7 +4,6 @@ - metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.2.4 -- helm.sh/hook: crd-install - creationTimestamp: null - name: alertmanagers.monitoring.coreos.com - spec: diff --git a/packages/rancher-monitoring/generated-changes/patch/crds/crd-podmonitor.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/crds/crd-podmonitor.yaml.patch deleted file mode 100644 index e600416023..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/crds/crd-podmonitor.yaml.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- charts-original/crds/crd-podmonitor.yaml -+++ charts/crds/crd-podmonitor.yaml -@@ -4,7 +4,6 @@ - metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.2.4 -- helm.sh/hook: crd-install - creationTimestamp: null - name: podmonitors.monitoring.coreos.com - spec: diff --git a/packages/rancher-monitoring/generated-changes/patch/crds/crd-prometheus.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/crds/crd-prometheus.yaml.patch deleted file mode 100644 index dab88ec1cd..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/crds/crd-prometheus.yaml.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- charts-original/crds/crd-prometheus.yaml -+++ charts/crds/crd-prometheus.yaml -@@ -4,7 +4,6 @@ - metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.2.4 -- helm.sh/hook: crd-install - creationTimestamp: null - name: prometheuses.monitoring.coreos.com - spec: diff --git a/packages/rancher-monitoring/generated-changes/patch/crds/crd-prometheusrules.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/crds/crd-prometheusrules.yaml.patch deleted file mode 100644 index f7bdf821b5..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/crds/crd-prometheusrules.yaml.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- charts-original/crds/crd-prometheusrules.yaml -+++ charts/crds/crd-prometheusrules.yaml -@@ -4,7 +4,6 @@ - metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.2.4 -- helm.sh/hook: crd-install - creationTimestamp: null - name: prometheusrules.monitoring.coreos.com - spec: diff --git a/packages/rancher-monitoring/generated-changes/patch/crds/crd-servicemonitor.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/crds/crd-servicemonitor.yaml.patch deleted file mode 100644 index 70bcdea530..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/crds/crd-servicemonitor.yaml.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- charts-original/crds/crd-servicemonitor.yaml -+++ charts/crds/crd-servicemonitor.yaml -@@ -4,7 +4,6 @@ - metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.2.4 -- helm.sh/hook: crd-install - creationTimestamp: null - name: servicemonitors.monitoring.coreos.com - spec: diff --git a/packages/rancher-monitoring/generated-changes/patch/crds/crd-thanosrulers.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/crds/crd-thanosrulers.yaml.patch deleted file mode 100644 index cc1dba264b..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/crds/crd-thanosrulers.yaml.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- charts-original/crds/crd-thanosrulers.yaml -+++ charts/crds/crd-thanosrulers.yaml -@@ -4,7 +4,6 @@ - metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.2.4 -- helm.sh/hook: crd-install - creationTimestamp: null - name: thanosrulers.monitoring.coreos.com - spec: diff --git a/packages/rancher-monitoring/generated-changes/patch/requirements.lock.patch b/packages/rancher-monitoring/generated-changes/patch/requirements.lock.patch deleted file mode 100644 index 6cff89c106..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/requirements.lock.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- charts-original/requirements.lock -+++ charts/requirements.lock -@@ -1,12 +1,54 @@ - dependencies: - - name: kube-state-metrics -- repository: https://kubernetes-charts.storage.googleapis.com/ -+ repository: https://charts.helm.sh/stable/ - version: 2.8.14 - - name: prometheus-node-exporter - repository: https://prometheus-community.github.io/helm-charts -- version: 1.11.* -+ version: 1.11.2 - - name: grafana - repository: https://grafana.github.io/helm-charts -- version: 5.6.5 --digest: sha256:63f05f80aaa50cb20ca647456e249dd52acae1302588c87a2ce90d9a45825907 --generated: "2020-09-14T17:50:17.728835798Z" -+ version: 5.6.4 -+- name: prometheus-adapter -+ repository: https://prometheus-community.github.io/helm-charts -+ version: 2.7.1 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+- name: rancher-pushprox -+ repository: file://../../rancher-pushprox/charts -+ version: 0.1.2 -+digest: sha256:e9fe12d245bde664b9f3e332cd3a4c94e691e8a81120afa4631eb0041149e252 -+generated: "2021-01-15T09:11:01.329739-08:00" diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/alertmanager/alertmanager.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/alertmanager/alertmanager.yaml.patch index 70ab78db8e..95264a4804 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/alertmanager/alertmanager.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/alertmanager/alertmanager.yaml.patch @@ -4,8 +4,8 @@ {{ include "kube-prometheus-stack.labels" . | indent 4 }} spec: {{- if .Values.alertmanager.alertmanagerSpec.image }} -- baseImage: {{ .Values.alertmanager.alertmanagerSpec.image.repository }} -+ baseImage: {{ template "system_default_registry" . }}{{ .Values.alertmanager.alertmanagerSpec.image.repository }} +- image: {{ .Values.alertmanager.alertmanagerSpec.image.repository }}:{{ .Values.alertmanager.alertmanagerSpec.image.tag }} ++ image: {{ template "system_default_registry" . }}{{ .Values.alertmanager.alertmanagerSpec.image.repository }}:{{ .Values.alertmanager.alertmanagerSpec.image.tag }} version: {{ .Values.alertmanager.alertmanagerSpec.image.tag }} {{- if .Values.alertmanager.alertmanagerSpec.image.sha }} sha: {{ .Values.alertmanager.alertmanagerSpec.image.sha }} @@ -19,8 +19,8 @@ {{ toYaml .Values.alertmanager.alertmanagerSpec.nodeSelector | indent 4 }} {{- end }} paused: {{ .Values.alertmanager.alertmanagerSpec.paused }} -@@ -88,8 +88,8 @@ - alertmanager: {{ template "kube-prometheus-stack.fullname" . }}-alertmanager +@@ -100,8 +100,8 @@ + - {key: prometheus, operator: In, values: [{{ template "kube-prometheus-stack.fullname" . }}-alertmanager]} {{- end }} {{- end }} + tolerations: {{ include "linux-node-tolerations" . | nindent 4 }} @@ -28,4 +28,16 @@ - tolerations: {{ toYaml .Values.alertmanager.alertmanagerSpec.tolerations | indent 4 }} {{- end }} - {{- if .Values.global.imagePullSecrets }} + {{- if .Values.alertmanager.alertmanagerSpec.topologySpreadConstraints }} +@@ -136,10 +136,10 @@ + {{ toYaml .Values.alertmanager.alertmanagerSpec.volumeMounts | indent 4 }} + {{- end }} + portName: {{ .Values.alertmanager.alertmanagerSpec.portName }} +-{{- end }} + {{- if .Values.alertmanager.alertmanagerSpec.clusterAdvertiseAddress }} + clusterAdvertiseAddress: {{ .Values.alertmanager.alertmanagerSpec.clusterAdvertiseAddress }} + {{- end }} + {{- if .Values.alertmanager.alertmanagerSpec.forceEnableClusterMode }} + forceEnableClusterMode: {{ .Values.alertmanager.alertmanagerSpec.forceEnableClusterMode }} + {{- end }} ++{{- end }} diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/cluster-total.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/cluster-total.yaml.patch index 6355241d79..c1de54860a 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/cluster-total.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/cluster-total.yaml.patch @@ -9,3 +9,19 @@ name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" $) "cluster-total" | trunc 63 | trimSuffix "-" }} annotations: {{ toYaml .Values.grafana.sidecar.dashboards.annotations | indent 4 }} +@@ -1825,7 +1825,7 @@ + "datasource": "$datasource", + "hide": {{ if .Values.grafana.sidecar.dashboards.multicluster }}0{{ else }}2{{ end }}, + "includeAll": false, +- "label": null, ++ "label": "cluster", + "multi": false, + "name": "cluster", + "options": [ +@@ -1879,4 +1879,4 @@ + "uid": "ff635a025bcfea7bc3dd4f508990a3e9", + "version": 0 + } +-{{- end }} +\ No newline at end of file ++{{- end }} diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/controller-manager.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/controller-manager.yaml.patch index 8df4d75866..58e9d23694 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/controller-manager.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/controller-manager.yaml.patch @@ -24,7 +24,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "", -@@ -175,7 +176,7 @@ +@@ -176,7 +177,7 @@ "steppedLine": false, "targets": [ { @@ -33,7 +33,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}} {{`{{`}}name{{`}}`}}", -@@ -280,7 +281,7 @@ +@@ -282,7 +283,7 @@ "steppedLine": false, "targets": [ { @@ -42,7 +42,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}} {{`{{`}}name{{`}}`}}", -@@ -385,7 +386,7 @@ +@@ -388,7 +389,7 @@ "steppedLine": false, "targets": [ { @@ -51,7 +51,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}} {{`{{`}}name{{`}}`}}", -@@ -490,28 +491,28 @@ +@@ -494,28 +495,28 @@ "steppedLine": false, "targets": [ { @@ -84,7 +84,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "5xx", -@@ -603,7 +604,7 @@ +@@ -608,7 +609,7 @@ "steppedLine": false, "targets": [ { @@ -93,7 +93,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}verb{{`}}`}} {{`{{`}}url{{`}}`}}", -@@ -708,7 +709,7 @@ +@@ -714,7 +715,7 @@ "steppedLine": false, "targets": [ { @@ -102,7 +102,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}verb{{`}}`}} {{`{{`}}url{{`}}`}}", -@@ -813,7 +814,7 @@ +@@ -820,7 +821,7 @@ "steppedLine": false, "targets": [ { @@ -111,7 +111,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}}", -@@ -905,7 +906,7 @@ +@@ -913,7 +914,7 @@ "steppedLine": false, "targets": [ { @@ -120,7 +120,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}}", -@@ -997,7 +998,7 @@ +@@ -1006,7 +1007,7 @@ "steppedLine": false, "targets": [ { @@ -129,7 +129,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}}", -@@ -1091,7 +1092,7 @@ +@@ -1100,7 +1101,7 @@ "options": [ ], @@ -138,7 +138,7 @@ "refresh": 2, "regex": "", "sort": 1, -@@ -1139,4 +1140,5 @@ +@@ -1148,4 +1149,5 @@ "uid": "72e0e05bef5099e5f049b05fdc429ed4", "version": 0 } diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/namespace-by-pod.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/namespace-by-pod.yaml.patch index e2e2d07d08..2ad27f1684 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/namespace-by-pod.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/namespace-by-pod.yaml.patch @@ -9,3 +9,19 @@ name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" $) "namespace-by-pod" | trunc 63 | trimSuffix "-" }} annotations: {{ toYaml .Values.grafana.sidecar.dashboards.annotations | indent 4 }} +@@ -1295,7 +1295,7 @@ + "datasource": "$datasource", + "hide": {{ if .Values.grafana.sidecar.dashboards.multicluster }}0{{ else }}2{{ end }}, + "includeAll": false, +- "label": null, ++ "label": "cluster", + "multi": false, + "name": "cluster", + "options": [ +@@ -1461,4 +1461,4 @@ + "uid": "8b7a8b326d7a6f1f04244066368c67af", + "version": 0 + } +-{{- end }} +\ No newline at end of file ++{{- end }} diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/namespace-by-workload.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/namespace-by-workload.yaml.patch index 35ebc6fcf7..34b63f1265 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/namespace-by-workload.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/namespace-by-workload.yaml.patch @@ -9,3 +9,19 @@ name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" $) "namespace-by-workload" | trunc 63 | trimSuffix "-" }} annotations: {{ toYaml .Values.grafana.sidecar.dashboards.annotations | indent 4 }} +@@ -1535,7 +1535,7 @@ + "datasource": "$datasource", + "hide": {{ if .Values.grafana.sidecar.dashboards.multicluster }}0{{ else }}2{{ end }}, + "includeAll": false, +- "label": null, ++ "label": "cluster", + "multi": false, + "name": "cluster", + "options": [ +@@ -1733,4 +1733,4 @@ + "uid": "bbb2a765a623ae38130206c7d94a160f", + "version": 0 + } +-{{- end }} +\ No newline at end of file ++{{- end }} diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/pod-total.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/pod-total.yaml.patch index 96bbe57475..7e4ae7e9eb 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/pod-total.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/pod-total.yaml.patch @@ -9,3 +9,19 @@ name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" $) "pod-total" | trunc 63 | trimSuffix "-" }} annotations: {{ toYaml .Values.grafana.sidecar.dashboards.annotations | indent 4 }} +@@ -1027,7 +1027,7 @@ + "datasource": "$datasource", + "hide": {{ if .Values.grafana.sidecar.dashboards.multicluster }}0{{ else }}2{{ end }}, + "includeAll": false, +- "label": null, ++ "label": "cluster", + "multi": false, + "name": "cluster", + "options": [ +@@ -1225,4 +1225,4 @@ + "uid": "7a18067ce943a40ae25454675c19ff5c", + "version": 0 + } +-{{- end }} +\ No newline at end of file ++{{- end }} diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/proxy.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/proxy.yaml.patch index 07e7e384d3..723cefbc0f 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/proxy.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/proxy.yaml.patch @@ -24,7 +24,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "", -@@ -175,7 +176,7 @@ +@@ -176,7 +177,7 @@ "steppedLine": false, "targets": [ { @@ -33,7 +33,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "rate", -@@ -267,7 +268,7 @@ +@@ -269,7 +270,7 @@ "steppedLine": false, "targets": [ { @@ -42,7 +42,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}}", -@@ -372,7 +373,7 @@ +@@ -375,7 +376,7 @@ "steppedLine": false, "targets": [ { @@ -51,7 +51,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "rate", -@@ -464,7 +465,7 @@ +@@ -468,7 +469,7 @@ "steppedLine": false, "targets": [ { @@ -60,7 +60,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}}", -@@ -569,28 +570,28 @@ +@@ -574,28 +575,28 @@ "steppedLine": false, "targets": [ { @@ -93,7 +93,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "5xx", -@@ -682,7 +683,7 @@ +@@ -688,7 +689,7 @@ "steppedLine": false, "targets": [ { @@ -102,7 +102,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}verb{{`}}`}} {{`{{`}}url{{`}}`}}", -@@ -787,7 +788,7 @@ +@@ -794,7 +795,7 @@ "steppedLine": false, "targets": [ { @@ -111,7 +111,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}verb{{`}}`}} {{`{{`}}url{{`}}`}}", -@@ -892,7 +893,7 @@ +@@ -900,7 +901,7 @@ "steppedLine": false, "targets": [ { @@ -120,7 +120,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}}", -@@ -984,7 +985,7 @@ +@@ -993,7 +994,7 @@ "steppedLine": false, "targets": [ { @@ -129,7 +129,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}}", -@@ -1076,7 +1077,7 @@ +@@ -1086,7 +1087,7 @@ "steppedLine": false, "targets": [ { @@ -138,7 +138,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}}", -@@ -1170,7 +1171,7 @@ +@@ -1180,7 +1181,7 @@ "options": [ ], @@ -147,7 +147,7 @@ "refresh": 2, "regex": "", "sort": 1, -@@ -1218,4 +1219,4 @@ +@@ -1228,4 +1229,4 @@ "uid": "632e265de029684c40b21cb76bca4f94", "version": 0 } diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/scheduler.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/scheduler.yaml.patch index 96a0b0b5c9..ea19f2ffd1 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/scheduler.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/scheduler.yaml.patch @@ -24,7 +24,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "", -@@ -175,28 +176,28 @@ +@@ -176,28 +177,28 @@ "steppedLine": false, "targets": [ { @@ -57,7 +57,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}} volume", -@@ -288,28 +289,28 @@ +@@ -290,28 +291,28 @@ "steppedLine": false, "targets": [ { @@ -90,7 +90,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}} volume", -@@ -414,28 +415,28 @@ +@@ -417,28 +418,28 @@ "steppedLine": false, "targets": [ { @@ -123,7 +123,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "5xx", -@@ -527,7 +528,7 @@ +@@ -531,7 +532,7 @@ "steppedLine": false, "targets": [ { @@ -132,7 +132,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}verb{{`}}`}} {{`{{`}}url{{`}}`}}", -@@ -632,7 +633,7 @@ +@@ -637,7 +638,7 @@ "steppedLine": false, "targets": [ { @@ -141,7 +141,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}verb{{`}}`}} {{`{{`}}url{{`}}`}}", -@@ -737,7 +738,7 @@ +@@ -743,7 +744,7 @@ "steppedLine": false, "targets": [ { @@ -150,7 +150,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}}", -@@ -829,7 +830,7 @@ +@@ -836,7 +837,7 @@ "steppedLine": false, "targets": [ { @@ -159,7 +159,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}}", -@@ -921,7 +922,7 @@ +@@ -929,7 +930,7 @@ "steppedLine": false, "targets": [ { @@ -168,7 +168,7 @@ "format": "time_series", "intervalFactor": 2, "legendFormat": "{{`{{`}}instance{{`}}`}}", -@@ -1015,7 +1016,7 @@ +@@ -1023,7 +1024,7 @@ "options": [ ], @@ -177,7 +177,7 @@ "refresh": 2, "regex": "", "sort": 1, -@@ -1063,4 +1064,5 @@ +@@ -1071,4 +1072,5 @@ "uid": "2e6b6a3b4bddf1427b3a55aa1311c656", "version": 0 } diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/workload-total.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/workload-total.yaml.patch index b8a643abda..87ad827e68 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/workload-total.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/grafana/dashboards-1.14/workload-total.yaml.patch @@ -9,3 +9,19 @@ name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" $) "workload-total" | trunc 63 | trimSuffix "-" }} annotations: {{ toYaml .Values.grafana.sidecar.dashboards.annotations | indent 4 }} +@@ -1205,7 +1205,7 @@ + "datasource": "$datasource", + "hide": {{ if .Values.grafana.sidecar.dashboards.multicluster }}0{{ else }}2{{ end }}, + "includeAll": false, +- "label": null, ++ "label": "cluster", + "multi": false, + "name": "cluster", + "options": [ +@@ -1435,4 +1435,4 @@ + "uid": "728bf77cc1166d2f3133bf25846876cc", + "version": 0 + } +-{{- end }} +\ No newline at end of file ++{{- end }} diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus-operator/clusterrole.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus-operator/clusterrole.yaml.patch deleted file mode 100644 index 1d944d7891..0000000000 --- a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus-operator/clusterrole.yaml.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- charts-original/templates/prometheus-operator/clusterrole.yaml -+++ charts/templates/prometheus-operator/clusterrole.yaml -@@ -7,7 +7,7 @@ - app: {{ template "kube-prometheus-stack.name" . }}-operator - {{ include "kube-prometheus-stack.labels" . | indent 4 }} - rules: --{{- if or .Values.prometheusOperator.manageCrds .Values.prometheusOperator.cleanupCustomResource }} -+{{- if .Values.prometheusOperator.manageCrds }} - - apiGroups: - - apiextensions.k8s.io - resources: diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus-operator/deployment.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus-operator/deployment.yaml.patch index 6881424fa1..0165ec39de 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus-operator/deployment.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus-operator/deployment.yaml.patch @@ -12,37 +12,18 @@ {{- end }} imagePullPolicy: "{{ .Values.prometheusOperator.image.pullPolicy }}" args: -@@ -64,14 +64,14 @@ - - --logtostderr=true - - --localhost=127.0.0.1 +@@ -66,9 +66,9 @@ + - --alertmanager-default-base-image={{ .Values.prometheusOperator.alertmanagerDefaultBaseImage }} + {{- end }} {{- if .Values.prometheusOperator.prometheusConfigReloaderImage.sha }} - - --prometheus-config-reloader={{ .Values.prometheusOperator.prometheusConfigReloaderImage.repository }}:{{ .Values.prometheusOperator.prometheusConfigReloaderImage.tag }}@sha256:{{ .Values.prometheusOperator.prometheusConfigReloaderImage.sha }} + - --prometheus-config-reloader={{ template "system_default_registry" . }}{{ .Values.prometheusOperator.prometheusConfigReloaderImage.repository }}:{{ .Values.prometheusOperator.prometheusConfigReloaderImage.tag }}@sha256:{{ .Values.prometheusOperator.prometheusConfigReloaderImage.sha }} {{- else }} - - --prometheus-config-reloader={{ .Values.prometheusOperator.prometheusConfigReloaderImage.repository }}:{{ .Values.prometheusOperator.prometheusConfigReloaderImage.tag }} + - --prometheus-config-reloader={{ template "system_default_registry" . }}{{ .Values.prometheusOperator.prometheusConfigReloaderImage.repository }}:{{ .Values.prometheusOperator.prometheusConfigReloaderImage.tag }} - {{- end }} - {{- if .Values.prometheusOperator.configmapReloadImage.sha }} -- - --config-reloader-image={{ .Values.prometheusOperator.configmapReloadImage.repository }}:{{ .Values.prometheusOperator.configmapReloadImage.tag }}@sha256:{{ .Values.prometheusOperator.configmapReloadImage.sha }} -+ - --config-reloader-image={{ template "system_default_registry" . }}{{ .Values.prometheusOperator.configmapReloadImage.repository }}:{{ .Values.prometheusOperator.configmapReloadImage.tag }}@sha256:{{ .Values.prometheusOperator.configmapReloadImage.sha }} - {{- else }} -- - --config-reloader-image={{ .Values.prometheusOperator.configmapReloadImage.repository }}:{{ .Values.prometheusOperator.configmapReloadImage.tag }} -+ - --config-reloader-image={{ template "system_default_registry" . }}{{ .Values.prometheusOperator.configmapReloadImage.repository }}:{{ .Values.prometheusOperator.configmapReloadImage.tag }} {{- end }} - --config-reloader-cpu={{ .Values.prometheusOperator.configReloaderCpu }} - --config-reloader-memory={{ .Values.prometheusOperator.configReloaderMemory }} -@@ -89,9 +89,9 @@ - {{- if .Values.prometheusOperator.tlsProxy.enabled }} - - name: tls-proxy - {{- if .Values.prometheusOperator.tlsProxy.image.sha }} -- image: {{ .Values.prometheusOperator.tlsProxy.image.repository }}:{{ .Values.prometheusOperator.tlsProxy.image.tag }}@sha256:{{ .Values.prometheusOperator.tlsProxy.image.sha }} -+ image: {{ template "system_default_registry" . }}{{ .Values.prometheusOperator.tlsProxy.image.repository }}:{{ .Values.prometheusOperator.tlsProxy.image.tag }}@sha256:{{ .Values.prometheusOperator.tlsProxy.image.sha }} - {{- else }} -- image: {{ .Values.prometheusOperator.tlsProxy.image.repository }}:{{ .Values.prometheusOperator.tlsProxy.image.tag }} -+ image: {{ template "system_default_registry" . }}{{ .Values.prometheusOperator.tlsProxy.image.repository }}:{{ .Values.prometheusOperator.tlsProxy.image.tag }} - {{- end }} - imagePullPolicy: {{ .Values.prometheusOperator.tlsProxy.image.pullPolicy }} - args: @@ -130,16 +130,16 @@ hostNetwork: true dnsPolicy: ClusterFirstWithHostNet diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/prometheus.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/prometheus.yaml.patch index 1d24299331..da014b0879 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/prometheus.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/prometheus.yaml.patch @@ -4,8 +4,8 @@ {{ toYaml .Values.prometheus.prometheusSpec.apiserverConfig | indent 4}} {{- end }} {{- if .Values.prometheus.prometheusSpec.image }} -- baseImage: {{ .Values.prometheus.prometheusSpec.image.repository }} -+ baseImage: {{ template "system_default_registry" . }}{{ .Values.prometheus.prometheusSpec.image.repository }} +- image: {{ .Values.prometheus.prometheusSpec.image.repository }}:{{ .Values.prometheus.prometheusSpec.image.tag }} ++ image: {{ template "system_default_registry" . }}{{ .Values.prometheus.prometheusSpec.image.repository }}:{{ .Values.prometheus.prometheusSpec.image.tag }} version: {{ .Values.prometheus.prometheusSpec.image.tag }} {{- if .Values.prometheus.prometheusSpec.image.sha }} sha: {{ .Values.prometheus.prometheusSpec.image.sha }} @@ -22,8 +22,8 @@ {{ toYaml .Values.prometheus.prometheusSpec.nodeSelector | indent 4 }} {{- end }} paused: {{ .Values.prometheus.prometheusSpec.paused }} -@@ -196,8 +199,8 @@ - prometheus: {{ template "kube-prometheus-stack.fullname" . }}-prometheus +@@ -216,8 +219,8 @@ + - {key: prometheus, operator: In, values: [{{ template "kube-prometheus-stack.fullname" . }}-prometheus]} {{- end }} {{- end }} + tolerations: {{ include "linux-node-tolerations" . | nindent 4 }} @@ -31,8 +31,8 @@ - tolerations: {{ toYaml .Values.prometheus.prometheusSpec.tolerations | indent 4 }} {{- end }} - {{- if .Values.global.imagePullSecrets }} -@@ -226,7 +229,7 @@ + {{- if .Values.prometheus.prometheusSpec.topologySpreadConstraints }} +@@ -250,7 +253,7 @@ {{- end }} {{- if .Values.prometheus.prometheusSpec.containers }} containers: @@ -41,16 +41,16 @@ {{- end }} {{- if .Values.prometheus.prometheusSpec.initContainers }} initContainers: -@@ -242,6 +245,7 @@ +@@ -266,6 +269,7 @@ {{- if .Values.prometheus.prometheusSpec.disableCompaction }} disableCompaction: {{ .Values.prometheus.prometheusSpec.disableCompaction }} {{- end }} +{{- if .Values.prometheus.prometheusSpec.portName }} portName: {{ .Values.prometheus.prometheusSpec.portName }} {{- end }} - {{- if .Values.prometheus.prometheusSpec.enforcedNamespaceLabel }} -@@ -255,3 +259,4 @@ - volumeMounts: - {{ toYaml .Values.prometheus.prometheusSpec.volumeMounts | indent 4 }} + {{- if .Values.prometheus.prometheusSpec.volumes }} +@@ -310,3 +314,4 @@ + {{- if .Values.prometheus.prometheusSpec.allowOverlappingBlocks }} + allowOverlappingBlocks: {{ .Values.prometheus.prometheusSpec.allowOverlappingBlocks }} {{- end }} +{{- end }} diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/etcd.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/etcd.yaml.patch index 6ecc8952aa..1ace708ae3 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/etcd.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/etcd.yaml.patch @@ -10,10 +10,10 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: -@@ -152,4 +153,5 @@ - for: 10m - labels: - severity: warning +@@ -176,4 +177,5 @@ + {{- if .Values.defaultRules.additionalRuleLabels }} + {{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }} + {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/kubernetes-system-controller-manager.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/kubernetes-system-controller-manager.yaml.patch index 5f7cbff180..8e20b6f847 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/kubernetes-system-controller-manager.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/kubernetes-system-controller-manager.yaml.patch @@ -10,7 +10,7 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: -@@ -24,14 +25,15 @@ +@@ -24,13 +25,13 @@ groups: - name: kubernetes-system-controller-manager rules: @@ -18,13 +18,17 @@ +{{- if (include "exporter.kubeControllerManager.enabled" .)}} - alert: KubeControllerManagerDown annotations: - message: KubeControllerManager has disappeared from Prometheus target discovery. + description: KubeControllerManager has disappeared from Prometheus target discovery. runbook_url: {{ .Values.defaultRules.runbookUrl }}alert-name-kubecontrollermanagerdown + summary: Target disappeared from Prometheus target discovery. - expr: absent(up{job="kube-controller-manager"} == 1) + expr: absent(up{job="{{ include "exporter.kubeControllerManager.jobName" . }}"} == 1) for: 15m labels: severity: critical +@@ -38,4 +39,5 @@ + {{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }} + {{- end }} {{- end }} +{{- end }} {{- end }} diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/kubernetes-system-scheduler.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/kubernetes-system-scheduler.yaml.patch index 864419cf21..0c423a9343 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/kubernetes-system-scheduler.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/kubernetes-system-scheduler.yaml.patch @@ -10,7 +10,7 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: -@@ -24,14 +25,15 @@ +@@ -24,13 +25,13 @@ groups: - name: kubernetes-system-scheduler rules: @@ -18,13 +18,17 @@ +{{- if (include "exporter.kubeScheduler.enabled" .)}} - alert: KubeSchedulerDown annotations: - message: KubeScheduler has disappeared from Prometheus target discovery. + description: KubeScheduler has disappeared from Prometheus target discovery. runbook_url: {{ .Values.defaultRules.runbookUrl }}alert-name-kubeschedulerdown + summary: Target disappeared from Prometheus target discovery. - expr: absent(up{job="kube-scheduler"} == 1) + expr: absent(up{job="{{ include "exporter.kubeScheduler.jobName" . }}"} == 1) for: 15m labels: severity: critical +@@ -38,4 +39,5 @@ + {{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }} + {{- end }} {{- end }} +{{- end }} {{- end }} diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules/etcd.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules/etcd.yaml.patch index 30a2f50f5b..3cd6667539 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules/etcd.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules/etcd.yaml.patch @@ -10,10 +10,11 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: -@@ -152,4 +153,5 @@ - for: 10m - labels: - severity: warning -+{{- end }} +@@ -176,4 +177,5 @@ + {{- if .Values.defaultRules.additionalRuleLabels }} + {{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }} {{- end }} +-{{- end }} \ No newline at end of file ++{{- end }} ++{{- end }} diff --git a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules/kubernetes-absent.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules/kubernetes-absent.yaml.patch index ec63ef56e5..fe9619b6a1 100644 --- a/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules/kubernetes-absent.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules/kubernetes-absent.yaml.patch @@ -1,8 +1,8 @@ --- charts-original/templates/prometheus/rules/kubernetes-absent.yaml +++ charts/templates/prometheus/rules/kubernetes-absent.yaml -@@ -58,22 +58,22 @@ - labels: - severity: critical +@@ -67,12 +67,12 @@ + {{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }} + {{- end }} {{- end }} -{{- if .Values.kubeControllerManager.enabled }} +{{- if (include "exporter.kubeControllerManager.enabled" .)}} @@ -15,6 +15,9 @@ for: 15m labels: severity: critical +@@ -80,12 +80,12 @@ + {{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }} + {{- end }} {{- end }} -{{- if .Values.kubeScheduler.enabled }} +{{- if (include "exporter.kubeScheduler.enabled" .)}} diff --git a/packages/rancher-monitoring/generated-changes/patch/values.yaml.patch b/packages/rancher-monitoring/generated-changes/patch/values.yaml.patch index 99d53c8267..fd6d7a573e 100644 --- a/packages/rancher-monitoring/generated-changes/patch/values.yaml.patch +++ b/packages/rancher-monitoring/generated-changes/patch/values.yaml.patch @@ -17,7 +17,7 @@ + port: 9090 + image: + repository: rancher/mirrored-directxman12-k8s-prometheus-adapter-amd64 -+ tag: v0.7.0 ++ tag: v0.8.3 + pullPolicy: IfNotPresent + pullSecrets: {} + psp: @@ -294,7 +294,7 @@ ## Provide a k8s version to auto dashboard import script example: kubeTargetVersionOverride: 1.16.6 ## -@@ -76,8 +354,23 @@ +@@ -89,8 +367,23 @@ ## global: @@ -318,7 +318,7 @@ pspEnabled: true pspAnnotations: {} ## Specify pod annotations -@@ -130,6 +423,22 @@ +@@ -143,6 +436,22 @@ ## ref: https://prometheus.io/docs/alerting/configuration/#configuration-file ## https://prometheus.io/webtools/alerting/routing-tree-editor/ ## @@ -341,16 +341,7 @@ config: global: resolve_timeout: 5m -@@ -145,6 +454,8 @@ - receiver: 'null' - receivers: - - name: 'null' -+ templates: -+ - /etc/alertmanager/config/*.tmpl - - ## Pass the Alertmanager configuration directives through Helm's templating - ## engine. If the Alertmanager configuration contains Alertmanager templates, -@@ -160,25 +471,76 @@ +@@ -179,25 +488,76 @@ ## ref: https://prometheus.io/docs/alerting/notifications/ ## https://prometheus.io/docs/alerting/notification_examples/ ## @@ -446,7 +437,7 @@ ingress: enabled: false -@@ -208,6 +570,25 @@ +@@ -235,6 +595,25 @@ ## Configuration for Alertmanager secret ## secret: @@ -472,7 +463,16 @@ annotations: {} ## Configuration for creating an Ingress that will map to each Alertmanager replica service -@@ -334,7 +715,7 @@ +@@ -352,7 +731,7 @@ + ## Of type: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#tlsconfig + tlsConfig: {} + +- bearerTokenFile: ++ bearerTokenFile: "" + + ## metric relabel configs to apply to samples before ingestion. + ## +@@ -383,7 +762,7 @@ ## Image of Alertmanager ## image: @@ -481,7 +481,7 @@ tag: v0.21.0 sha: "" -@@ -410,9 +791,13 @@ +@@ -495,9 +874,13 @@ ## Define resources requests and limits for single Pods. ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ ## @@ -498,7 +498,7 @@ ## Pod anti-affinity can prevent the scheduler from placing Prometheus replicas on the same node. ## The default value "soft" means that the scheduler should *prefer* to not schedule two replica pods onto the same node but no guarantee is provided. -@@ -487,10 +872,43 @@ +@@ -601,10 +984,43 @@ enabled: true namespaceOverride: "" @@ -542,7 +542,7 @@ adminPassword: prom-operator ingress: -@@ -530,6 +948,7 @@ +@@ -644,6 +1060,7 @@ dashboards: enabled: true label: grafana_dashboard @@ -550,7 +550,7 @@ ## Annotations for Grafana dashboard configmaps ## -@@ -574,7 +993,60 @@ +@@ -692,7 +1109,60 @@ ## Passed to grafana subchart and used by servicemonitor below ## service: @@ -612,7 +612,7 @@ ## If true, create a serviceMonitor for grafana ## -@@ -600,6 +1072,14 @@ +@@ -722,6 +1192,14 @@ # targetLabel: nodename # replacement: $1 # action: replace @@ -627,7 +627,7 @@ ## Component scraping the kube api server ## -@@ -756,7 +1236,7 @@ +@@ -879,7 +1357,7 @@ ## Component scraping the kube controller manager ## kubeControllerManager: @@ -636,7 +636,7 @@ ## If your kube controller manager is not deployed as a pod, specify IPs it can be found on ## -@@ -889,7 +1369,7 @@ +@@ -1014,7 +1492,7 @@ ## Component scraping etcd ## kubeEtcd: @@ -645,7 +645,7 @@ ## If your etcd is not deployed as a pod, specify IPs it can be found on ## -@@ -949,7 +1429,7 @@ +@@ -1076,7 +1554,7 @@ ## Component scraping kube scheduler ## kubeScheduler: @@ -654,7 +654,7 @@ ## If your kube scheduler is not deployed as a pod, specify IPs it can be found on ## -@@ -1002,7 +1482,7 @@ +@@ -1131,7 +1609,7 @@ ## Component scraping kube proxy ## kubeProxy: @@ -663,7 +663,7 @@ ## If your kube proxy is not deployed as a pod, specify IPs it can be found on ## -@@ -1076,6 +1556,13 @@ +@@ -1210,6 +1688,13 @@ create: true podSecurityPolicy: enabled: true @@ -677,10 +677,10 @@ ## Deploy node exporter as a daemonset to all nodes ## -@@ -1125,6 +1612,16 @@ +@@ -1259,6 +1744,16 @@ extraArgs: - - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+)($|/) - - --collector.filesystem.ignored-fs-types=^(autofs|binfmt_misc|cgroup|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|mqueue|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|sysfs|tracefs)$ + - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/.+)($|/) + - --collector.filesystem.ignored-fs-types=^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$ + service: + port: 9796 + targetPort: 9796 @@ -694,25 +694,16 @@ ## Manages Prometheus and Alertmanager components ## -@@ -1138,7 +1635,7 @@ - tlsProxy: - enabled: true - image: -- repository: squareup/ghostunnel -+ repository: rancher/mirrored-squareup-ghostunnel - tag: v1.5.2 - sha: "" - pullPolicy: IfNotPresent -@@ -1156,7 +1653,7 @@ +@@ -1289,7 +1784,7 @@ patch: enabled: true image: - repository: jettech/kube-webhook-certgen + repository: rancher/mirrored-jettech-kube-webhook-certgen - tag: v1.2.1 + tag: v1.5.0 sha: "" pullPolicy: IfNotPresent -@@ -1285,13 +1782,13 @@ +@@ -1428,13 +1923,13 @@ ## Resource limits & requests ## @@ -733,66 +724,58 @@ # Required for use in managed kubernetes clusters (such as AWS EKS) with custom CNI (such as calico), # because control-plane managed by AWS cannot communicate with pods' IP CIDR and admission webhooks are not working -@@ -1335,7 +1832,7 @@ +@@ -1487,7 +1982,7 @@ ## Prometheus-operator image ## image: -- repository: quay.io/coreos/prometheus-operator -+ repository: rancher/mirrored-coreos-prometheus-operator - tag: v0.38.1 +- repository: quay.io/prometheus-operator/prometheus-operator ++ repository: rancher/mirrored-prometheus-operator-prometheus-operator + tag: v0.46.0 sha: "" pullPolicy: IfNotPresent -@@ -1343,14 +1840,14 @@ - ## Configmap-reload image to use for reloading configmaps - ## - configmapReloadImage: -- repository: docker.io/jimmidyson/configmap-reload -+ repository: rancher/mirrored-jimmidyson-configmap-reload - tag: v0.3.0 - sha: "" - +@@ -1503,7 +1998,7 @@ ## Prometheus-config-reloader image to use for config and rule reloading ## prometheusConfigReloaderImage: -- repository: quay.io/coreos/prometheus-config-reloader -+ repository: rancher/mirrored-coreos-prometheus-config-reloader - tag: v0.38.1 +- repository: quay.io/prometheus-operator/prometheus-config-reloader ++ repository: rancher/mirrored-prometheus-operator-prometheus-config-reloader + tag: v0.46.0 sha: "" -@@ -1366,14 +1863,6 @@ +@@ -1558,6 +2053,14 @@ + ## + nodePort: 30901 + ++ ## Service type ++ ## ++ type: ClusterIP ++ ++ ## Port to expose on each node ++ ## ++ nodePort: 30901 ++ + ## Configuration for Prometheus service ## - secretFieldSelector: "" - -- ## Hyperkube image to use when cleaning up -- ## -- hyperkubeImage: -- repository: k8s.gcr.io/hyperkube -- tag: v1.16.12 -- sha: "" -- pullPolicy: IfNotPresent -- - ## Deploy a Prometheus instance - ## - prometheus: -@@ -1403,7 +1892,7 @@ + service: +@@ -1570,7 +2073,7 @@ port: 9090 ## To be used with a proxy extraContainer port - targetPort: 9090 -+ targetPort: 8080 ++ targetPort: 8081 ## List of IP addresses at which the Prometheus server service is available ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips -@@ -1614,7 +2103,7 @@ +@@ -1822,7 +2325,7 @@ ## Image of Prometheus. ## image: - repository: quay.io/prometheus/prometheus -+ repository: rancher/mirrored-prom-prometheus - tag: v2.18.2 ++ repository: rancher/mirrored-prometheus-prometheus + tag: v2.24.0 sha: "" -@@ -1666,6 +2155,11 @@ +@@ -1885,6 +2388,11 @@ ## externalUrl: "" @@ -804,7 +787,7 @@ ## Define which Nodes the Pods are scheduled on. ## ref: https://kubernetes.io/docs/user-guide/node-selection/ ## -@@ -1698,7 +2192,7 @@ +@@ -1917,7 +2425,7 @@ ## prometheus resource to be created with selectors based on values in the helm deployment, ## which will also match the PrometheusRule resources created ## @@ -812,8 +795,8 @@ + ruleSelectorNilUsesHelmValues: false ## PrometheusRules to be selected for target discovery. - ## If {}, select all ServiceMonitors -@@ -1723,7 +2217,7 @@ + ## If {}, select all PrometheusRules +@@ -1942,7 +2450,7 @@ ## prometheus resource to be created with selectors based on values in the helm deployment, ## which will also match the servicemonitors created ## @@ -822,7 +805,7 @@ ## ServiceMonitors to be selected for target discovery. ## If {}, select all ServiceMonitors -@@ -1743,7 +2237,7 @@ +@@ -1965,7 +2473,7 @@ ## prometheus resource to be created with selectors based on values in the helm deployment, ## which will also match the podmonitors created ## @@ -831,7 +814,7 @@ ## PodMonitors to be selected for target discovery. ## If {}, select all PodMonitors -@@ -1840,9 +2334,13 @@ +@@ -2092,9 +2600,13 @@ ## Resource limits & requests ## @@ -848,19 +831,22 @@ ## Prometheus StorageSpec for persistent data ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/user-guides/storage.md -@@ -1857,11 +2355,6 @@ - # storage: 50Gi - # selector: {} +@@ -2117,7 +2629,13 @@ + # medium: Memory -- # Additional volumes on the output StatefulSet definition. + # Additional volumes on the output StatefulSet definition. - volumes: [] -- # Additional VolumeMounts on the output StatefulSet definition. -- volumeMounts: [] -- - ## AdditionalScrapeConfigs allows specifying additional Prometheus scrape configurations. Scrape configurations - ## are appended to the configurations generated by the Prometheus Operator. Job configurations must have the form - ## as specified in the official Prometheus documentation: -@@ -1964,9 +2457,46 @@ ++ volumes: ++ - name: nginx-home ++ emptyDir: {} ++ - name: prometheus-nginx ++ configMap: ++ name: prometheus-nginx-proxy-config ++ defaultMode: 438 + + # Additional VolumeMounts on the output StatefulSet definition. + volumeMounts: [] +@@ -2224,9 +2742,34 @@ ## thanos: {} @@ -882,7 +868,7 @@ + - /nginx/nginx.conf + image: "{{ template "system_default_registry" . }}{{ .Values.prometheus.prometheusSpec.proxy.image.repository }}:{{ .Values.prometheus.prometheusSpec.proxy.image.tag }}" + ports: -+ - containerPort: 8080 ++ - containerPort: 8081 + name: nginx-http + protocol: TCP + volumeMounts: @@ -893,27 +879,15 @@ + securityContext: + runAsUser: 101 + runAsGroup: 101 -+ -+ # Additional volumes on the output StatefulSet definition. -+ volumes: -+ - name: nginx-home -+ emptyDir: {} -+ - name: prometheus-nginx -+ configMap: -+ name: prometheus-nginx-proxy-config -+ defaultMode: 438 -+ -+ # Additional VolumeMounts on the output StatefulSet definition. -+ volumeMounts: [] ## InitContainers allows injecting additional initContainers. This is meant to allow doing some changes ## (permissions, dir tree) on mounted volumes before starting prometheus -@@ -1974,7 +2504,7 @@ +@@ -2234,7 +2777,7 @@ ## PortName to use for Prometheus. ## - portName: "web" + portName: "nginx-http" - additionalServiceMonitors: [] - ## Name of the ServiceMonitor to create + ## ArbitraryFSAccessThroughSMs configures whether configuration based on a service monitor can access arbitrary files + ## on the file system of the Prometheus container e.g. bearer token files. diff --git a/packages/rancher-monitoring/package.yaml b/packages/rancher-monitoring/package.yaml index cff4181046..fa851689d6 100644 --- a/packages/rancher-monitoring/package.yaml +++ b/packages/rancher-monitoring/package.yaml @@ -1,6 +1,8 @@ -url: https://github.com/prometheus-community/helm-charts/releases/download/kube-prometheus-stack-9.4.2/kube-prometheus-stack-9.4.2.tgz -packageVersion: 04 -releaseCandidateVersion: 09 +url: https://github.com/prometheus-community/helm-charts.git +subdirectory: charts/kube-prometheus-stack +commit: 3ca6ba66032a1efce0500f9ad6f83351ad0604b8 +packageVersion: 00 +releaseCandidateVersion: 00 additionalCharts: - workingDir: charts-crd crdOptions: diff --git a/packages/rancher-monitoring/templates/crd-template/Chart.yaml b/packages/rancher-monitoring/templates/crd-template/Chart.yaml index 07897b3d72..8931de182c 100644 --- a/packages/rancher-monitoring/templates/crd-template/Chart.yaml +++ b/packages/rancher-monitoring/templates/crd-template/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -version: 9.4.2 +version: 14.5.1 description: Installs the CRDs for rancher-monitoring. name: rancher-monitoring-crd type: application diff --git a/packages/rancher-monitoring/generated-changes/overlay/charts/prometheus-node-exporter/OWNERS b/packages/rancher-node-exporter/generated-changes/overlay/OWNERS similarity index 100% rename from packages/rancher-monitoring/generated-changes/overlay/charts/prometheus-node-exporter/OWNERS rename to packages/rancher-node-exporter/generated-changes/overlay/OWNERS diff --git a/packages/rancher-node-exporter/generated-changes/patch/Chart.yaml.patch b/packages/rancher-node-exporter/generated-changes/patch/Chart.yaml.patch new file mode 100644 index 0000000000..7bab565d95 --- /dev/null +++ b/packages/rancher-node-exporter/generated-changes/patch/Chart.yaml.patch @@ -0,0 +1,17 @@ +--- charts-original/Chart.yaml ++++ charts/Chart.yaml +@@ -1,7 +1,13 @@ ++annotations: ++ catalog.rancher.io/certified: rancher ++ catalog.rancher.io/namespace: cattle-monitoring-system ++ catalog.rancher.io/release-name: rancher-node-exporter ++ catalog.cattle.io/hidden: "true" ++ catalog.cattle.io/os: linux + apiVersion: v1 + appVersion: 1.1.2 + description: A Helm chart for prometheus node-exporter +-name: prometheus-node-exporter ++name: rancher-node-exporter + version: 1.16.2 + home: https://github.com/prometheus/node_exporter/ + sources: diff --git a/packages/rancher-node-exporter/generated-changes/patch/templates/_helpers.tpl.patch b/packages/rancher-node-exporter/generated-changes/patch/templates/_helpers.tpl.patch new file mode 100644 index 0000000000..dd510e2b2a --- /dev/null +++ b/packages/rancher-node-exporter/generated-changes/patch/templates/_helpers.tpl.patch @@ -0,0 +1,35 @@ +--- charts-original/templates/_helpers.tpl ++++ charts/templates/_helpers.tpl +@@ -1,3 +1,32 @@ ++# Rancher ++{{- define "system_default_registry" -}} ++{{- if .Values.global.cattle.systemDefaultRegistry -}} ++{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}} ++{{- end -}} ++{{- end -}} ++ ++# Windows Support ++ ++{{/* ++Windows cluster will add default taint for linux nodes, ++add below linux tolerations to workloads could be scheduled to those linux nodes ++*/}} ++ ++{{- define "linux-node-tolerations" -}} ++- key: "cattle.io/os" ++ value: "linux" ++ effect: "NoSchedule" ++ operator: "Equal" ++{{- end -}} ++ ++{{- define "linux-node-selector" -}} ++{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} ++beta.kubernetes.io/os: linux ++{{- else -}} ++kubernetes.io/os: linux ++{{- end -}} ++{{- end -}} ++ + {{/* vim: set filetype=mustache: */}} + {{/* + Expand the name of the chart. diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-node-exporter/templates/daemonset.yaml.patch b/packages/rancher-node-exporter/generated-changes/patch/templates/daemonset.yaml.patch similarity index 82% rename from packages/rancher-monitoring/generated-changes/patch/charts/prometheus-node-exporter/templates/daemonset.yaml.patch rename to packages/rancher-node-exporter/generated-changes/patch/templates/daemonset.yaml.patch index 6778ab823d..ad9668dd37 100644 --- a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-node-exporter/templates/daemonset.yaml.patch +++ b/packages/rancher-node-exporter/generated-changes/patch/templates/daemonset.yaml.patch @@ -1,6 +1,6 @@ ---- charts-original/charts/prometheus-node-exporter/templates/daemonset.yaml -+++ charts/charts/prometheus-node-exporter/templates/daemonset.yaml -@@ -33,7 +33,7 @@ +--- charts-original/templates/daemonset.yaml ++++ charts/templates/daemonset.yaml +@@ -31,7 +31,7 @@ {{- end }} containers: - name: node-exporter @@ -9,11 +9,15 @@ imagePullPolicy: {{ .Values.image.pullPolicy }} args: - --path.procfs=/host/proc -@@ -113,14 +113,14 @@ +@@ -129,18 +129,18 @@ affinity: {{ toYaml .Values.affinity | indent 8 }} {{- end }} + nodeSelector: {{ include "linux-node-selector" . | nindent 8 }} + {{- with .Values.dnsConfig }} + dnsConfig: + {{ toYaml . | indent 8 }} + {{- end }} {{- if .Values.nodeSelector }} - nodeSelector: -{{ toYaml .Values.nodeSelector | indent 8 }} diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-node-exporter/values.yaml.patch b/packages/rancher-node-exporter/generated-changes/patch/values.yaml.patch similarity index 56% rename from packages/rancher-monitoring/generated-changes/patch/charts/prometheus-node-exporter/values.yaml.patch rename to packages/rancher-node-exporter/generated-changes/patch/values.yaml.patch index d70867ce63..07cdd90d35 100644 --- a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-node-exporter/values.yaml.patch +++ b/packages/rancher-node-exporter/generated-changes/patch/values.yaml.patch @@ -1,15 +1,21 @@ ---- charts-original/charts/prometheus-node-exporter/values.yaml -+++ charts/charts/prometheus-node-exporter/values.yaml -@@ -2,7 +2,7 @@ +--- charts-original/values.yaml ++++ charts/values.yaml +@@ -1,8 +1,13 @@ + # Default values for prometheus-node-exporter. # This is a YAML-formatted file. # Declare variables to be passed into your templates. ++ ++global: ++ cattle: ++ systemDefaultRegistry: "" ++ image: - repository: quay.io/prometheus/node-exporter -+ repository: rancher/mirrored-prom-node-exporter - tag: v1.0.1 ++ repository: rancher/mirrored-prometheus-node-exporter + tag: v1.1.2 pullPolicy: IfNotPresent -@@ -98,6 +98,8 @@ +@@ -125,6 +130,8 @@ tolerations: - effect: NoSchedule operator: Exists diff --git a/packages/rancher-node-exporter/package.yaml b/packages/rancher-node-exporter/package.yaml new file mode 100644 index 0000000000..2cab1b4a61 --- /dev/null +++ b/packages/rancher-node-exporter/package.yaml @@ -0,0 +1,5 @@ +url: https://github.com/prometheus-community/helm-charts.git +subdirectory: charts/prometheus-node-exporter +commit: 78d1219306eaca5be1d8bab84445d0489e073840 +packageVersion: 01 +releaseCandidateVersion: 00 diff --git a/packages/rancher-prometheus-adapter/generated-changes/patch/Chart.yaml.patch b/packages/rancher-prometheus-adapter/generated-changes/patch/Chart.yaml.patch new file mode 100644 index 0000000000..05abc6f4d4 --- /dev/null +++ b/packages/rancher-prometheus-adapter/generated-changes/patch/Chart.yaml.patch @@ -0,0 +1,15 @@ +--- charts-original/Chart.yaml ++++ charts/Chart.yaml +@@ -1,5 +1,11 @@ ++annotations: ++ catalog.rancher.io/certified: rancher ++ catalog.rancher.io/namespace: cattle-monitoring-system ++ catalog.rancher.io/release-name: rancher-prometheus-adapter ++ catalog.cattle.io/hidden: "true" ++ catalog.cattle.io/os: linux + apiVersion: v1 +-name: prometheus-adapter ++name: rancher-prometheus-adapter + version: 2.12.1 + appVersion: v0.8.3 + description: A Helm chart for k8s prometheus adapter diff --git a/packages/rancher-prometheus-adapter/generated-changes/patch/templates/_helpers.tpl.patch b/packages/rancher-prometheus-adapter/generated-changes/patch/templates/_helpers.tpl.patch new file mode 100644 index 0000000000..dd510e2b2a --- /dev/null +++ b/packages/rancher-prometheus-adapter/generated-changes/patch/templates/_helpers.tpl.patch @@ -0,0 +1,35 @@ +--- charts-original/templates/_helpers.tpl ++++ charts/templates/_helpers.tpl +@@ -1,3 +1,32 @@ ++# Rancher ++{{- define "system_default_registry" -}} ++{{- if .Values.global.cattle.systemDefaultRegistry -}} ++{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}} ++{{- end -}} ++{{- end -}} ++ ++# Windows Support ++ ++{{/* ++Windows cluster will add default taint for linux nodes, ++add below linux tolerations to workloads could be scheduled to those linux nodes ++*/}} ++ ++{{- define "linux-node-tolerations" -}} ++- key: "cattle.io/os" ++ value: "linux" ++ effect: "NoSchedule" ++ operator: "Equal" ++{{- end -}} ++ ++{{- define "linux-node-selector" -}} ++{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} ++beta.kubernetes.io/os: linux ++{{- else -}} ++kubernetes.io/os: linux ++{{- end -}} ++{{- end -}} ++ + {{/* vim: set filetype=mustache: */}} + {{/* + Expand the name of the chart. diff --git a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml.patch b/packages/rancher-prometheus-adapter/generated-changes/patch/templates/deployment.yaml.patch similarity index 82% rename from packages/rancher-monitoring/generated-changes/patch/charts/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml.patch rename to packages/rancher-prometheus-adapter/generated-changes/patch/templates/deployment.yaml.patch index 69567db7b6..a6d4a4b0a8 100644 --- a/packages/rancher-monitoring/generated-changes/patch/charts/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml.patch +++ b/packages/rancher-prometheus-adapter/generated-changes/patch/templates/deployment.yaml.patch @@ -1,7 +1,7 @@ ---- charts-original/charts/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml -+++ charts/charts/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml -@@ -37,7 +37,7 @@ - {{- end }} +--- charts-original/templates/deployment.yaml ++++ charts/templates/deployment.yaml +@@ -40,7 +40,7 @@ + {{- end}} containers: - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -9,7 +9,7 @@ imagePullPolicy: {{ .Values.image.pullPolicy }} args: - /adapter -@@ -92,13 +92,17 @@ +@@ -102,13 +102,17 @@ name: volume-serving-cert readOnly: true {{- end }} diff --git a/packages/rancher-prometheus-adapter/generated-changes/patch/values.yaml.patch b/packages/rancher-prometheus-adapter/generated-changes/patch/values.yaml.patch new file mode 100644 index 0000000000..ba293c4172 --- /dev/null +++ b/packages/rancher-prometheus-adapter/generated-changes/patch/values.yaml.patch @@ -0,0 +1,16 @@ +--- charts-original/values.yaml ++++ charts/values.yaml +@@ -1,8 +1,12 @@ + # Default values for k8s-prometheus-adapter.. ++global: ++ cattle: ++ systemDefaultRegistry: "" ++ + affinity: {} + + image: +- repository: directxman12/k8s-prometheus-adapter-amd64 ++ repository: rancher/mirrored-directxman12-k8s-prometheus-adapter-amd64 + tag: v0.8.3 + pullPolicy: IfNotPresent + diff --git a/packages/rancher-prometheus-adapter/package.yaml b/packages/rancher-prometheus-adapter/package.yaml new file mode 100644 index 0000000000..c7f205d2d1 --- /dev/null +++ b/packages/rancher-prometheus-adapter/package.yaml @@ -0,0 +1,5 @@ +url: https://github.com/prometheus-community/helm-charts.git +subdirectory: charts/prometheus-adapter +commit: 75a88bfdb3cccb9a5b48148c0aee12e94d4128d4 +packageVersion: 01 +releaseCandidateVersion: 00