Skip to content

Commit

Permalink
Add namespace value for configuring the destination namespace of the …
Browse files Browse the repository at this point in the history
…kubernetes manifests
  • Loading branch information
Jaydee94 committed May 6, 2024
1 parent 5b9f2b3 commit dd9ba25
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 0 deletions.
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
*/}}
{{- 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: ""

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 dd9ba25

Please sign in to comment.