Skip to content

Commit

Permalink
chore(deploy): refactor image structure (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
chong1144 authored Aug 19, 2021
1 parent 0c25ce6 commit 8e2216f
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 24 deletions.
6 changes: 3 additions & 3 deletions deploy/charts/fedlearner-stack/charts/sparkoperator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,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 | `v1beta2-1.2.0-3.0.0` |
| `imagePullPolicy` | Docker image pull policy | `IfNotPresent` |
| `image.repository` | The name of the operator image | `gcr.io/spark-operator/spark-operator` |
| `image.tag` | The version of the operator to install | `v1beta2-1.2.0-3.0.0` |
| `image.pullPolicy` | Docker image pull policy | `IfNotPresent` |
| `imagePullSecrets` | Docker image pull secrets | |
| `replicas` | The number of replicas of the operator Deployment | 1 |
| `sparkJobNamespace` | K8s namespace where Spark jobs are to be deployed | `` |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
operatorImageName: gcr.io/spark-operator/spark-operator
operatorVersion: v1beta2-1.2.0-3.0.0
imagePullPolicy: IfNotPresent
image:
repository: registry.cn-beijing.aliyuncs.com/fedlearner/spark-operator
pullPolicy: IfNotPresent
tag: v1beta2-1.2.0-3.0.0
imagePullSecrets: []

rbac:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
{{ toYaml .Values.imagePullSecrets | trim | indent 8 }}
containers:
- name: delete-sparkapp-crd
image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy}}
{{- if .Values.securityContext }}
securityContext:
{{- range $securityPolicy, $value := .Values.securityContext }}
Expand All @@ -45,8 +45,8 @@ spec:
-H \"Content-Type: application/json\" \
https://kubernetes.default.svc/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/sparkapplications.sparkoperator.k8s.io"
- name: delete-scheduledsparkapp-crd
image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy}}
{{- if .Values.securityContext }}
securityContext:
{{- range $securityPolicy, $value := .Values.securityContext }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "sparkoperator.name" . }}
app.kubernetes.io/version: {{ .Values.operatorVersion }}
app.kubernetes.io/version: {{ .Values.image.tag }}
strategy:
type: Recreate
template:
Expand All @@ -37,7 +37,7 @@ spec:
{{- end }}
labels:
app.kubernetes.io/name: {{ include "sparkoperator.name" . }}
app.kubernetes.io/version: {{ .Values.operatorVersion }}
app.kubernetes.io/version: {{ .Values.image.tag }}
spec:
serviceAccountName: {{ include "sparkoperator.serviceAccountName" . }}
imagePullSecrets:
Expand All @@ -50,8 +50,8 @@ spec:
{{- end }}
containers:
- name: sparkoperator
image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy}}
{{- if .Values.securityContext }}
securityContext:
{{- range $securityPolicy, $value := .Values.securityContext }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
{{ toYaml .Values.imagePullSecrets | trim | indent 8 }}
containers:
- name: clean-secret
image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy}}
{{- if .Values.securityContext }}
securityContext:
{{- range $securityPolicy, $value := .Values.securityContext }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ spec:
{{ toYaml .Values.imagePullSecrets | trim | indent 8 }}
containers:
- name: main
image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy}}
{{- if .Values.securityContext }}
securityContext:
{{- range $securityPolicy, $value := .Values.securityContext }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ spec:
name: webhook
selector:
app.kubernetes.io/name: {{ include "sparkoperator.name" . }}
app.kubernetes.io/version: {{ .Values.operatorVersion }}
app.kubernetes.io/version: {{ .Values.image.tag }}
{{ end }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
operatorImageName: registry.cn-beijing.aliyuncs.com/fedlearner/spark-operator
operatorVersion: v1beta2-1.2.0-3.0.0
imagePullPolicy: IfNotPresent
image:
repository: registry.cn-beijing.aliyuncs.com/fedlearner/spark-operator
pullPolicy: IfNotPresent
tag: v1beta2-1.2.0-3.0.0

imagePullSecrets: []

rbac:
Expand Down
6 changes: 4 additions & 2 deletions deploy/charts/fedlearner-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ sparkoperator:
create: true
name: spark

operatorImageName: registry.cn-beijing.aliyuncs.com/fedlearner/spark-operator
operatorVersion: v1beta2-1.2.0-3.0.0
image:
repository: registry.cn-beijing.aliyuncs.com/fedlearner/spark-operator
pullPolicy: IfNotPresent
tag: v1beta2-1.2.0-3.0.0

sparkJobNamespace: default
installCrds: true
Expand Down

0 comments on commit 8e2216f

Please sign in to comment.