Skip to content

Commit 0f12062

Browse files
authored
Merge pull request #605 from KarlisAG/add-resource-namespaces
add namespace to all resources
2 parents 102242f + 110b578 commit 0f12062

File tree

8 files changed

+20
-3
lines changed

8 files changed

+20
-3
lines changed

charts/redisoperator/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ appVersion: 1.2.4
44
apiVersion: v1
55
description: A Helm chart for the Spotahome Redis Operator
66
name: redis-operator
7-
version: 3.2.8
7+
version: 3.2.9
88
home: https://github.com/spotahome/redis-operator
99
keywords:
1010
- "golang"

charts/redisoperator/templates/_helpers.tpl

+7
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,10 @@ Create the name of the service account to use
7676
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
7777
{{- end }}
7878
{{- end }}
79+
80+
{{/*
81+
Create the name of the namespace
82+
*/}}
83+
{{- define "chart.namespaceName" -}}
84+
{{- default .Release.Namespace .Values.namespace }}
85+
{{- end }}

charts/redisoperator/templates/deployment.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
55
kind: Deployment
66
metadata:
77
name: {{ $fullName }}
8+
namespace: {{ include "chart.namespaceName" . }}
89
labels:
910
{{- include "chart.labels" $data | nindent 4 }}
1011
{{- if .Values.annotations }}

charts/redisoperator/templates/monitoring.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ apiVersion: v1
66
kind: Service
77
metadata:
88
name: {{ $fullName }}-prometheus
9+
namespace: {{ include "chart.namespaceName" . }}
910
labels:
1011
prometheus: {{ .Values.monitoring.prometheus.name }}
1112
{{- include "chart.labels" $data | nindent 4 }}
@@ -28,6 +29,7 @@ apiVersion: monitoring.coreos.com/v1
2829
kind: ServiceMonitor
2930
metadata:
3031
name: {{ $fullName }}
32+
namespace: {{ include "chart.namespaceName" . }}
3133
labels:
3234
prometheus: {{ .Values.monitoring.prometheus.name }}
3335
{{- include "chart.labels" $data | nindent 4 }}
@@ -38,7 +40,7 @@ spec:
3840
{{- include "chart.selectorLabels" $data | nindent 6 }}
3941
namespaceSelector:
4042
matchNames:
41-
- {{ .Release.Namespace }}
43+
- {{ include "chart.namespaceName" . }}
4244
endpoints:
4345
- port: metrics
4446
interval: 15s

charts/redisoperator/templates/private-registry.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ apiVersion: v1
66
kind: Secret
77
metadata:
88
name: {{ $fullName }}-{{ $name }}
9+
namespace: {{ include "chart.namespaceName" . }}
910
labels:
1011
{{- include "chart.labels" $data | nindent 4 }}
1112
{{- if .Values.annotations }}

charts/redisoperator/templates/service-account.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ apiVersion: v1
55
kind: ServiceAccount
66
metadata:
77
name: {{ $fullName }}
8+
namespace: {{ include "chart.namespaceName" . }}
89
labels:
910
{{- include "chart.labels" $data | nindent 4 }}
1011
---
@@ -106,7 +107,7 @@ metadata:
106107
subjects:
107108
- kind: ServiceAccount
108109
name: {{ $fullName }}
109-
namespace: {{ .Release.Namespace }}
110+
namespace: {{ include "chart.namespaceName" . }}
110111
roleRef:
111112
apiGroup: rbac.authorization.k8s.io
112113
kind: ClusterRole

charts/redisoperator/templates/service.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ apiVersion: v1
55
kind: Service
66
metadata:
77
name: {{ $fullName }}
8+
namespace: {{ include "chart.namespaceName" . }}
89
labels:
910
{{- include "chart.labels" $data | nindent 4 }}
1011
{{- if .Values.annotations }}

charts/redisoperator/values.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ nameOverride: ""
3030
# A name to substitute for the full names of resources.
3131
fullnameOverride: ""
3232

33+
# The name of the Namespace to deploy
34+
# If not set, `.Release.Namespace` is used
35+
namespace: null
36+
3337
serviceAccount:
3438
# Enable service account creation.
3539
create: true

0 commit comments

Comments
 (0)