Skip to content

Commit

Permalink
Merge branch 'main' into ingress-service-type
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kovacs <[email protected]>
  • Loading branch information
kovaxur authored Nov 12, 2024
2 parents 5b26be2 + 51db949 commit f00b60f
Show file tree
Hide file tree
Showing 47 changed files with 272 additions and 34 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
19 changes: 17 additions & 2 deletions .github/workflows/update-helm-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ jobs:
fi
release:
needs: [ setup ]
needs: [setup]
runs-on: ubuntu-latest
permissions:
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 @@ -143,7 +145,7 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.5.2
version: v3.16.2

- name: Parse Chart.yaml
id: parse-chart
Expand Down Expand Up @@ -225,3 +227,16 @@ jobs:
run: |
cd helm-charts
"${CR_TOOL_PATH}/cr" index --config "${CR_CONFIGFILE}" --token "${{ env.AUTHTOKEN }}" --index-path "${CR_INDEX_PATH}" --package-path "${CR_PACKAGE_PATH}" --push
- name: Login to GHCR
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
# 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: |
helm push "${{ env.CR_PACKAGE_PATH }}/${{ steps.parse-chart.outputs.packagename }}.tgz" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/helm-charts"
2 changes: 1 addition & 1 deletion charts/agent-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: grafana-agent-operator
description: A Helm chart for Grafana Agent Operator
type: application
version: 0.4.4
version: 0.5.0
appVersion: "0.43.3"
home: https://grafana.com/docs/agent/v0.43/
icon: https://raw.githubusercontent.com/grafana/agent/v0.43.3/docs/sources/assets/logo_and_name.png
Expand Down
3 changes: 2 additions & 1 deletion charts/agent-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# grafana-agent-operator

![Version: 0.4.4](https://img.shields.io/badge/Version-0.4.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.43.3](https://img.shields.io/badge/AppVersion-0.43.3-informational?style=flat-square)
![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.43.3](https://img.shields.io/badge/AppVersion-0.43.3-informational?style=flat-square)

A Helm chart for Grafana Agent Operator

Expand Down Expand Up @@ -58,6 +58,7 @@ A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an
| containerSecurityContext | object | `{}` | Container security context (allowPrivilegeEscalation, etc.) |
| extraArgs | list | `[]` | List of additional cli arguments to configure agent-operator (example: `--log.level`) |
| fullnameOverride | string | `""` | Overrides the chart's computed fullname |
| global.commonLabels | object | `{}` | Common labels for all object directly managed by this chart. |
| hostAliases | list | `[]` | hostAliases to add |
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
| image.pullSecrets | list | `[]` | Image pull secrets |
Expand Down
3 changes: 3 additions & 0 deletions charts/agent-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- if .Values.customLabels }}
{{ toYaml .Values.customLabels }}
{{- end }}
{{- with .Values.global.commonLabels }}
{{ toYaml . }}
{{- end }}
{{- end }}

