Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions helm/charts/nats/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ extraResources:
labels:
$tplYaml: |
{{ include "nats.labels" $ }}
annotations:
$tplYaml: |
{{ include "nats.annotations" $ }}
spec:
hosts:
- demo.nats.io
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/nats/files/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: {{ .Values.configMap.name }}
labels:
{{- include "nats.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
data:
nats.conf: |
{{- include "nats.formatConfig" .config | nindent 4 }}
2 changes: 2 additions & 0 deletions helm/charts/nats/files/headless-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: {{ .Values.headlessService.name }}
labels:
{{- include "nats.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
spec:
selector:
{{- include "nats.selectorLabels" $ | nindent 4 }}
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/nats/files/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metadata:
name: {{ .name }}
labels:
{{- include "nats.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
spec:
{{- with .className }}
ingressClassName: {{ . | quote }}
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/nats/files/nats-box/contents-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: {{ .Values.natsBox.contentsSecret.name }}
labels:
{{- include "natsBox.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
type: Opaque
stringData:
{{- range $ctxKey, $ctxVal := .Values.natsBox.contexts }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: {{ .Values.natsBox.contextsSecret.name }}
labels:
{{- include "natsBox.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
type: Opaque
stringData:
{{- range $ctxKey, $ctxVal := .Values.natsBox.contexts }}
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/nats/files/nats-box/deployment/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: {{ .Values.natsBox.deployment.name }}
labels:
{{- include "natsBox.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
spec:
selector:
matchLabels:
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/nats/files/nats-box/deployment/pod-template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
metadata:
labels:
{{- include "natsBox.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
spec:
containers:
{{- with .Values.natsBox.container }}
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/nats/files/nats-box/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ metadata:
name: {{ .Values.natsBox.serviceAccount.name }}
labels:
{{- include "natsBox.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
2 changes: 2 additions & 0 deletions helm/charts/nats/files/pod-disruption-budget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: {{ .Values.podDisruptionBudget.name }}
labels:
{{- include "nats.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
spec:
maxUnavailable: 1
selector:
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/nats/files/pod-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: {{ .Values.promExporter.podMonitor.name }}
labels:
{{- include "nats.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
spec:
selector:
matchLabels:
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/nats/files/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ metadata:
name: {{ .Values.serviceAccount.name }}
labels:
{{- include "nats.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
2 changes: 2 additions & 0 deletions helm/charts/nats/files/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: {{ .Values.service.name }}
labels:
{{- include "nats.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
spec:
selector:
{{- include "nats.selectorLabels" $ | nindent 4 }}
Expand Down
1 change: 1 addition & 0 deletions helm/charts/nats/files/stateful-set/pod-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ metadata:
labels:
{{- include "nats.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
{{- if .Values.podTemplate.configChecksumAnnotation }}
{{- $configMap := include "nats.loadMergePatch" (merge (dict "file" "config-map.yaml" "ctx" $) $.Values.configMap) }}
checksum/config: {{ sha256sum $configMap }}
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/nats/files/stateful-set/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: {{ .Values.statefulSet.name }}
labels:
{{- include "nats.labels" $ | nindent 4 }}
annotations:
{{- include "nats.annotations" $ | nindent 4 }}
spec:
selector:
matchLabels:
Expand Down
9 changes: 9 additions & 0 deletions helm/charts/nats/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: nats-box
{{- end }}

{{/*
NATS annotations
*/}}
{{- define "nats.annotations" -}}
{{- with .Values.global.annotations -}}
{{ toYaml . }}
{{- end }}
{{- end }}

{{/*
Print the image
*/}}
Expand Down
6 changes: 6 additions & 0 deletions helm/charts/nats/test/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,9 @@ extraResources:
labels:
$tplYaml: |
{{ include "nats.labels" $ }}
annotations:
$tplYaml: |
{{ include "nats.annotations" $ }}
spec:
selector:
labels:
Expand All @@ -651,6 +654,9 @@ extraResources:
name: {{ include "nats.fullname" $ }}-extra
labels:
{{- include "nats.labels" $ | nindent 4 }}
annotations:
$tplYaml: |
{{ include "nats.annotations" $ }}
data:
foo: bar
`
Expand Down
4 changes: 4 additions & 0 deletions helm/charts/nats/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ global:

# global labels will be applied to all resources deployed by the chart
labels: {}
annotations: {}

################################################################################
# Common options
Expand Down Expand Up @@ -656,6 +657,9 @@ natsBox:
# labels:
# $tplYaml: |
# {{ include "nats.labels" $ }}
# annotations:
# $tplYaml: |
# {{ include "nats.annotations" $ }}
# spec:
# hosts:
# - demo.nats.io
Expand Down