Skip to content

Commit

Permalink
feat(argo-events): Add ability to set .Values.namespaceOverride
Browse files Browse the repository at this point in the history
Signed-off-by: Joshal Daftari <jdaftari@confluent.io>
  • Loading branch information
jdaftari-confluent committed Mar 21, 2024
1 parent e248b6b commit be0b904
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 17 deletions.
6 changes: 3 additions & 3 deletions charts/argo-events/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v1.9.1
description: A Helm chart for Argo Events, the event-driven workflow automation framework
name: argo-events
version: 2.4.3
version: 2.4.4
home: https://github.com/argoproj/argo-helm
icon: https://avatars.githubusercontent.com/u/30269780?s=200&v=4
keywords:
Expand All @@ -18,5 +18,5 @@ annotations:
fingerprint: 2B8F22F57260EFA67BE1C5824B11F800CD9D2252
url: https://argoproj.github.io/argo-helm/pgp_keys.asc
artifacthub.io/changes: |
- kind: changed
description: Bump argo-events to v1.9.1
- kind: added
description: Support namespaceOverride
1 change: 1 addition & 0 deletions charts/argo-events/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ done
| global.podLabels | object | `{}` | Labels for the all deployed pods |
| global.securityContext | object | `{}` | Toggle and define securityContext. See [values.yaml] |
| nameOverride | string | `"argo-events"` | Provide a name in place of `argo-events` |
| namespaceOverride | string | `.Release.Namespace` | Override the namespace |
| openshift | bool | `false` | Deploy on OpenShift |

### Controller
Expand Down
8 changes: 8 additions & 0 deletions charts/argo-events/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,11 @@ Define Pdb apiVersion
{{- printf "policy/v1beta1" -}}
{{- end }}
{{- end }}

{{/*
Expand the namespace of the release.
Allows overriding it for multi-namespace deployments in combined charts.
*/}}
{{- define "argo-events.namespace" -}}
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "argo-events.controller.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "name" .Values.controller.name) | nindent 4 }}
data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "argo-events.controller.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
app.kubernetes.io/version: {{ include "argo-events.controller_chart_version_label" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: {{ template "argo-events.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "argo-events.controller.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
{{- with .Values.controller.pdb.labels }}
Expand Down
4 changes: 2 additions & 2 deletions charts/argo-events/templates/argo-events-controller/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: {{ .Values.controller.rbac.namespaced | ternary "Role" "ClusterRole" }}
metadata:
name: {{ include "argo-events.controller.fullname" . }}
{{- if .Values.controller.rbac.namespaced }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
{{- end }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
Expand Down Expand Up @@ -122,5 +122,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ include "argo-events.controller.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ template "argo-events.controller.fullname" . }}-metrics
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
{{- with .Values.controller.metrics.service.annotations }}
annotations:
{{- range $key, $value := . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: ServiceAccount
automountServiceAccountToken: {{ .Values.controller.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "argo-events.controller.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
{{- with .Values.controller.serviceAccount.annotations }}
annotations:
{{- range $key, $value := . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "argo-events.controller.fullname" . }}
namespace: {{ default .Release.Namespace .Values.controller.metrics.serviceMonitor.namespace | quote }}
namespace: {{ default (include "argo-events.namespace" .) .Values.controller.metrics.serviceMonitor.namespace | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
{{- with .Values.controller.metrics.serviceMonitor.selector }}
Expand All @@ -29,7 +29,7 @@ spec:
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
- {{ include "argo-events.namespace" . | quote }}
selector:
matchLabels:
{{- include "argo-events.selectorLabels" (dict "context" . "component" .Values.controller.name "name" (printf "%s-metrics" .Values.controller.name)) | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ include "argo-events.webhook.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: events-webhook
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.webhook.name "name" .Values.webhook.name) | nindent 4 }}
app.kubernetes.io/version: {{ include "argo-events.webhook_chart_version_label" . }}
Expand Down
2 changes: 1 addition & 1 deletion charts/argo-events/templates/argo-events-webhook/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: {{ template "argo-events.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "argo-events.webhook.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.webhook.name "name" .Values.webhook.name) | nindent 4 }}
{{- with .Values.webhook.pdb.labels }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: events-webhook
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "name" .Values.webhook.name) | nindent 4 }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: ServiceAccount
automountServiceAccountToken: {{ .Values.webhook.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "argo-events.webhook.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "argo-events.namespace" . | quote }}
{{- with .Values.webhook.serviceAccount.annotations }}
annotations:
{{- range $key, $value := . }}
Expand Down
4 changes: 4 additions & 0 deletions charts/argo-events/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ nameOverride: argo-events
# -- String to fully override "argo-events.fullname" template
fullnameOverride: ""

# -- Override the namespace
# @default -- `.Release.Namespace`
namespaceOverride: ""

# -- Deploy on OpenShift
openshift: false

Expand Down

0 comments on commit be0b904

Please sign in to comment.