Skip to content

Commit

Permalink
Merge branch 'main' into fix/dont-automount-default-serviceaccount
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke authored Dec 12, 2024
2 parents 884da57 + 4e28243 commit add2b97
Show file tree
Hide file tree
Showing 54 changed files with 661 additions and 169 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@ jobs:
kubectl_version: ${{ inputs.kind_kubectl_version }}
node_image: ${{ inputs.kind_node_image }}

- name: Check Kubernetes version and apply Gateway API CRDs
if: steps.list-changed.outputs.changed == 'true'
run: |
# Get Kubernetes version and extract the major.minor version
version=$(kubectl version -o json | jq -r '.serverVersion.major + "." + .serverVersion.minor' | tr -d '+')
major_version=$(echo $version | cut -d. -f1)
minor_version=$(echo $version | cut -d. -f2)
# Compare version with 1.23. The gateway CRDs use x-kubernetes-validations, which is only supported from 1.23 onwards.
if [ "$major_version" -eq 1 ] && [ "$minor_version" -ge 23 ] || [ "$major_version" -gt 1 ]; then
echo "Kubernetes version $version >= 1.23, applying Gateway API CRDs"
kubectl apply -k https://github.com/kubernetes-sigs/gateway-api/config/crd
else
echo "Kubernetes version $version < 1.23, skipping Gateway API CRDs installation"
echo "Please use an older version of Gateway API CRDs or upgrade your Kubernetes version"
fi
- name: Run chart-testing (install)
run: |
changed=$(ct list-changed --config "${CT_CONFIGFILE}")
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/update-helm-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ jobs:
needs: [setup]
runs-on: ubuntu-latest
permissions:
contents: write # to push chart release, create release, and push tags to github
packages: write # to push package to ghcr
contents: write # allows GITHUB_TOKEN to push chart release, create release, and push tags to github
packages: write # allows GITHUB_TOKEN to push package to ghcr
env:
github_app_id: ${{ secrets.github_app_id }}
if: needs.setup.outputs.changed == 'true'
Expand Down Expand Up @@ -234,7 +234,9 @@ jobs:
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ env.AUTHTOKEN }}
# GitHub App installation token cannot push package to the org's package registry;
# using GITHUB_TOKEN here instead to avoid using PAT.
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push charts to GHCR
run: |
Expand Down
8 changes: 4 additions & 4 deletions charts/grafana-sampling/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: alloy
repository: https://grafana.github.io/helm-charts
version: 0.6.0
version: 0.10.1
- name: alloy
repository: https://grafana.github.io/helm-charts
version: 0.6.0
digest: sha256:e9dbff0d3707c403c1fb645eb33920a2219cc3156358134537e89caf39c588a5
generated: "2024-08-14T10:41:47.606272-07:00"
version: 0.10.1
digest: sha256:dc461e633c1504ba6c60e11c21afc3346444e175d4e3b7e0b538240c392c81d0
generated: "2024-12-11T10:44:32.61011-08:00"
8 changes: 4 additions & 4 deletions charts/grafana-sampling/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ apiVersion: v2
name: grafana-sampling
description: A Helm chart for a layered OTLP tail sampling and metrics generation pipeline.
type: application
version: 1.1.0
appVersion: "v1.3.0"
version: 1.1.1
appVersion: "v1.5.1"
sources:
- https://github.com/grafana/alloy
- https://grafana.com/docs/grafana-cloud/monitor-applications/application-observability/setup/sampling/tail/
dependencies:
- name: alloy
version: 0.6.0
version: 0.10.1
repository: https://grafana.github.io/helm-charts
alias: alloy-deployment
- name: alloy
version: 0.6.0
version: 0.10.1
repository: https://grafana.github.io/helm-charts
alias: alloy-statefulset
2 changes: 1 addition & 1 deletion charts/grafana-sampling/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# grafana-sampling

