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

feat(deploy/helm): add value option to override release namespace #360

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create namespace used by the chart, defaulting to helm release namespace
*/}}
{{- define "kubernetes-replicator.namespace" -}}
{{- default .Release.Namespace .Values.namespaceOverride -}}
{{- end -}}

{{/*
Common labels
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "kubernetes-replicator.fullname" . }}
namespace: {{ include "kubernetes-replicator.namespace" . | quote }}
labels:
{{- include "kubernetes-replicator.labels" . | nindent 4 }}
{{- if .Values.labels }}
Expand Down
5 changes: 4 additions & 1 deletion deploy/helm-chart/kubernetes-replicator/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "kubernetes-replicator.serviceAccountName" . }}
namespace: {{ include "kubernetes-replicator.namespace" . | quote }}
labels:
{{- include "kubernetes-replicator.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
Expand All @@ -15,6 +16,7 @@ kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "kubernetes-replicator.fullname" . }}
namespace: {{ include "kubernetes-replicator.namespace" . | quote }}
labels:
{{- include "kubernetes-replicator.labels" . | nindent 4 }}
rules:
Expand Down Expand Up @@ -87,6 +89,7 @@ kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "kubernetes-replicator.fullname" . }}
namespace: {{ include "kubernetes-replicator.namespace" . | quote }}
labels:
{{- include "kubernetes-replicator.labels" . | nindent 4 }}
roleRef:
Expand All @@ -96,5 +99,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ include "kubernetes-replicator.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "kubernetes-replicator.namespace" . | quote }}
{{- end -}}
1 change: 1 addition & 0 deletions deploy/helm-chart/kubernetes-replicator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ image:
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
namespaceOverride: ""
grantClusterAdmin: false
automountServiceAccountToken: true
# args:
Expand Down