Skip to content

Commit

Permalink
chore: Use more modern $.Values syntax (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaikaN57 authored Apr 23, 2024
1 parent 8fb7d95 commit ba4838e
Show file tree
Hide file tree
Showing 21 changed files with 70 additions and 83 deletions.
2 changes: 1 addition & 1 deletion charts/daemonset-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: daemonset-app
description: Default DaemonSet Helm Chart
type: application
version: 0.15.4
version: 0.15.5
appVersion: latest
maintainers:
- name: diranged
Expand Down
2 changes: 1 addition & 1 deletion charts/daemonset-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Default DaemonSet Helm Chart

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

[statefulsets]: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/
[hpa]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
Expand Down
28 changes: 13 additions & 15 deletions charts/daemonset-app/templates/prometheusrules.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{{- $values := .Values }}
{{- $global := . }}
{{- $targetNamespace := .Release.Namespace }}
{{- $runbookUrl := required "Values.runbookUrl can not be blank!" .Values.runbookUrl }}
{{- $appName := include "nd-common.fullname" . }}
Expand Down Expand Up @@ -38,7 +36,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand All @@ -65,7 +63,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -95,7 +93,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -136,7 +134,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand All @@ -155,7 +153,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -199,8 +197,8 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- if $values.prometheusRules.additionalRuleLabels }}
{{ toYaml $values.prometheusRules.additionalRuleLabels | nindent 8 }}
{{- if $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml $.Values.prometheusRules.additionalRuleLabels | nindent 8 }}
{{- end }}
{{- end }}

Expand All @@ -220,8 +218,8 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- if $values.prometheusRules.additionalRuleLabels }}
{{ toYaml $values.prometheusRules.additionalRuleLabels | nindent 8 }}
{{- if $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml $.Values.prometheusRules.additionalRuleLabels | nindent 8 }}
{{- end }}
{{- end }}

Expand All @@ -241,8 +239,8 @@ spec:
for: 10m
labels:
severity: {{ .severity }}
{{- if $values.prometheusRules.additionalRuleLabels }}
{{ toYaml $values.prometheusRules.additionalRuleLabels | nindent 8 }}
{{- if $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml $.Values.prometheusRules.additionalRuleLabels | nindent 8 }}
{{- end }}
{{- end }}

Expand All @@ -259,8 +257,8 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- if $values.prometheusRules.additionalRuleLabels }}
{{ toYaml $values.prometheusRules.additionalRuleLabels | nindent 8 }}
{{- if $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml $.Values.prometheusRules.additionalRuleLabels | nindent 8 }}
{{- end }}
{{- end }}

Expand Down
2 changes: 1 addition & 1 deletion charts/flink-job/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "1.0"
description: Flink job cluster on k8s
name: flink-job
version: 0.1.20
version: 0.1.21
maintainers:
- name: Zedive
email: albert@nextdoor.com
2 changes: 1 addition & 1 deletion charts/flink-job/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Flink job cluster on k8s

