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 ingresses to tenant helm chart #1153

Merged
merged 2 commits into from
Jun 4, 2022
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
16 changes: 2 additions & 14 deletions helm/operator/templates/console-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{- if .Values.console.ingress.enabled }}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
apiVersion: networking.k8s.io/v1
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress" -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ include "minio-operator.console-fullname" . }}
Expand All @@ -26,7 +20,7 @@ spec:
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
Expand All @@ -35,16 +29,10 @@ spec:
http:
paths:
- path: {{ .Values.console.ingress.path }}
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
pathType: Prefix
pathType: {{ .Values.console.ingress.pathType }}
backend:
service:
name: "console"
port:
name: http
{{- else }}
backend:
serviceName: "console"
servicePort: http
{{ end }}
{{ end }}
2 changes: 1 addition & 1 deletion helm/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ console:
tls: [ ]
host: console.local
path: /
pathType: Prefix
volumes: [ ]
volumeMounts: [ ]

41 changes: 41 additions & 0 deletions helm/tenant/templates/api-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.ingress.api.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.tenant.name }}
{{- with .Values.ingress.api.labels }}
labels: {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.ingress.api.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.api.ingressClassName }}
ingressClassName: {{ .Values.ingress.api.ingressClassName }}
{{- end }}
{{- if .Values.ingress.api.tls }}
tls:
{{- range .Values.ingress.api.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.ingress.api.host }}
http:
paths:
- path: {{ .Values.ingress.api.path }}
pathType: {{ .Values.ingress.api.pathType }}
backend:
service:
name: minio
port:
{{- if or .Values.tenant.certificate.requestAutoCert (not (empty .Values.tenant.certificate.externalCertSecret)) }}
name: https-minio
{{- else }}
name: http-minio
{{- end }}
{{ end }}
41 changes: 41 additions & 0 deletions helm/tenant/templates/console-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.ingress.console.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.tenant.name }}-console
{{- with .Values.ingress.console.labels }}
labels: {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.ingress.console.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.console.ingressClassName }}
ingressClassName: {{ .Values.ingress.console.ingressClassName }}
{{- end }}
{{- if .Values.ingress.console.tls }}
tls:
{{- range .Values.ingress.console.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.ingress.console.host }}
http:
paths:
- path: {{ .Values.ingress.console.path }}
pathType: {{ .Values.ingress.console.pathType }}
backend:
service:
name: {{ .Values.tenant.name }}-console
port:
{{- if or .Values.tenant.certificate.requestAutoCert (not (empty .Values.tenant.certificate.externalCertSecret)) }}
name: https-console
{{- else }}
name: http-console
{{- end }}
{{ end }}
6 changes: 3 additions & 3 deletions helm/tenant/templates/tenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ spec:
{{- end }}
mountPath: {{ dig "mountPath" "/export" . }}
subPath: {{ dig "subPath" "/data" . }}
{{- with (dig "certificate" "externalCaCertSecret" (dict) .) }}
{{- with (dig "certificate" "externalCaCertSecret" (list) .) }}
externalCaCertSecret:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with (dig "certificate" "externalCertSecret" (dict) .) }}
{{- with (dig "certificate" "externalCertSecret" (list) .) }}
externalCertSecret:
{{- toYaml . | nindent 6 }}
{{- end }}
Expand Down Expand Up @@ -128,7 +128,7 @@ spec:
serviceMetadata:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with (dig "env" (dict) .) }}
{{- with (dig "env" (list) .) }}
env:
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
32 changes: 26 additions & 6 deletions helm/tenant/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tenant:
## Registry location and Tag to download MinIO Server image
image:
repository: quay.io/minio/minio
tag: RELEASE.2022-01-08T03-11-54Z
tag: RELEASE.2022-05-26T05-48-41Z
pullPolicy: IfNotPresent
## Customize any private registry image pull secret.
## currently only one secret registry is supported
Expand All @@ -40,7 +40,7 @@ tenant:
## Used to specify labels for pods
labels: { }
## Used to specify a toleration for a pod
tolerations: { }
tolerations: [ ]
## nodeSelector parameters for MinIO Pods. It specifies a map of key-value pairs. For the pod to be
## eligible to run on a node, the node must have each of the
## indicated key-value pairs as labels.
Expand Down Expand Up @@ -68,11 +68,11 @@ tenant:
## Use this field to provide one or more external CA certificates. This is used by MinIO
## to verify TLS connections with other applications:
## https://github.com/minio/minio/tree/master/docs/tls/kubernetes#2-create-kubernetes-secret
externalCaCertSecret: { }
## Use this field to provide a list of Secrets with external certificates. This can be used to to configure
externalCaCertSecret: [ ]
## Use this field to provide a list of Secrets with external certificates. This can be used to configure
## TLS for MinIO Tenant pods. Create secrets as explained here:
## https://github.com/minio/minio/tree/master/docs/tls/kubernetes#2-create-kubernetes-secret
externalCertSecret: { }
externalCertSecret: [ ]
## Enable automatic Kubernetes based certificate generation and signing as explained in
## https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster
requestAutoCert: true
Expand Down Expand Up @@ -121,7 +121,7 @@ tenant:
## services created by the operator.
serviceMetadata: { }
## Add environment variables to be set in MinIO container (https://github.com/minio/minio/tree/master/docs/config)
env: { }
env: [ ]
## PriorityClassName indicates the Pod priority and hence importance of a Pod relative to other Pods.
## This is applied to MinIO pods only.
## Refer Kubernetes documentation for details https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass/
Expand Down Expand Up @@ -222,3 +222,23 @@ tenant:
runAsGroup: 1000
runAsNonRoot: true
fsGroup: 1000

ingress:
api:
enabled: false
ingressClassName: ""
labels: { }
annotations: { }
tls: [ ]
host: minio.local
path: /
pathType: Prefix
console:
enabled: false
ingressClassName: ""
labels: { }
annotations: { }
tls: [ ]
host: minio-console.local
path: /
pathType: Prefix