Added configurable serviceType and ingress (#3284)

* Added configurable serviceType and ingress

* Moved default serviceType loadbalancer from yaml to values

* Version bump
This commit is contained in:
Jonas Eckerström
2018-01-19 21:59:27 -08:00
committed by k8s-ci-robot
parent 5e4eac8008
commit cb1960eb90
8 changed files with 96 additions and 24 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: spark
version: 0.1.9
version: 0.1.10
description: Fast and general-purpose cluster computing system.
home: http://spark.apache.org
icon: http://spark.apache.org/images/spark-logo-trademark.png
+17 -10
View File
@@ -45,6 +45,7 @@ The following tables lists the configurable parameters of the Spark chart and th
| `Master.ServicePort` | k8s service port | `7077` |
| `Master.ContainerPort` | Container listening port | `7077` |
| `Master.DaemonMemory` | Master JVM Xms and Xmx option | `1g` |
| `Master.ServiceType ` | Kubernetes Service type | `LoadBalancer` |
### Spark WebUi
@@ -75,16 +76,22 @@ The following tables lists the configurable parameters of the Spark chart and th
### Zeppelin
| Parameter | Description | Default |
|-------------------------|----------------------------------|----------------------------------------------------------|
| `Zeppelin.Name` | Zeppelin name | `zeppelin-controller` |
| `Zeppelin.Image` | Container image name | `apache/zeppelin` |
| `Zeppelin.ImageTag` | Container image tag | `0.7.3` |
| `Zeppelin.Replicas` | k8s deployment replicas | `1` |
| `Zeppelin.Component` | k8s selector key | `zeppelin` |
| `Zeppelin.Cpu` | container requested cpu | `100m` |
| `Zeppelin.ServicePort` | k8s service port | `8080` |
| `Zeppelin.ContainerPort`| Container listening port | `8080` |
| Parameter | Description | Default |
|--------------------------------|----------------------------------|----------------------------------------------------------|
| `Zeppelin.Name` | Zeppelin name | `zeppelin-controller` |
| `Zeppelin.Image` | Container image name | `gcr.io/google_containers/zeppelin` |
| `Zeppelin.ImageTag` | Container image tag | `v0.5.5_v2` |
| `Zeppelin.Replicas` | k8s deployment replicas | `1` |
| `Zeppelin.Component` | k8s selector key | `zeppelin` |
| `Zeppelin.Cpu` | container requested cpu | `100m` |
| `Zeppelin.ServicePort` | k8s service port | `8080` |
| `Zeppelin.ContainerPort` | Container listening port | `8080` |
| `Zeppelin.Ingress.Enabled` | if `true`, an ingress is created | `false` |
| `Zeppelin.Ingress.Annotations` | annotations for the ingress | `{}` |
| `Zeppelin.Ingress.Path` | the ingress path | `/` |
| `Zeppelin.Ingress.Hosts` | a list of ingress hosts | `[zeppelin.example.com]` |
| `Zeppelin.Ingress.Tls` | a list of [IngressTLS](https://v1-8.docs.kubernetes.io/docs/api-reference/v1.8/#ingresstls-v1beta1-extensions) items | `[]`
| `Zeppelin.ServiceType ` | Kubernetes Service type | `LoadBalancer` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
+1 -2
View File
@@ -10,7 +10,6 @@
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "zeppelin-fullname" . }}'
export ZEPPELIN_SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "zeppelin-fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$ZEPPELIN_SERVICE_IP:{{ .Values.Zeppelin.ServicePort }}
+7 -7
View File
@@ -3,29 +3,29 @@
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create fully qualified names.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "master-fullname" -}}
{{- $name := default .Chart.Name .Values.Master.Name -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "webui-fullname" -}}
{{- $name := default .Chart.Name .Values.WebUi.Name -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "worker-fullname" -}}
{{- $name := default .Chart.Name .Values.Worker.Name -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "zeppelin-fullname" -}}
{{- $name := default .Chart.Name .Values.Zeppelin.Name -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- end -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
@@ -29,7 +29,7 @@ spec:
targetPort: {{ .Values.WebUi.ContainerPort }}
selector:
component: "{{ .Release.Name }}-{{ .Values.Master.Component }}"
type: "LoadBalancer"
type: {{ .Values.Master.ServiceType }}
---
apiVersion: extensions/v1beta1
kind: Deployment
@@ -9,11 +9,12 @@ metadata:
component: "{{ .Release.Name }}-{{ .Values.Zeppelin.Component }}"
spec:
ports:
- port: {{ .Values.Zeppelin.ServicePort }}
- name: http
port: {{ .Values.Zeppelin.ServicePort }}
targetPort: {{ .Values.Zeppelin.ContainerPort }}
selector:
component: "{{ .Release.Name }}-{{ .Values.Zeppelin.Component }}"
type: "LoadBalancer"
type: {{ .Values.Zeppelin.ServiceType }}
---
apiVersion: extensions/v1beta1
kind: Deployment
@@ -44,9 +45,10 @@ spec:
image: "{{ .Values.Zeppelin.Image }}:{{ .Values.Zeppelin.ImageTag }}"
ports:
- containerPort: {{ .Values.Zeppelin.ContainerPort }}
name: http
resources:
requests:
cpu: "{{ .Values.Zeppelin.Cpu }}"
env:
- name: SPARK_MASTER
value: "spark://{{ template "master-fullname" . }}:{{ .Values.Master.ServicePort }}"
value: "spark://{{ template "master-fullname" . }}:{{ .Values.Master.ServicePort }}"
@@ -0,0 +1,44 @@
{{- $ingress := .Values.Zeppelin.Ingress -}}
{{- $fullName := include "zeppelin-fullname" . -}}
{{- if $ingress.Enabled }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "zeppelin-fullname" . }}
{{- if $ingress.Annotations }}
annotations:
{{ toYaml $ingress.Annotations | indent 4 }}
{{- end }}
labels:
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
component: "{{ .Release.Name }}-{{ .Values.Zeppelin.Component }}"
spec:
{{- if $ingress.Tls }}
tls:
{{- range $ingress.Tls }}
- hosts:
{{- range .Hosts }}
- {{ . }}
{{- end }}
secretName: {{ .SecretName | default (printf "%s-tls" $fullName) }}
{{- end }}
{{- end }}
{{- if $ingress.Hosts }}
rules:
{{- range $ingress.Hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingress.Path }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- else }}
backend:
serviceName: {{ template "zeppelin-fullname" . }}
servicePort: http
{{- end }}
{{- end }}
+20
View File
@@ -15,6 +15,7 @@ Master:
ContainerPort: 7077
# Set Master JVM memory. Default 1g
# DaemonMemory: 1g
ServiceType: LoadBalancer
WebUi:
Name: webui
@@ -44,3 +45,22 @@ Zeppelin:
Cpu: "100m"
ServicePort: 8080
ContainerPort: 8080
ServiceType: LoadBalancer
Ingress:
Enabled: false
Path: "/"
Tls: []
# - Hosts:
# SecretName: zeppelin
# Used to create an Ingress record.
# Hosts:
# - example.local
# Annotations:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# Tls:
# Enabled: true
# Secrets must be manually created in the namespace.
# SecretName: example-tls
# Hosts:
# - example.local