{{/*
Expand Down
4 changes: 4 additions & 0 deletions charts/agent-operator/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
global:
# -- Common labels for all object directly managed by this chart.
commonLabels: {}

# -- Overrides the chart's name
nameOverride: ""

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.8
appVersion: 11.2.2-security-01
version: 8.6.0
appVersion: 11.3.0
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
home: https://grafana.com
Expand Down
4 changes: 2 additions & 2 deletions charts/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ kind: ConfigMap
metadata:
name: sample-grafana-dashboard
labels:
grafana_dashboard: "1"
grafana_dashboard: "1"
data:
k8s-dashboard.json: |-
[...]
Expand Down Expand Up @@ -588,7 +588,7 @@ kind: ConfigMap
metadata:
name: sample-grafana-alert
labels:
grafana_alert: "1"
grafana_alert: "1"
data:
k8s-alert.yml: |-
apiVersion: 1
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
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/tests/test-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: {{ include "grafana.fullname" . }}-test
namespace: {{ include "grafana.namespace" . }}
annotations:
"helm.sh/hook": test
"helm.sh/hook": {{ .Values.testFramework.hookType | default "test" }}
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
labels:
{{- include "grafana.labels" . | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/grafana/templates/tests/test-podsecuritypolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: PodSecurityPolicy
metadata:
name: {{ include "grafana.fullname" . }}-test
annotations:
"helm.sh/hook": test
"helm.sh/hook": {{ .Values.testFramework.hookType | default "test" }}
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
labels:
{{- include "grafana.labels" . | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/grafana/templates/tests/test-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: {{ include "grafana.fullname" . }}-test
namespace: {{ include "grafana.namespace" . }}
annotations:
"helm.sh/hook": test
"helm.sh/hook": {{ .Values.testFramework.hookType | default "test" }}
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
labels:
{{- include "grafana.labels" . | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/grafana/templates/tests/test-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: {{ include "grafana.fullname" . }}-test
namespace: {{ include "grafana.namespace" . }}
annotations:
"helm.sh/hook": test
"helm.sh/hook": {{ .Values.testFramework.hookType | default "test" }}
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
labels:
{{- include "grafana.labels" . | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/grafana/templates/tests/test-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ metadata:
name: {{ include "grafana.serviceAccountNameTest" . }}
namespace: {{ include "grafana.namespace" . }}
annotations:
"helm.sh/hook": test
"helm.sh/hook": {{ .Values.testFramework.hookType | default "test" }}
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
{{- end }}
2 changes: 1 addition & 1 deletion charts/grafana/templates/tests/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
{{- include "grafana.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
"helm.sh/hook": {{ .Values.testFramework.hookType | default "test" }}
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
namespace: {{ include "grafana.namespace" . }}
spec:
Expand Down
40 changes: 40 additions & 0 deletions charts/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ image:

testFramework:
enabled: true
## The type of Helm hook used to run this test. Defaults to test.
## ref: https://helm.sh/docs/topics/charts_hooks/#the-available-hooks
##
# hookType: test
image:
# -- The Docker registry
registry: docker.io
Expand Down Expand Up @@ -307,6 +311,42 @@ ingress:
# hosts:
# - chart-example.local

# -- BETA: Configure the gateway routes for the chart here.
# More routes can be added by adding a dictionary key like the 'main' route.
# Be aware that this is an early beta of this feature,
# kube-prometheus-stack does not guarantee this works and is subject to change.
# Being BETA this can/will change in the future without notice, do not use unless you want to take that risk
# [[ref]](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io%2fv1alpha2)
route:
main:
# -- Enables or disables the route
enabled: false

# -- Set the route apiVersion, e.g. gateway.networking.k8s.io/v1 or gateway.networking.k8s.io/v1alpha2
apiVersion: gateway.networking.k8s.io/v1
# -- Set the route kind
# Valid options are GRPCRoute, HTTPRoute, TCPRoute, TLSRoute, UDPRoute
kind: HTTPRoute

annotations: {}
labels: {}

hostnames: []
# - my-filter.example.com
parentRefs: []
# - name: acme-gw

matches:
- path:
type: PathPrefix
value: /

## Filters define the filters that are applied to requests that match this rule.
filters: []

## Additional custom rules that can be added to the route
additionalRules: []

resources: {}
# limits:
# cpu: 100m
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: rollout-operator
description: "Grafana rollout-operator"
type: application
version: 0.18.0
version: 0.19.0
appVersion: v0.19.1
home: https://github.com/grafana/rollout-operator
kubeVersion: ^1.10.0-0
3 changes: 2 additions & 1 deletion charts/rollout-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Helm chart for deploying [Grafana rollout-operator](https://github.com/grafana/r

# rollout-operator

![Version: 0.18.0](https://img.shields.io/badge/Version-0.18.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.19.1](https://img.shields.io/badge/AppVersion-v0.19.1-informational?style=flat-square)
![Version: 0.19.0](https://img.shields.io/badge/Version-0.19.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.19.1](https://img.shields.io/badge/AppVersion-v0.19.1-informational?style=flat-square)

Grafana rollout-operator

Expand Down Expand Up @@ -41,6 +41,7 @@ It is not a highly available application and runs as a single pod.
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| fullnameOverride | string | `""` | |
| global.commonLabels | object | `{}` | Common labels for all object directly managed by this chart. |
| hostAliases | list | `[]` | hostAliases to add |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"grafana/rollout-operator"` | |
Expand Down
3 changes: 3 additions & 0 deletions charts/rollout-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ helm.sh/chart: {{ include "rollout-operator.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.global.commonLabels }}
{{ toYaml . }}
{{- end }}
{{- end }}

{{/*
Expand Down
2 changes: 2 additions & 0 deletions charts/rollout-operator/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "rollout-operator.fullname" . }}
labels:
{{- include "rollout-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
Expand Down
Loading

0 comments on commit f00b60f

Please sign in to comment.