Skip to content
Snippets Groups Projects
Commit 77234450 authored by Tom Zaspel's avatar Tom Zaspel Committed by Derek Su
Browse files

feat: add ability to set custom namespace


Signed-off-by: default avatarTom Zaspel <tom@zaspel.it>
parent 2840f27b
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,14 @@ Create chart name and version as used by the chart label. ...@@ -31,6 +31,14 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{- define "local-path-provisioner.namespace" -}}
{{- if .Values.namespaceOverride }}
{{- .Values.namespaceOverride }}
{{- else }}
{{- .Release.Namespace }}
{{- end }}
{{- end -}}
{{/* {{/*
Common labels Common labels
*/}} */}}
......
...@@ -2,7 +2,7 @@ apiVersion: v1 ...@@ -2,7 +2,7 @@ apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ .Values.configmap.name }} name: {{ .Values.configmap.name }}
namespace: {{ .Release.Namespace }} namespace: {{ include "local-path-provisioner.namespace" . }}
labels: labels:
{{ include "local-path-provisioner.labels" . | indent 4 }} {{ include "local-path-provisioner.labels" . | indent 4 }}
data: data:
...@@ -38,7 +38,7 @@ data: ...@@ -38,7 +38,7 @@ data:
kind: Pod kind: Pod
metadata: metadata:
name: {{ .Values.configmap.helperPod.name }} name: {{ .Values.configmap.helperPod.name }}
namespace: {{ default .Release.Namespace .Values.configmap.helperPod.namespaceOverride }} namespace: {{ default (include "local-path-provisioner.namespace" .) .Values.configmap.helperPod.namespaceOverride }}
{{- with .Values.configmap.helperPod.annotations }} {{- with .Values.configmap.helperPod.annotations }}
annotations: annotations:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
...@@ -59,4 +59,3 @@ data: ...@@ -59,4 +59,3 @@ data:
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
resources: resources:
{{- toYaml .Values.helperPod.resources | nindent 12 }} {{- toYaml .Values.helperPod.resources | nindent 12 }}
...@@ -2,7 +2,7 @@ apiVersion: apps/v1 ...@@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ include "local-path-provisioner.fullname" . }} name: {{ include "local-path-provisioner.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ include "local-path-provisioner.namespace" . }}
labels: labels:
{{ include "local-path-provisioner.labels" . | indent 4 }} {{ include "local-path-provisioner.labels" . | indent 4 }}
spec: spec:
...@@ -72,7 +72,7 @@ spec: ...@@ -72,7 +72,7 @@ spec:
mountPath: /etc/config/ mountPath: /etc/config/
env: env:
- name: POD_NAMESPACE - name: POD_NAMESPACE
value: {{ .Release.Namespace }} value: {{ include "local-path-provisioner.namespace" . }}
- name: CONFIG_MOUNT_PATH - name: CONFIG_MOUNT_PATH
value: /etc/config/ value: /etc/config/
resources: resources:
......
...@@ -3,7 +3,7 @@ apiVersion: v1 ...@@ -3,7 +3,7 @@ apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: {{ .Values.defaultSettings.registrySecret }} name: {{ .Values.defaultSettings.registrySecret }}
namespace: {{ .Release.Namespace }} namespace: {{ include "local-path-provisioner.namespace" . }}
type: kubernetes.io/dockerconfigjson type: kubernetes.io/dockerconfigjson
data: data:
.dockerconfigjson: {{ template "local-path-provisioner.secret" . }} .dockerconfigjson: {{ template "local-path-provisioner.secret" . }}
......
...@@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1 ...@@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role kind: Role
metadata: metadata:
name: {{ include "local-path-provisioner.fullname" . }} name: {{ include "local-path-provisioner.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ include "local-path-provisioner.namespace" . }}
labels: labels:
{{ include "local-path-provisioner.labels" . | indent 4 }} {{ include "local-path-provisioner.labels" . | indent 4 }}
rules: rules:
......
...@@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1 ...@@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding kind: RoleBinding
metadata: metadata:
name: {{ include "local-path-provisioner.fullname" . }} name: {{ include "local-path-provisioner.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ include "local-path-provisioner.namespace" . }}
labels: labels:
{{ include "local-path-provisioner.labels" . | indent 4 }} {{ include "local-path-provisioner.labels" . | indent 4 }}
roleRef: roleRef:
...@@ -13,5 +13,5 @@ roleRef: ...@@ -13,5 +13,5 @@ roleRef:
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ template "local-path-provisioner.serviceAccountName" . }} name: {{ template "local-path-provisioner.serviceAccountName" . }}
namespace: {{ .Release.Namespace }} namespace: {{ include "local-path-provisioner.namespace" . }}
{{- end -}} {{- end -}}
...@@ -3,7 +3,7 @@ apiVersion: v1 ...@@ -3,7 +3,7 @@ apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: {{ template "local-path-provisioner.serviceAccountName" . }} name: {{ template "local-path-provisioner.serviceAccountName" . }}
namespace: {{ .Release.Namespace }} namespace: {{ include "local-path-provisioner.namespace" . }}
labels: labels:
{{ include "local-path-provisioner.labels" . | indent 4 }} {{ include "local-path-provisioner.labels" . | indent 4 }}
imagePullSecrets: imagePullSecrets:
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
replicaCount: 1 replicaCount: 1
commonLabels: {} commonLabels: {}
namespace: local-path-provisioner
image: image:
repository: rancher/local-path-provisioner repository: rancher/local-path-provisioner
...@@ -162,7 +163,6 @@ configmap: ...@@ -162,7 +163,6 @@ configmap:
namespaceOverride: "" namespaceOverride: ""
name: "helper-pod" name: "helper-pod"
annotations: {} annotations: {}
# Number of provisioner worker threads to call provision/delete simultaneously. # Number of provisioner worker threads to call provision/delete simultaneously.
# workerThreads: 4 # workerThreads: 4
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment