Browse Source

[Improvement][K8s] Optimize metadata name

pull/3/MERGE
chengshiwen 4 years ago
parent
commit
6d2ae7523f
  1. 2
      docker/kubernetes/dolphinscheduler/README.md
  2. 8
      docker/kubernetes/dolphinscheduler/templates/_helpers.tpl
  3. 6
      docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml
  4. 8
      docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-api.yaml
  5. 6
      docker/kubernetes/dolphinscheduler/templates/secret-external-database.yaml
  6. 2
      docker/kubernetes/dolphinscheduler/templates/secret-external-fs-s3a.yaml
  7. 6
      docker/kubernetes/dolphinscheduler/templates/statefulset-dolphinscheduler-master.yaml
  8. 8
      docker/kubernetes/dolphinscheduler/templates/statefulset-dolphinscheduler-worker.yaml
  9. 2
      docker/kubernetes/dolphinscheduler/templates/svc-dolphinscheduler-master-headless.yaml
  10. 2
      docker/kubernetes/dolphinscheduler/templates/svc-dolphinscheduler-worker-headless.yaml
  11. 2
      docker/kubernetes/dolphinscheduler/values.yaml

2
docker/kubernetes/dolphinscheduler/README.md

@ -78,8 +78,8 @@ The Configuration file is `values.yaml`, and the following tables lists the conf
| Parameter | Description | Default | | Parameter | Description | Default |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- | | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
| `fullname` | Fullname for DolphinScheduler to override the default release name | `nil` |
| `timezone` | World time and date for cities in all time zones | `Asia/Shanghai` | | `timezone` | World time and date for cities in all time zones | `Asia/Shanghai` |
| | | |
| `image.repository` | Docker image repository for the DolphinScheduler | `apache/dolphinscheduler` | | `image.repository` | Docker image repository for the DolphinScheduler | `apache/dolphinscheduler` |
| `image.tag` | Docker image version for the DolphinScheduler | `latest` | | `image.tag` | Docker image version for the DolphinScheduler | `latest` |
| `image.pullPolicy` | Image pull policy. One of Always, Never, IfNotPresent | `IfNotPresent` | | `image.pullPolicy` | Image pull policy. One of Always, Never, IfNotPresent | `IfNotPresent` |

8
docker/kubernetes/dolphinscheduler/templates/_helpers.tpl

