Add ingress, pod annotations and resources to spark-history-server (#11945)

Signed-off-by: Stijn De Haes <stijndehaes@gmail.com>
This commit is contained in:
Stijn De Haes
2019-03-07 15:26:06 -08:00
committed by Kubernetes Prow Robot
parent e7bdbc4722
commit d16e5ceb7c
5 changed files with 76 additions and 1 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: spark-history-server
version: 0.3.0
version: 0.4.0
appVersion: 2.4.0
description: A Helm chart for Spark History Server
home: https://spark.apache.org
+6
View File
@@ -112,6 +112,12 @@ Note that the default image `lightbend/spark-history-server` is built using this
| s3.accessKeyName | The file name that contains the AWS access key ID. Omit if using IAM based authentication | aws-access-key |
| s3.secretKeyName | The file name that contains the AWS secret access key. Omit if using IAM based authentication | aws-secret-key |
| s3.logDirectory | The S3 log directory that starts with "s3a://" | s3a://spark-hs/ |
| ingress.enabled | if `true`, an ingress is created | false |
| ingress.annotations | annotations for the ingress | {} |
| ingress.path | if `true`, an ingress is created | / |
| ingress.hosts | a list of ingress hosts | [spark-history-server.example.com] |
| ingress.tls | a list of [IngressTLS](https://v1-9.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#ingresstls-v1beta1-extensions) items | [] |
| resources | Resource requests and limits | {} |
Note that only when `pvc.enablePVC` is set to `true`, the following settings take effect:
@@ -18,6 +18,10 @@ spec:
labels:
app.kubernetes.io/name: {{ include "spark-history-server.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.podAnnotations }}
annotations:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "spark-history-server.serviceAccountName" . }}
containers:
@@ -33,6 +37,8 @@ spec:
- name: historyport
containerPort: {{ .Values.service.port }}
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 10 }}
command:
- "/bin/sh"
- "-c"
@@ -0,0 +1,31 @@
{{- if .Values.ingress.enabled -}}
{{- $fullname := include "spark-history-server.fullname" . -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullname }}
labels:
app.kubernetes.io/name: {{ include "spark-history-server.name" . }}
helm.sh/chart: {{ include "spark-history-server.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: /
backend:
serviceName: {{ $fullname }}
servicePort: historyport
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
+32
View File
@@ -1,4 +1,6 @@
replicaCount: 1
nameOverride: ""
fullnameOverride: ""
rbac:
create: true
@@ -25,6 +27,36 @@ environment:
# SPARK_DAEMON_CLASSPATH: ...
# SPARK_PUBLIC_DNS: ...
podAnnotations: {}
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
#
# To let the application start up quickly give it a big limit
# limits:
# cpu: 1000m
# memory: 1Gi
# requests:
# cpu: 100m
# memory: 512Mi
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- spark-history-server.example.com
tls: []
# - secretName:spark-history-server.example.com
# hosts:
# - spark-history-server.example.com
pvc:
# to use a file system path for Spark events dir, set 'enablePVC' to true and mention the
# name of an already created persistent volume claim in existingClaimName.