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: Allow the Helm release namespace to be overridden #1797

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions helm/tenant/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
To connect to the {{ .name }} tenant if it doesn't have a service exposed, you can port-forward to it by running:
{{- if dig "certificate" "requestAutoCert" false . }}

kubectl --namespace {{ $.Release.Namespace }} port-forward svc/{{ .name }}-console 9443:9443
kubectl --namespace {{ template "minio-tenant.namespace" $ }} port-forward svc/{{ .name }}-console 9443:9443

Then visit the MinIO Console at https://127.0.0.1:9443
{{ else }}
kubectl --namespace {{ $.Release.Namespace }} port-forward svc/{{ .name }}-console 9090:9090
kubectl --namespace {{ template "minio-tenant.namespace" $ }} port-forward svc/{{ .name }}-console 9090:9090

Then visit the MinIO Console at http://127.0.0.1:9090
{{ end }}
Expand Down
11 changes: 11 additions & 0 deletions helm/tenant/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ If release name contains chart name it will be used as a full name.
{{- end -}}
{{- end -}}

{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
{{- define "minio-tenant.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}

{{/*
Expand the name of the Operator Console.
*/}}
Expand Down
1 change: 1 addition & 0 deletions helm/tenant/templates/api-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.tenant.name }}
namespace: {{ template "minio-tenant.namespace" $ }}
{{- with .Values.ingress.api.labels }}
labels: {{ toYaml . | nindent 4 }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions helm/tenant/templates/console-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.tenant.name }}-console
namespace: {{ template "minio-tenant.namespace" $ }}
{{- with .Values.ingress.console.labels }}
labels: {{ toYaml . | nindent 4 }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions helm/tenant/templates/kes-configuration-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: Secret
metadata:
name: kes-configuration
namespace: {{ template "minio-tenant.namespace" $ }}
type: Opaque
stringData:
server-config.yaml: {{ .Values.tenant.kes.configuration | toYaml | indent 2 }}
Expand Down
1 change: 1 addition & 0 deletions helm/tenant/templates/tenant-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ dig "secrets" "name" "" (.Values | merge (dict)) }}
namespace: {{ template "minio-tenant.namespace" $ }}
type: Opaque
stringData:
config.env: |-
Expand Down
1 change: 1 addition & 0 deletions helm/tenant/templates/tenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: minio.min.io/v2
kind: Tenant
metadata:
name: {{ .name }}
namespace: {{ template "minio-tenant.namespace" $ }}
## Optionally pass labels to be applied to the statefulset pods
labels:
app: minio
Expand Down
3 changes: 3 additions & 0 deletions helm/tenant/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

# Override the tenant namespace
namespaceOverride: ""
## Secret with default environment variable configurations to be used by MinIO Tenant.
## Not recommended for production deployments! Create the secret manually instead.
secrets:
Expand Down