Skip to content

Commit

Permalink
Merge pull request #59 from Jaydee94/main
Browse files Browse the repository at this point in the history
Add namespace value for configuring the destination namespace
  • Loading branch information
cert-manager-prow[bot] authored Jun 3, 2024
2 parents 5b9f2b3 + cb6b234 commit 0cf6d64
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 0 deletions.
13 changes: 13 additions & 0 deletions deploy/chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ 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.
This gets around an problem within Helm discussed in
https://github.com/helm/helm/issues/5358.
*/}}
{{- 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
5 changes: 5 additions & 0 deletions deploy/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ logLevel: 5
nameOverride: ""
fullnameOverride: ""

# This namespace allows you to define where the services are installed into.
# If not set then they use the namespace of the release.
# This is helpful when installing cert manager as a chart dependency (sub chart).
namespace: ""

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

0 comments on commit 0cf6d64

Please sign in to comment.