Add namespace override
Signed-off-by: Guangbo Chen <steven.guangbo.chen@gmail.com>
This commit is contained in:
parent
d77dc2c35e
commit
791d63c5e3
@ -53,3 +53,14 @@ app.kubernetes.io/version: {{ .Chart.AppVersion }}
|
||||
{{ include "system_default_registry" . }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /*
|
||||
define the longhorn release namespace
|
||||
*/ -}}
|
||||
{{- define "release_namespace" -}}
|
||||
{{- if .Values.namespaceOverride -}}
|
||||
{{- .Values.namespaceOverride -}}
|
||||
{{- else -}}
|
||||
{{- .Release.Namespace -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
@ -10,4 +10,4 @@ roleRef:
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: longhorn-service-account
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
|
@ -4,7 +4,7 @@ metadata:
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
app: longhorn-manager
|
||||
name: longhorn-manager
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
@ -97,7 +97,7 @@ metadata:
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
app: longhorn-manager
|
||||
name: longhorn-backend
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
spec:
|
||||
type: {{ .Values.service.manager.type }}
|
||||
sessionAffinity: ClientIP
|
||||
|
@ -2,7 +2,7 @@ apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: longhorn-default-setting
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
data:
|
||||
default-setting.yaml: |-
|
||||
|
@ -2,7 +2,7 @@ apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: longhorn-driver-deployer
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
|
@ -4,7 +4,7 @@ metadata:
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
app: longhorn-ui
|
||||
name: longhorn-ui
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
@ -41,7 +41,7 @@ metadata:
|
||||
kubernetes.io/cluster-service: "true"
|
||||
{{- end }}
|
||||
name: longhorn-frontend
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
spec:
|
||||
{{- if eq .Values.service.ui.type "Rancher-Proxy" }}
|
||||
type: ClusterIP
|
||||
|
@ -3,6 +3,7 @@ apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: longhorn-ingress
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
app: longhorn-ingress
|
||||
annotations:
|
||||
|
@ -5,7 +5,7 @@ metadata:
|
||||
"helm.sh/hook": post-upgrade
|
||||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
|
||||
name: longhorn-post-upgrade
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
spec:
|
||||
activeDeadlineSeconds: 900
|
||||
|
@ -35,7 +35,7 @@ kind: Role
|
||||
metadata:
|
||||
name: longhorn-psp-role
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- policy
|
||||
@ -51,7 +51,7 @@ kind: RoleBinding
|
||||
metadata:
|
||||
name: longhorn-psp-binding
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
@ -59,8 +59,8 @@ roleRef:
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: longhorn-service-account
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
{{- end }}
|
||||
|
@ -3,6 +3,7 @@ apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Values.privateRegistry.registrySecret }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
|
@ -2,5 +2,5 @@ apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: longhorn-service-account
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
|
@ -2,7 +2,7 @@ apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: longhorn-storageclass
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
data:
|
||||
storageclass.yaml: |
|
||||
|
@ -4,6 +4,7 @@ apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: longhorn
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
app: longhorn
|
||||
type: kubernetes.io/tls
|
||||
|
@ -5,7 +5,7 @@ metadata:
|
||||
"helm.sh/hook": pre-delete
|
||||
"helm.sh/hook-delete-policy": hook-succeeded
|
||||
name: longhorn-uninstall
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ include "release_namespace" . }}
|
||||
labels: {{- include "longhorn.labels" . | nindent 4 }}
|
||||
spec:
|
||||
activeDeadlineSeconds: 900
|
||||
|
@ -153,3 +153,7 @@ ingress:
|
||||
|
||||
# Configure a pod security policy in the Longhorn namespace to allow privileged pods
|
||||
enablePSP: true
|
||||
|
||||
## Specify override namespace, specifically this is useful for using longhorn as sub-chart
|
||||
## and its release namespace is not the `longhorn-system`
|
||||
namespaceOverride: ""
|
||||
|
Loading…
Reference in New Issue
Block a user