Skip to content

Commit

Permalink
Merge branch 'main' into nlb-protocols
Browse files Browse the repository at this point in the history
Signed-off-by: MH <[email protected]>
  • Loading branch information
zanhsieh authored Nov 3, 2024
2 parents e3babe0 + 29bacb8 commit ef3172c
Show file tree
Hide file tree
Showing 46 changed files with 135 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-codeowners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: install yq
run: |
sudo snap install yq
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v4
with:
version: ${{ inputs.helm_version }}

# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.12

- name: Set up chart-testing
uses: helm/[email protected]
Expand All @@ -59,7 +59,7 @@ jobs:
run: |
changed=$(ct list-changed --config "${CT_CONFIGFILE}")
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Check Docs
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -25,7 +25,7 @@ jobs:
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/setup-helm@v3.5
uses: azure/setup-helm@v4
with:
version: v3.12.0

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: |
cp -f README.md ${{ runner.temp }}/README.md
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: gh-pages
- run: |
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/update-helm-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
chartpath: ${{ steps.list-changed.outputs.chartpath }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
path: source
Expand Down Expand Up @@ -91,8 +91,11 @@ jobs:
fi
release:
needs: [ setup ]
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
env:
github_app_id: ${{ secrets.github_app_id }}
if: needs.setup.outputs.changed == 'true'
Expand All @@ -114,7 +117,7 @@ jobs:
fi
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
path: source
Expand All @@ -127,7 +130,7 @@ jobs:
- name: Checkout helm-charts
# The cr tool only works if the target repository is already checked out
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: grafana/helm-charts
Expand All @@ -141,9 +144,9 @@ jobs:
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1
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 +228,14 @@ 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 }}
password: ${{ env.AUTHTOKEN }}

- 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 .github/workflows/validate-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
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.3
appVersion: 11.2.2
version: 8.5.11
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
6 changes: 3 additions & 3 deletions charts/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ need to instead set `global.imageRegistry`.
| `lifecycleHooks` | Lifecycle hooks for podStart and preStop [Example](https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/#define-poststart-and-prestop-handlers) | `{}` |
| `sidecar.image.registry` | Sidecar image registry | `quay.io` |
| `sidecar.image.repository` | Sidecar image repository | `kiwigrid/k8s-sidecar` |
| `sidecar.image.tag` | Sidecar image tag | `1.26.0` |
| `sidecar.image.tag` | Sidecar image tag | `1.28.0` |
| `sidecar.image.sha` | Sidecar image sha (optional) | `""` |
| `sidecar.imagePullPolicy` | Sidecar image pull policy | `IfNotPresent` |
| `sidecar.resources` | Sidecar resources | `{}` |
Expand Down 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
4 changes: 4 additions & 0 deletions charts/grafana/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ grafana.ini: |
{{- if not (kindIs "map" $elemVal) }}
{{- if kindIs "invalid" $elemVal }}
{{ $elem }} =
{{- else if kindIs "slice" $elemVal }}
{{ $elem }} = {{ toJson $elemVal }}
{{- else if kindIs "string" $elemVal }}
{{ $elem }} = {{ tpl $elemVal $ }}
{{- else }}
Expand All @@ -26,6 +28,8 @@ grafana.ini: |
{{- range $elem, $elemVal := $value }}
{{- if kindIs "invalid" $elemVal }}
{{ $elem }} =
{{- else if kindIs "slice" $elemVal }}
{{ $elem }} = {{ toJson $elemVal }}
{{- else if kindIs "string" $elemVal }}
{{ $elem }} = {{ tpl $elemVal $ }}
{{- else }}
Expand Down
9 changes: 9 additions & 0 deletions charts/grafana/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,9 @@ containers:
volumeMounts:
- name: sc-datasources-volume
mountPath: "/etc/grafana/provisioning/datasources"
{{- with .Values.sidecar.datasources.extraMounts }}
{{- toYaml . | trim | nindent 6 }}
{{- end }}
{{- end}}
{{- if .Values.sidecar.notifiers.enabled }}
- name: {{ include "grafana.name" . }}-sc-notifiers
Expand Down Expand Up @@ -753,6 +756,9 @@ containers:
volumeMounts:
- name: sc-notifiers-volume
mountPath: "/etc/grafana/provisioning/notifiers"
{{- with .Values.sidecar.notifiers.extraMounts }}
{{- toYaml . | trim | nindent 6 }}
{{- end }}
{{- end}}
{{- if .Values.sidecar.plugins.enabled }}
- name: {{ include "grafana.name" . }}-sc-plugins
Expand Down Expand Up @@ -857,6 +863,9 @@ containers:
volumeMounts:
- name: sc-plugins-volume
mountPath: "/etc/grafana/provisioning/plugins"
{{- with .Values.sidecar.plugins.extraMounts }}
{{- toYaml . | trim | nindent 6 }}
{{- end }}
{{- end}}
- name: {{ .Chart.Name }}
{{- $registry := .Values.global.imageRegistry | default .Values.image.registry -}}
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 @@ -14,7 +14,7 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and (not .Values.autoscaling.enabled) (.Values.replicas) }}
{{- if (not .Values.autoscaling.enabled) }}
replicas: {{ .Values.replicas }}
{{- end }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
Expand Down
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
Loading

0 comments on commit ef3172c

Please sign in to comment.