![Version: 1.1.0](https://img.shields.io/badge/Version-1.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.3.0](https://img.shields.io/badge/AppVersion-v1.3.0-informational?style=flat-square)
![Version: 1.1.1](https://img.shields.io/badge/Version-1.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.5.1](https://img.shields.io/badge/AppVersion-v1.5.1-informational?style=flat-square)

A Helm chart for a layered OTLP tail sampling and metrics generation pipeline.

Expand Down
4 changes: 2 additions & 2 deletions charts/grafana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: grafana
version: 8.5.12
appVersion: 11.3.0
version: 8.6.5
appVersion: 11.3.1
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
home: https://grafana.com
Expand Down
26 changes: 26 additions & 0 deletions charts/grafana/ci/with-nondefault-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,29 @@ ingress:
enabled: true
hosts:
- monitoring-{{ .Values.global.environment }}.example.com

route:
main:
enabled: true
labels:
app: monitoring-prometheus
hostnames:
- "*.example.com"
- "{{ .Values.global.environment }}.example.com"
filters:
- type: RequestHeaderModifier
requestHeaderModifier:
set:
- name: my-header-name
value: my-new-header-value
additionalRules:
- filters:
- type: RequestHeaderModifier
requestHeaderModifier:
set:
- name: my-header-name
value: my-new-header-value
matches:
- path:
type: PathPrefix
value: /foo/
2 changes: 0 additions & 2 deletions charts/grafana/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ helm.sh/chart: {{ include "grafana.chart" . }}
{{- if or .Chart.AppVersion .Values.image.tag }}
app.kubernetes.io/version: {{ mustRegexReplaceAllLiteral "@sha.*" .Values.image.tag "" | default .Chart.AppVersion | trunc 63 | trimSuffix "-" | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.extraLabels }}
{{ toYaml . }}
{{- end }}
Expand All @@ -93,7 +92,6 @@ helm.sh/chart: {{ include "grafana.chart" . }}
{{- if or .Chart.AppVersion .Values.image.tag }}
app.kubernetes.io/version: {{ mustRegexReplaceAllLiteral "@sha.*" .Values.image.tag "" | default .Chart.AppVersion | trunc 63 | trimSuffix "-" | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Expand Down
60 changes: 60 additions & 0 deletions charts/grafana/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,18 @@ containers:
- name: WATCH_CLIENT_TIMEOUT
value: "{{ .Values.sidecar.alerts.watchClientTimeout }}"
{{- end }}
{{- if .Values.sidecar.alerts.maxTotalRetries }}
- name: REQ_RETRY_TOTAL
value: "{{ .Values.sidecar.alerts.maxTotalRetries }}"
{{- end }}
{{- if .Values.sidecar.alerts.maxConnectRetries }}
- name: REQ_RETRY_CONNECT
value: "{{ .Values.sidecar.alerts.maxConnectRetries }}"
{{- end }}
{{- if .Values.sidecar.alerts.maxReadRetries }}
- name: REQ_RETRY_READ
value: "{{ .Values.sidecar.alerts.maxReadRetries }}"
{{- end }}
{{- with .Values.sidecar.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 6 }}
Expand Down Expand Up @@ -518,6 +530,18 @@ containers:
- name: WATCH_CLIENT_TIMEOUT
value: {{ .Values.sidecar.dashboards.watchClientTimeout | quote }}
{{- end }}
{{- if .Values.sidecar.dashboards.maxTotalRetries }}
- name: REQ_RETRY_TOTAL
value: "{{ .Values.sidecar.dashboards.maxTotalRetries }}"
{{- end }}
{{- if .Values.sidecar.dashboards.maxConnectRetries }}
- name: REQ_RETRY_CONNECT
value: "{{ .Values.sidecar.dashboards.maxConnectRetries }}"
{{- end }}
{{- if .Values.sidecar.dashboards.maxReadRetries }}
- name: REQ_RETRY_READ
value: "{{ .Values.sidecar.dashboards.maxReadRetries }}"
{{- end }}
{{- with .Values.sidecar.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 6 }}
Expand Down Expand Up @@ -630,6 +654,18 @@ containers:
- name: WATCH_CLIENT_TIMEOUT
value: "{{ .Values.sidecar.datasources.watchClientTimeout }}"
{{- end }}
{{- if .Values.sidecar.datasources.maxTotalRetries }}
- name: REQ_RETRY_TOTAL
value: "{{ .Values.sidecar.datasources.maxTotalRetries }}"
{{- end }}
{{- if .Values.sidecar.datasources.maxConnectRetries }}
- name: REQ_RETRY_CONNECT
value: "{{ .Values.sidecar.datasources.maxConnectRetries }}"
{{- end }}
{{- if .Values.sidecar.datasources.maxReadRetries }}
- name: REQ_RETRY_READ
value: "{{ .Values.sidecar.datasources.maxReadRetries }}"
{{- end }}
{{- with .Values.sidecar.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 6 }}
Expand Down Expand Up @@ -737,6 +773,18 @@ containers:
- name: WATCH_CLIENT_TIMEOUT
value: "{{ .Values.sidecar.notifiers.watchClientTimeout }}"
{{- end }}
{{- if .Values.sidecar.notifiers.maxTotalRetries }}
- name: REQ_RETRY_TOTAL
value: "{{ .Values.sidecar.notifiers.maxTotalRetries }}"
{{- end }}
{{- if .Values.sidecar.notifiers.maxConnectRetries }}
- name: REQ_RETRY_CONNECT
value: "{{ .Values.sidecar.notifiers.maxConnectRetries }}"
{{- end }}
{{- if .Values.sidecar.notifiers.maxReadRetries }}
- name: REQ_RETRY_READ
value: "{{ .Values.sidecar.notifiers.maxReadRetries }}"
{{- end }}
{{- with .Values.sidecar.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 6 }}
Expand Down Expand Up @@ -844,6 +892,18 @@ containers:
- name: WATCH_CLIENT_TIMEOUT
value: "{{ .Values.sidecar.plugins.watchClientTimeout }}"
{{- end }}
{{- if .Values.sidecar.plugins.maxTotalRetries }}
- name: REQ_RETRY_TOTAL
value: "{{ .Values.sidecar.plugins.maxTotalRetries }}"
{{- end }}
{{- if .Values.sidecar.plugins.maxConnectRetries }}
- name: REQ_RETRY_CONNECT
value: "{{ .Values.sidecar.plugins.maxConnectRetries }}"
{{- end }}
{{- if .Values.sidecar.plugins.maxReadRetries }}
- name: REQ_RETRY_READ
value: "{{ .Values.sidecar.plugins.maxReadRetries }}"
{{- end }}
{{- with .Values.sidecar.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 6 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/grafana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
template:
metadata:
labels:
{{- include "grafana.selectorLabels" . | nindent 8 }}
{{- include "grafana.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
1 change: 0 additions & 1 deletion charts/grafana/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
labels:
app.kubernetes.io/name: {{ include "grafana.name" . }}
helm.sh/chart: {{ include "grafana.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
scaleTargetRef:
Expand Down
1 change: 0 additions & 1 deletion charts/grafana/templates/image-renderer-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ metadata:
labels:
app.kubernetes.io/name: {{ include "grafana.name" . }}-image-renderer
helm.sh/chart: {{ include "grafana.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
scaleTargetRef:
Expand Down
44 changes: 44 additions & 0 deletions charts/grafana/templates/route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{- range $name, $route := .Values.route }}
{{- if $route.enabled -}}
---
apiVersion: {{ $route.apiVersion | default "gateway.networking.k8s.io/v1" }}
kind: {{ $route.kind | default "HTTPRoute" }}
metadata:
{{- with $route.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ template "grafana.fullname" $ }}{{ if ne $name "main" }}-{{ $name }}{{ end }}
namespace: {{ template "grafana.namespace" $ }}
labels:
app: {{ template "grafana.name" $ }}-prometheus
{{- include "grafana.labels" $ | nindent 4 }}
{{- with $route.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with $route.parentRefs }}
parentRefs:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $route.hostnames }}
hostnames:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
rules:
{{- if $route.additionalRules }}
{{- tpl (toYaml $route.additionalRules) $ | nindent 4 }}
{{- end }}
- backendRefs:
- name: {{ include "grafana.fullname" $ }}
port: {{ $.Values.service.port }}
{{- with $route.filters }}
filters:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $route.matches }}
matches:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/grafana/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
labels:
{{- include "grafana.selectorLabels" . | nindent 8 }}
{{- include "grafana.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
Loading

0 comments on commit add2b97

Please sign in to comment.