Fixed webhook and support multiple instances of the operator in the same cluster (#9840)

* Fixed webhook

Signed-off-by: Chaoran Yu <yuchaoran2011@gmail.com>

* Updated operator version in Chart.yaml

Signed-off-by: Chaoran Yu <yuchaoran2011@gmail.com>

* Support multiple instances of operator in the same cluster

Signed-off-by: Chaoran Yu <yuchaoran2011@gmail.com>

* Testing fixing the secrets not found error

Signed-off-by: Chaoran Yu <yuchaoran2011@gmail.com>

* Revert "Testing fixing the secrets not found error"

This reverts commit bd404ddac4.

Signed-off-by: Chaoran Yu <yuchaoran2011@gmail.com>

* Updated default image

Signed-off-by: Chaoran Yu <yuchaoran2011@gmail.com>

* Disable webhook

Signed-off-by: Chaoran Yu <yuchaoran2011@gmail.com>
This commit is contained in:
Chaoran Yu
2018-12-10 19:51:36 -08:00
committed by Kubernetes Prow Robot
parent 663f34ef01
commit d18886dbcc
8 changed files with 23 additions and 42 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
name: sparkoperator
description: A Helm chart for Spark on Kubernetes operator
version: 0.1.3
appVersion: v1alpha1-0.4-2.3.x
version: 0.1.4
appVersion: v1alpha1-0.5-2.4.0
kubeVersion: ">=1.8.0-0"
keywords:
- spark
+2 -3
View File
@@ -24,10 +24,9 @@ The following table lists the configurable parameters of the Spark operator char
| Parameter | Description | Default |
| ------------------------- | ----------------------------------------------------- | -------------------------------------- |
| `operatorImageName` | The name of the operator image | `gcr.io/spark-operator/spark-operator` |
| `operatorVersion` | The version of the operator to install | `v2.3.1-v1alpha1-latest` |
| `operatorVersion` | The version of the operator to install | `v2.4.0-v1alpha1-latest` |
| `sparkJobNamespace` | K8s namespace where Spark jobs are to be deployed. | `default` |
| `createSparkJobNamespace` | Whether to create the Spark job namespace | false |
| `enableWebhook` | Whether to enable mutating admission webhook | true |
| `enableWebhook` | Whether to enable mutating admission webhook | false |
| `enableMetrics` | Whether to expose metrics to be scraped by Premetheus | true |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
@@ -1,11 +0,0 @@
{{ if .Values.createSparkJobNamespace }}
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.sparkJobNamespace }}
labels:
app.kubernetes.io/name: {{ include "sparkoperator.name" . }}
helm.sh/chart: {{ include "sparkoperator.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{ end }}
@@ -45,7 +45,7 @@ spec:
containers:
- name: sparkoperator
image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }}
imagePullPolicy: IfNotPresent
imagePullPolicy: {{ .Values.imagePullPolicy }}
{{- if .Values.enableWebhook }}
volumeMounts:
- name: webhook-certs
@@ -56,24 +56,16 @@ spec:
- containerPort: 10254
{{ end }}
command: ["/usr/bin/spark-operator"]
{{- if and (.Values.enableMetrics) (.Values.enableWebhook) }}
args:
- -logtostderr
- -namespace={{ .Values.sparkJobNamespace }}
{{- if .Values.enableMetrics }}
- -enable-metrics=true
- -metrics-labels=app_type
{{- end }}
{{- if .Values.enableWebhook }}
- -enable-webhook=true
- -webhook-svc-namespace={{ .Release.Namespace }}
- -logtostderr
{{- else if (.Values.enableMetrics) }}
args:
- -enable-metrics=true
- -metrics-labels=app_type
- -logtostderr
{{- else if (.Values.enableWebhook) }}
args:
- -enable-webhook=true
- -webhook-svc-namespace={{ .Release.Namespace }}
- -logtostderr
{{- else }}
args:
- -logtostderr
- -webhook-svc-name={{ include "sparkoperator.fullname" . }}-webhook
- -webhook-config-name={{ include "sparkoperator.fullname" . }}-webhook-config
{{- end }}
@@ -2,7 +2,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: sparkoperator-cr
name: {{ include "sparkoperator.fullname" . }}-cr
labels:
app.kubernetes.io/name: {{ include "sparkoperator.name" . }}
helm.sh/chart: {{ include "sparkoperator.chart" . }}
@@ -34,7 +34,7 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: sparkoperator-crb
name: {{ include "sparkoperator.fullname" . }}-crb
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "sparkoperator.name" . }}
@@ -47,6 +47,6 @@ subjects:
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: sparkoperator-cr
name: {{ include "sparkoperator.fullname" . }}-cr
apiGroup: rbac.authorization.k8s.io
{{- end }}
@@ -19,7 +19,7 @@ spec:
containers:
- name: main
image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }}
imagePullPolicy: IfNotPresent
imagePullPolicy: {{ .Values.imagePullPolicy }}
command:
- "/bin/sh"
- "-c"
@@ -19,6 +19,6 @@ spec:
containers:
- name: main
image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }}
imagePullPolicy: IfNotPresent
command: ["/usr/bin/gencerts.sh", "-n", "{{ .Release.Namespace }}", "-p"]
imagePullPolicy: {{ .Values.imagePullPolicy }}
command: ["/usr/bin/gencerts.sh", "-n", "{{ .Release.Namespace }}", "-s", '{{ include "sparkoperator.fullname" . }}-webhook', "-p"]
{{ end }}
+5 -4
View File
@@ -1,6 +1,7 @@
operatorImageName: gcr.io/spark-operator/spark-operator
operatorVersion: v2.3.1-v1alpha1-latest
sparkJobNamespace: default
operatorVersion: v2.4.0-v1alpha1-latest
imagePullPolicy: IfNotPresent
rbac:
create: true
@@ -13,7 +14,7 @@ serviceAccounts:
create: true
name:
createSparkJobNamespace: false
sparkJobNamespace: default
enableWebhook: true
enableWebhook: false
enableMetrics: true