From ddd82bf3d43d0dc28e91e3273622c57f19fdc0a0 Mon Sep 17 00:00:00 2001 From: Sasha Date: Wed, 23 May 2018 13:53:33 +0300 Subject: [PATCH] Issue 5622: Kubeless optional Ingress for UI (#5623) * Add optional Ingress to Kubeless UI and bump version Signed-off-by: Alejandro Vicente Grabovetsky * Update README.md with Ingress default values Signed-off-by: Alejandro Vicente Grabovetsky * Update template with include according to Helm documentation best practices Signed-off-by: Alejandro Vicente Grabovetsky * Revert conversion of 'template' to 'include' Signed-off-by: Alejandro Vicente Grabovetsky * Bump version up post-master merge Signed-off-by: Alejandro Vicente Grabovetsky --- incubator/kubeless/Chart.yaml | 2 +- incubator/kubeless/README.md | 5 +++ incubator/kubeless/templates/ui-ingress.yaml | 36 ++++++++++++++++++++ incubator/kubeless/values.yaml | 13 +++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 incubator/kubeless/templates/ui-ingress.yaml diff --git a/incubator/kubeless/Chart.yaml b/incubator/kubeless/Chart.yaml index 335b5eede0..69dd880117 100644 --- a/incubator/kubeless/Chart.yaml +++ b/incubator/kubeless/Chart.yaml @@ -1,5 +1,5 @@ name: kubeless -version: 1.0.2 +version: 1.0.3 appVersion: v1.0.0-alpha.3 description: Kubeless is a Kubernetes-native serverless framework. It runs on top of your Kubernetes cluster and allows you to deploy small unit of code without having to build container images. icon: https://cloud.githubusercontent.com/assets/4056725/25480209/1d5bf83c-2b48-11e7-8db8-bcd650f31297.png diff --git a/incubator/kubeless/README.md b/incubator/kubeless/README.md index 430d6bd451..d0cc60a877 100644 --- a/incubator/kubeless/README.md +++ b/incubator/kubeless/README.md @@ -69,6 +69,11 @@ The following table lists the configurable parameters of the Kubeless chart and | `ui.service.name` | Service name | `ui-port` | | `ui.service.type` | Kubernetes service name | `NodePort` | | `ui.service.externalPort` | Service external port | `3000` | +| `ui.ingress.enabled` | Kubeless UI ingress switch | `false` | +| `ui.ingress.annotations` | Kubeless UI ingress annotations | `{}` | +| `ui.ingress.path` | Kubeless UI ingress path | `{}` | +| `ui.ingress.hosts` | Kubeless UI ingress hosts | `[chart-example.local]` | +| `ui.ingress.tls` | Kubeless UI ingress TLS | `[]` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/incubator/kubeless/templates/ui-ingress.yaml b/incubator/kubeless/templates/ui-ingress.yaml new file mode 100644 index 0000000000..8b7f9c6ef3 --- /dev/null +++ b/incubator/kubeless/templates/ui-ingress.yaml @@ -0,0 +1,36 @@ +{{- if and .Values.ui.enabled .Values.ui.ingress.enabled -}} +{{- $fullName := include "kubeless.fullname" . -}} +{{- $ingressPath := .Values.ui.ingress.path -}} +{{- $portName := .Values.ui.service.name -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }}-ui + labels: +{{ include "labels.standard" . | indent 4 }} +{{- with .Values.ui.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ui.ingress.tls }} + tls: + {{- range .Values.ui.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ui.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }}-ui + servicePort: {{ $portName }} + {{- end }} +{{- end }} diff --git a/incubator/kubeless/values.yaml b/incubator/kubeless/values.yaml index 7dd79a5395..df30e1dbaf 100644 --- a/incubator/kubeless/values.yaml +++ b/incubator/kubeless/values.yaml @@ -172,3 +172,16 @@ ui: name: ui-port type: NodePort externalPort: 3000 + + ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + path: / + hosts: + - chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local