Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add namespace value for configuring the destination namespace (Helm subchart) #59

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions deploy/chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Namespace for all resources to be installed into
If not defined in values file then the helm release namespace is used
By default this is not set so the helm release namespace will be used
Jaydee94 marked this conversation as resolved.
Show resolved Hide resolved
*/}}
{{- define "openshift-routes.namespace" -}}
{{ .Values.namespace | default .Release.Namespace }}
{{- end -}}

{{/*
Common labels
*/}}
Expand Down
1 change: 1 addition & 0 deletions deploy/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "openshift-routes.fullname" . }}
namespace: {{ include "openshift-routes.namespace" . }}
labels:
{{- include "openshift-routes.labels" . | nindent 4 }}
spec:
Expand Down
1 change: 1 addition & 0 deletions deploy/chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "openshift-routes.fullname" . }}
namespace: {{ include "openshift-routes.namespace" . }}
labels:
{{- include "openshift-routes.labels" . | nindent 4 }}
spec:
Expand Down
1 change: 1 addition & 0 deletions deploy/chart/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "openshift-routes.serviceAccountName" . }}
namespace: {{ include "openshift-routes.namespace" . }}
labels:
{{- include "openshift-routes.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
Expand Down
1 change: 1 addition & 0 deletions deploy/chart/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "openshift-routes.fullname" . }}
namespace: {{ include "openshift-routes.namespace" . }}
labels:
{{- include "openshift-routes.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 2 additions & 0 deletions deploy/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ logLevel: 5
nameOverride: ""
fullnameOverride: ""

namespace: ""
maelvls marked this conversation as resolved.
Show resolved Hide resolved

image:
# https://github.com/cert-manager/openshift-routes/pkgs/container/cert-manager-openshift-routes
# the final image is generated as "${registry}/${repostiory}:${tag|digest}"
Expand Down
Loading