Skip to content

Commit

Permalink
Rebase Monitoring to 14.5.0 and update all dependencies (#1072)
Browse files Browse the repository at this point in the history
* Switch rancher-monitoring to Git-based package

Signed-off-by: Arvind Iyengar <arvind.iyengar@rancher.com>

* Move Monitoring dependencies to separate packages

* Switch rancher-grafana to Git-based and add annotations

* Switch rancher-kube-state-metrics to Git-based and add annotations

* Switch rancher-prometheus-adapter to Git-based and add annotations

* Switch rancher-node-exporter to Git-based and add annotations

* Rebase to kube-prometheus-stack-10.0.0

* Update rancher-monitoring to new base kube-prometheus-stack-10.0.0

* Rebase to kube-prometheus-stack-11.0.0

* Update rancher-monitoring to new base kube-prometheus-stack-11.0.0

* Rebase to kube-prometheus-stack-12.0.0

* Update rancher-monitoring to new base kube-prometheus-stack-12.0.0

* Rebase to kube-prometheus-stack-13.0.0

* Update rancher-monitoring to new base kube-prometheus-stack-13.0.0

* Rebase to kube-prometheus-stack-14.0.0

* Update rancher-monitoring to new base kube-prometheus-stack-14.0.0

* Rebase to kube-prometheus-stack-14.5.0

* Update rancher-monitoring to new base kube-prometheus-stack-14.5.0

* fixup rancher-monitoring

* Switch nginx port for Prometheus to 8081

This is necessary since prometheusConfigReloaderImage now takes port 8080 in the Prometheus pod due to a change introduced in Prometheus Operator v0.43.0 in prometheus-operator/prometheus-operator@dcf34c5.

This value is hard-coded in the operator in https://github.com/prometheus-operator/prometheus-operator/blob/bcf61aacda782d6c8ffc79f55ea1def9cfd97933/pkg/operator/statefulset.go#L25.

* Rebase to grafana-5.7.7

* Update rancher-grafana to new base grafana-5.7.7

* Rebase to grafana-6.0.0

* Update rancher-grafana to new base grafana-6.0.0

* Rebase to grafana-6.6.4

* Update rancher-grafana to new base grafana-6.6.4

* fixup rancher-grafana

* Add linux annotations to image-renderer

* Use default grafana serviceAccount if unavailable for image-renderer

* Rebase to kube-state-metrics-helm-chart-2.13.1

* Update rancher-kube-state-metrics to new base kube-state-metrics-helm-chart-2.13.1

* fixup kube-state-metrics

* Rebase to prometheus-node-exporter-1.16.2

* Update rancher-node-exporter to new base prometheus-node-exporter-1.16.2

* fixup node-exporter

* Rebase to prometheus-adapter-2.12.1

* Update rancher-prometheus-adapter to new base prometheus-adapter-2.12.1

* fixup prometheus-adapter

* Update CRD chart version

* Add original chart before all commits were made

* Add chart after all commits were made

* Delete charts

* Patch the chart version to 1 and reset packageVersion to 00

* Patch CRD chart version
  • Loading branch information
aiyengar2 authored Apr 7, 2021
1 parent ff9c06f commit b88bdc6
Show file tree
Hide file tree
Showing 83 changed files with 1,602 additions and 699 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Leave this file empty to ensure that CI runs builds against the default configuration in values.yaml.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions packages/rancher-grafana/generated-changes/patch/Chart.yaml.patch
Original file line number Diff line number Diff line change
@@ -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'
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Loading

0 comments on commit b88bdc6

Please sign in to comment.