![Version: 0.1.20](https://img.shields.io/badge/Version-0.1.20-informational?style=flat-square) ![AppVersion: 1.0](https://img.shields.io/badge/AppVersion-1.0-informational?style=flat-square)
![Version: 0.1.21](https://img.shields.io/badge/Version-0.1.21-informational?style=flat-square) ![AppVersion: 1.0](https://img.shields.io/badge/AppVersion-1.0-informational?style=flat-square)

This chart deploys a flink job cluster and runs a simple word counting flink app as an example.
This chart includes some production ready set-ups such as
Expand Down
9 changes: 4 additions & 5 deletions charts/flink-job/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{- if .Values.alerts.enabled -}}

{{ $values := .Values }}
{{ $cluster := .Values.fullnameOverride }}
{{ $namespace := .Release.Namespace }}

Expand All @@ -15,7 +14,7 @@ spec:
- alert: NoFlinkJobRunning
annotations:
summary: No Flink job running in this job cluster.
runbook_url: "{{ $values.defaults.runbookUrl }}#noflinkjobrunning"
runbook_url: "{{ $.Values.defaults.runbookUrl }}#noflinkjobrunning"
description: >-
No job is running in {{ template "flink-job-cluster.fullname" . }}.
expr: >-
Expand All @@ -26,7 +25,7 @@ spec:
- alert: FlinkJobOutage
annotations:
summary: Flink job is down
runbook_url: "{{ $values.defaults.runbookUrl }}#flinkjoboutage"
runbook_url: "{{ $.Values.defaults.runbookUrl }}#flinkjoboutage"
description: >-
The job running in {{ template "flink-job-cluster.fullname" . }} is down for more than 10s.
expr: >-
Expand All @@ -40,7 +39,7 @@ spec:
- alert: FlinkJobTooManyRestarts
annotations:
summary: Flink job has too many restarts
runbook_url: "{{ $values.defaults.runbookUrl }}#flinkjobtoomanyrestarts"
runbook_url: "{{ $.Values.defaults.runbookUrl }}#flinkjobtoomanyrestarts"
description: >-
The job running in {{ template "flink-job-cluster.fullname" . }} is having too many restarts.
expr: >-
Expand All @@ -54,7 +53,7 @@ spec:
- alert: FlinkCheckpointFailing
annotations:
summary: Flink fails to capture the checkpoint.
runbook_url: "{{ $values.defaults.runbookUrl }}#flinkcheckpointfailing"
runbook_url: "{{ $.Values.defaults.runbookUrl }}#flinkcheckpointfailing"
description: >-
The job manager in {{ template "flink-job-cluster.fullname" . }} fails to capture checkpoint.
expr: >-
Expand Down
3 changes: 1 addition & 2 deletions charts/istio-alerts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ apiVersion: v2
name: istio-alerts
description: A Helm chart that provisions a series of alerts for istio VirtualServices
type: application
version: 0.4.0
appVersion: 0.0.1
version: 0.4.1
maintainers:
- name: diranged
email: matt@nextdoor.com
Expand Down
2 changes: 1 addition & 1 deletion charts/istio-alerts/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# istio-alerts

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

A Helm chart that provisions a series of alerts for istio VirtualServices

Expand Down
22 changes: 10 additions & 12 deletions charts/istio-alerts/templates/service-prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{{ $destinationServiceSelectorForIstioMetrics := include "istio-alerts.destinationServiceSelectorForIstioMetrics" . }}
{{ $destinationServiceSelectorForKubeStateMetrics := include "istio-alerts.destinationServiceSelectorForKubeStateMetrics" . }}
{{- $values := .Values }}
{{- $release := .Release }}

{{- if .Values.serviceRules.enabled }}
apiVersion: monitoring.coreos.com/v1
Expand All @@ -22,7 +20,7 @@ spec:
annotations:
summary: >-
{{`{{$labels.destination_service_name}} is throwing too many 5xx errors (namespace: {{$labels.namespace}})`}}
runbook_url: {{ $values.defaults.runbookUrl }}#5xx-Rate-Too-High
runbook_url: {{ $.Values.defaults.runbookUrl }}#5xx-Rate-Too-High
description: >-
High rate of 5xx responses from the {{`{{$labels.destination_service_name}}`}} VirtualService
in namespace {{`{{$labels.namespace}}`}}.
Expand All @@ -43,8 +41,8 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
namespace: {{ $release.Namespace }}
{{- with $values.defaults.additionalRuleLabels}}
namespace: {{ $.Release.Namespace }}
{{- with $.Values.defaults.additionalRuleLabels}}
{{ toYaml . | nindent 8}}
{{- end }}
{{- end }}
Expand All @@ -55,7 +53,7 @@ spec:
annotations:
summary: >-
{{`{{$labels.destination_service_name}}`}} avg request latencies are above {{ .threshold }}s!
runbook_url: {{ $values.defaults.runbookUrl}}#HighRequestLatency
runbook_url: {{ $.Values.defaults.runbookUrl}}#HighRequestLatency
description: >-
Average request latency of {{`{{ $value | humanizePercentage }}`}} is above threshold ({{ .threshold }}s)
in namespace {{`{{ $labels.namespace }}`}} for pod {{`{{ $labels.pod }}`}} (container: {{`{{ $labels.container }}`}}).
Expand All @@ -78,8 +76,8 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
namespace: {{ $release.Namespace }}
{{- with $values.defaults.additionalRuleLabels}}
namespace: {{ $.Release.Namespace }}
{{- with $.Values.defaults.additionalRuleLabels}}
{{ toYaml . | nindent 8}}
{{- end }}
{{- end }}
Expand All @@ -90,13 +88,13 @@ spec:
annotations:
summary: >-
DestinationServiceSelector for istio-alerts is invalid
runbook_url: {{ $values.defaults.runbookUrl}}#Alert-Rules-Selectors-Validity
runbook_url: {{ $.Values.defaults.runbookUrl}}#Alert-Rules-Selectors-Validity
description: >-
The DestinationServiceSelector used for service level alerts did not return any data.
Please check the DestinationServiceSelector applied in your istio-alerts chart
is correct to ensure you are properly selecting your service so that you
will be alerted for service issues. The current selector is
`{destination_service_namespace="{{ $release.Namespace }}", destination_service_name="{{ $.Values.serviceRules.destinationServiceName }}"}`.
`{destination_service_namespace="{{ $.Release.Namespace }}", destination_service_name="{{ $.Values.serviceRules.destinationServiceName }}"}`.
expr: >-
(
count(
Expand All @@ -108,8 +106,8 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
namespace: {{ $release.Namespace }}
{{- with $values.defaults.additionalRuleLabels}}
namespace: {{ $.Release.Namespace }}
{{- with $.Values.defaults.additionalRuleLabels}}
{{ toYaml . | nindent 8}}
{{- end }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/istio-endpoints/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: istio-endpoints
description: Per-Namespace Istio Configuration Chart
type: application
version: 0.4.0
version: 0.4.1
appVersion: latest
maintainers:
- name: diranged
Expand Down
4 changes: 2 additions & 2 deletions charts/istio-endpoints/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Per-Namespace Istio Configuration Chart

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

[elasticache]: https://aws.amazon.com/elasticache/
[serviceentry]: https://istio.io/latest/docs/reference/config/networking/service-entry/
Expand Down Expand Up @@ -77,7 +77,7 @@ the cluster, you must specify those namespaces and services in the
+ dependencies:
+ - name: istio-endpoints
+ repository: https://k8s-charts.nextdoor.com
+ version: 0.4.0
+ version: 0.4.1
maintainers:
- name: diranged
email: matt@nextdoor.com
Expand Down
5 changes: 2 additions & 3 deletions charts/istio-endpoints/templates/sidecar.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- if .Values.sidecar.enabled }}
{{- $global := . }}
apiVersion: networking.istio.io/v1beta1
kind: Sidecar
metadata:
Expand Down Expand Up @@ -29,7 +28,7 @@ spec:
can be customized though.
*/}}
- # Default CatchAll
captureMode: {{ $global.Values.sidecar.catchAllCaptureMode }}
captureMode: {{ $.Values.sidecar.catchAllCaptureMode }}
hosts:
{{- toYaml $global.Values.sidecar.catchAllHosts | nindent 8 }}
{{- toYaml $.Values.sidecar.catchAllHosts | nindent 8 }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/rollout-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: rollout-app
description: Argo Rollout-based Application Helm Chart
type: application
version: 1.0.0
version: 1.0.1
appVersion: latest
maintainers:
- name: diranged
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Argo Rollout-based Application Helm Chart

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

[analysistemplate]: https://argoproj.github.io/argo-rollouts/features/analysis/?query=AnalysisTemplate#background-analysis
[argo_rollouts]: https://argoproj.github.io/argo-rollouts/
Expand Down
16 changes: 7 additions & 9 deletions charts/rollout-app/templates/prometheusrules.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{{- $values := .Values }}
{{- $global := . }}
{{- $targetNamespace := .Release.Namespace }}
{{- $runbookUrl := required "Values.runbookUrl can not be blank!" .Values.runbookUrl }}
{{- $appName := include "nd-common.fullname" . }}
Expand Down Expand Up @@ -38,7 +36,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand All @@ -65,7 +63,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -95,7 +93,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -136,7 +134,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand All @@ -155,7 +153,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -196,7 +194,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand All @@ -219,7 +217,7 @@ spec:
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{- with $.Values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand Down
Loading

0 comments on commit ba4838e

Please sign in to comment.