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

add namespace to all resources #605

Merged
merged 1 commit into from
Aug 11, 2023
Merged
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
2 changes: 1 addition & 1 deletion charts/redisoperator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ appVersion: 1.2.4
apiVersion: v1
description: A Helm chart for the Spotahome Redis Operator
name: redis-operator
version: 3.2.8
version: 3.2.9
home: https://github.com/spotahome/redis-operator
keywords:
- "golang"
Expand Down
7 changes: 7 additions & 0 deletions charts/redisoperator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,10 @@ Create the name of the service account to use
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
{{- end }}
{{- end }}

{{/*
Create the name of the namespace
*/}}
{{- define "chart.namespaceName" -}}
{{- default .Release.Namespace .Values.namespace }}
{{- end }}
1 change: 1 addition & 0 deletions charts/redisoperator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ $fullName }}
namespace: {{ include "chart.namespaceName" . }}
labels:
{{- include "chart.labels" $data | nindent 4 }}
{{- if .Values.annotations }}
Expand Down
4 changes: 3 additions & 1 deletion charts/redisoperator/templates/monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ $fullName }}-prometheus
namespace: {{ include "chart.namespaceName" . }}
labels:
prometheus: {{ .Values.monitoring.prometheus.name }}
{{- include "chart.labels" $data | nindent 4 }}
Expand All @@ -28,6 +29,7 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ $fullName }}
namespace: {{ include "chart.namespaceName" . }}
labels:
prometheus: {{ .Values.monitoring.prometheus.name }}
{{- include "chart.labels" $data | nindent 4 }}
Expand All @@ -38,7 +40,7 @@ spec:
{{- include "chart.selectorLabels" $data | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
- {{ include "chart.namespaceName" . }}
endpoints:
- port: metrics
interval: 15s
Expand Down
1 change: 1 addition & 0 deletions charts/redisoperator/templates/private-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ $fullName }}-{{ $name }}
namespace: {{ include "chart.namespaceName" . }}
labels:
{{- include "chart.labels" $data | nindent 4 }}
{{- if .Values.annotations }}
Expand Down
3 changes: 2 additions & 1 deletion charts/redisoperator/templates/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $fullName }}
namespace: {{ include "chart.namespaceName" . }}
labels:
{{- include "chart.labels" $data | nindent 4 }}
---
Expand Down Expand Up @@ -106,7 +107,7 @@ metadata:
subjects:
- kind: ServiceAccount
name: {{ $fullName }}
namespace: {{ .Release.Namespace }}
namespace: {{ include "chart.namespaceName" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
1 change: 1 addition & 0 deletions charts/redisoperator/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ $fullName }}
namespace: {{ include "chart.namespaceName" . }}
labels:
{{- include "chart.labels" $data | nindent 4 }}
{{- if .Values.annotations }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redisoperator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ nameOverride: ""
# A name to substitute for the full names of resources.
fullnameOverride: ""

# The name of the Namespace to deploy
# If not set, `.Release.Namespace` is used
namespace: null

serviceAccount:
# Enable service account creation.
create: true
Expand Down