@ -23,15 +23,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
If release name contains chart name it will be used as a full name. If release name contains chart name it will be used as a full name.
*/}} */}}
{{- define "dolphinscheduler.fullname" -}} {{- define "dolphinscheduler.fullname" -}}
{{- if .Values.fullname -}}
{{- .Values.fullname | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- if contains .Chart.Name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} {{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}} {{- end -}}
{{/* {{/*

6
docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml

@ -63,7 +63,7 @@ spec:
{{- end }} {{- end }}
containers: containers:
- name: {{ include "dolphinscheduler.fullname" . }}-alert - name: {{ include "dolphinscheduler.fullname" . }}-alert
image: {{ include "dolphinscheduler.image.fullname" . | quote }} image: {{ include "dolphinscheduler.image.fullname" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
args: args:
- "alert-server" - "alert-server"
@ -120,8 +120,8 @@ spec:
name: {{ template "dolphinscheduler.postgresql.fullname" . }} name: {{ template "dolphinscheduler.postgresql.fullname" . }}
key: postgresql-password key: postgresql-password
{{- else }} {{- else }}
name: {{ printf "%s-%s" .Release.Name "externaldb" }} name: {{ include "dolphinscheduler.fullname" . }}-externaldb
key: db-password key: database-password
{{- end }} {{- end }}
- name: DATABASE_DATABASE - name: DATABASE_DATABASE
{{- if .Values.postgresql.enabled }} {{- if .Values.postgresql.enabled }}

8
docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-api.yaml

@ -63,7 +63,7 @@ spec:
{{- end }} {{- end }}
containers: containers:
- name: {{ include "dolphinscheduler.fullname" . }}-api - name: {{ include "dolphinscheduler.fullname" . }}-api
image: {{ include "dolphinscheduler.image.fullname" . | quote }} image: {{ include "dolphinscheduler.image.fullname" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
args: args:
- "api-server" - "api-server"
@ -115,8 +115,8 @@ spec:
name: {{ template "dolphinscheduler.postgresql.fullname" . }} name: {{ template "dolphinscheduler.postgresql.fullname" . }}
key: postgresql-password key: postgresql-password
{{- else }} {{- else }}
name: {{ printf "%s-%s" .Release.Name "externaldb" }} name: {{ include "dolphinscheduler.fullname" . }}-externaldb
key: db-password key: database-password
{{- end }} {{- end }}
- name: DATABASE_DATABASE - name: DATABASE_DATABASE
{{- if .Values.postgresql.enabled }} {{- if .Values.postgresql.enabled }}
@ -172,7 +172,7 @@ spec:
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
key: fs-s3a-secret-key key: fs-s3a-secret-key
name: {{ printf "%s-%s" .Release.Name "fs-s3a" }} name: {{ include "dolphinscheduler.fullname" . }}-fs-s3a
{{- end }} {{- end }}
{{- if .Values.api.resources }} {{- if .Values.api.resources }}
resources: resources:

6
docker/kubernetes/dolphinscheduler/templates/secret-external-postgresql.yaml → docker/kubernetes/dolphinscheduler/templates/secret-external-database.yaml

@ -18,12 +18,12 @@
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: {{ printf "%s-%s" .Release.Name "externaldb" }} name: {{ include "dolphinscheduler.fullname" . }}-externaldb
labels: labels:
app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-postgresql app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-externaldb
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
type: Opaque type: Opaque
data: data:
db-password: {{ .Values.externalDatabase.password | b64enc | quote }} database-password: {{ .Values.externalDatabase.password | b64enc | quote }}
{{- end }} {{- end }}

2
docker/kubernetes/dolphinscheduler/templates/secret-external-fs-s3a.yaml

@ -18,7 +18,7 @@
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: {{ printf "%s-%s" .Release.Name "fs-s3a" }} name: {{ include "dolphinscheduler.fullname" . }}-fs-s3a
labels: labels:
app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-fs-s3a app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-fs-s3a
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}

6
docker/kubernetes/dolphinscheduler/templates/statefulset-dolphinscheduler-master.yaml

@ -60,7 +60,7 @@ spec:
{{- end }} {{- end }}
containers: containers:
- name: {{ include "dolphinscheduler.fullname" . }}-master - name: {{ include "dolphinscheduler.fullname" . }}-master
image: {{ include "dolphinscheduler.image.fullname" . | quote }} image: {{ include "dolphinscheduler.image.fullname" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
args: args:
- "master-server" - "master-server"
@ -157,8 +157,8 @@ spec:
name: {{ template "dolphinscheduler.postgresql.fullname" . }} name: {{ template "dolphinscheduler.postgresql.fullname" . }}
key: postgresql-password key: postgresql-password
{{- else }} {{- else }}
name: {{ printf "%s-%s" .Release.Name "externaldb" }} name: {{ include "dolphinscheduler.fullname" . }}-externaldb
key: db-password key: database-password
{{- end }} {{- end }}
- name: DATABASE_DATABASE - name: DATABASE_DATABASE
{{- if .Values.postgresql.enabled }} {{- if .Values.postgresql.enabled }}

8
docker/kubernetes/dolphinscheduler/templates/statefulset-dolphinscheduler-worker.yaml

@ -60,7 +60,7 @@ spec:
{{- end }} {{- end }}
containers: containers:
- name: {{ include "dolphinscheduler.fullname" . }}-worker - name: {{ include "dolphinscheduler.fullname" . }}-worker
image: {{ include "dolphinscheduler.image.fullname" . | quote }} image: {{ include "dolphinscheduler.image.fullname" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
args: args:
- "worker-server" - "worker-server"
@ -156,8 +156,8 @@ spec:
name: {{ template "dolphinscheduler.postgresql.fullname" . }} name: {{ template "dolphinscheduler.postgresql.fullname" . }}
key: postgresql-password key: postgresql-password
{{- else }} {{- else }}
name: {{ printf "%s-%s" .Release.Name "externaldb" }} name: {{ include "dolphinscheduler.fullname" . }}-externaldb
key: db-password key: database-password
{{- end }} {{- end }}
- name: DATABASE_DATABASE - name: DATABASE_DATABASE
{{- if .Values.postgresql.enabled }} {{- if .Values.postgresql.enabled }}
@ -213,7 +213,7 @@ spec:
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
key: fs-s3a-secret-key key: fs-s3a-secret-key
name: {{ printf "%s-%s" .Release.Name "fs-s3a" }} name: {{ include "dolphinscheduler.fullname" . }}-fs-s3a
{{- end }} {{- end }}
{{- if .Values.worker.resources }} {{- if .Values.worker.resources }}
resources: resources:

2
docker/kubernetes/dolphinscheduler/templates/svc-dolphinscheduler-master-headless.yaml

@ -20,7 +20,7 @@ metadata:
name: {{ include "dolphinscheduler.fullname" . }}-master-headless name: {{ include "dolphinscheduler.fullname" . }}-master-headless
labels: labels:
app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-master-headless app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-master-headless
app.kubernetes.io/instance: {{ .Release.Name }}-master-headless app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
spec: spec:
clusterIP: "None" clusterIP: "None"

2
docker/kubernetes/dolphinscheduler/templates/svc-dolphinscheduler-worker-headless.yaml

@ -20,7 +20,7 @@ metadata:
name: {{ include "dolphinscheduler.fullname" . }}-worker-headless name: {{ include "dolphinscheduler.fullname" . }}-worker-headless
labels: labels:
app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-worker-headless app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-worker-headless
app.kubernetes.io/instance: {{ .Release.Name }}-worker-headless app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
spec: spec:
clusterIP: "None" clusterIP: "None"

2
docker/kubernetes/dolphinscheduler/values.yaml

@ -19,8 +19,6 @@
# This is a YAML-formatted file. # This is a YAML-formatted file.
# Declare variables to be passed into your templates. # Declare variables to be passed into your templates.
## Fullname for Dolphinscheduler, by default, the release name is used
fullname: ""
timezone: "Asia/Shanghai" timezone: "Asia/Shanghai"
image: image:

Loading…
Cancel
Save