mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-12-03 00:49:13 +08:00
bee482d49e
Remove `deployments.spec.serviceName` from the s3 deployment template. `serviceName` isn't a valid field and causes issues when deploying the chart. This is the full output for `kubectl explain deployments.spec` ``` KIND: Deployment VERSION: apps/v1 RESOURCE: spec <Object> DESCRIPTION: Specification of the desired behavior of the Deployment. DeploymentSpec is the specification of the desired behavior of the Deployment. FIELDS: minReadySeconds <integer> Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) paused <boolean> Indicates that the deployment is paused. progressDeadlineSeconds <integer> The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. replicas <integer> Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. revisionHistoryLimit <integer> The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. selector <Object> -required- Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels. strategy <Object> The deployment strategy to use to replace existing pods with new ones. template <Object> -required- Template describes the pods that will be created. ```
191 lines
6.7 KiB
YAML
191 lines
6.7 KiB
YAML
{{- if .Values.s3.enabled }}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ template "seaweedfs.name" . }}-s3
|
|
namespace: {{ .Release.Namespace }}
|
|
labels:
|
|
app: {{ template "seaweedfs.name" . }}
|
|
chart: {{ template "seaweedfs.chart" . }}
|
|
heritage: {{ .Release.Service }}
|
|
release: {{ .Release.Name }}
|
|
spec:
|
|
replicas: {{ .Values.s3.replicas }}
|
|
selector:
|
|
matchLabels:
|
|
app: {{ template "seaweedfs.name" . }}
|
|
chart: {{ template "seaweedfs.chart" . }}
|
|
release: {{ .Release.Name }}
|
|
component: s3
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ template "seaweedfs.name" . }}
|
|
chart: {{ template "seaweedfs.chart" . }}
|
|
release: {{ .Release.Name }}
|
|
component: s3
|
|
spec:
|
|
restartPolicy: {{ default .Values.global.restartPolicy .Values.s3.restartPolicy }}
|
|
{{- if .Values.s3.tolerations }}
|
|
tolerations:
|
|
{{ tpl .Values.s3.tolerations . | nindent 8 | trim }}
|
|
{{- end }}
|
|
{{- if .Values.global.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
- name: {{ .Values.global.imagePullSecrets }}
|
|
{{- end }}
|
|
terminationGracePeriodSeconds: 10
|
|
{{- if .Values.s3.priorityClassName }}
|
|
priorityClassName: {{ .Values.s3.priorityClassName | quote }}
|
|
{{- end }}
|
|
enableServiceLinks: false
|
|
containers:
|
|
- name: seaweedfs
|
|
image: {{ template "s3.image" . }}
|
|
imagePullPolicy: {{ default "IfNotPresent" .Values.global.imagePullPolicy }}
|
|
env:
|
|
- name: POD_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: status.podIP
|
|
- name: POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: SEAWEEDFS_FULLNAME
|
|
value: "{{ template "seaweedfs.name" . }}"
|
|
{{- if .Values.global.extraEnvironmentVars }}
|
|
{{- range $key, $value := .Values.global.extraEnvironmentVars }}
|
|
- name: {{ $key }}
|
|
value: {{ $value | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
command:
|
|
- "/bin/sh"
|
|
- "-ec"
|
|
- |
|
|
exec /usr/bin/weed -logdir=/logs \
|
|
{{- if .Values.s3.loggingOverrideLevel }}
|
|
-v={{ .Values.s3.loggingOverrideLevel }} \
|
|
{{- else }}
|
|
-v={{ .Values.global.loggingLevel }} \
|
|
{{- end }}
|
|
s3 \
|
|
-port={{ .Values.s3.port }} \
|
|
{{- if .Values.s3.metricsPort }}
|
|
-metricsPort {{ .Values.s3.metricsPort }} \
|
|
{{- end }}
|
|
{{- if .Values.global.enableSecurity }}
|
|
-cert.file=/usr/local/share/ca-certificates/client/tls.crt \
|
|
-key.file=/usr/local/share/ca-certificates/client/tls.key \
|
|
{{- end }}
|
|
{{- if .Values.s3.domainName }}
|
|
-domainName={{ .Values.s3.domainName }} \
|
|
{{- end }}
|
|
{{- if .Values.s3.allowEmptyFolder }}
|
|
-allowEmptyFolder={{ .Values.s3.allowEmptyFolder }} \
|
|
{{- end }}
|
|
{{- if .Values.s3.enableAuth }}
|
|
-config=/etc/sw/seaweedfs_s3_config \
|
|
{{- end }}
|
|
{{- if .Values.s3.auditLogConfig }}
|
|
-auditLogConfig=/etc/sw/s3_auditLogConfig.json \
|
|
{{- end }}
|
|
-filer={{ template "seaweedfs.name" . }}-filer-client:{{ .Values.filer.port }}
|
|
volumeMounts:
|
|
- name: logs
|
|
mountPath: "/logs/"
|
|
- mountPath: /etc/sw
|
|
name: config-users
|
|
readOnly: true
|
|
{{- if .Values.global.enableSecurity }}
|
|
- name: security-config
|
|
readOnly: true
|
|
mountPath: /etc/seaweedfs/security.toml
|
|
subPath: security.toml
|
|
- name: ca-cert
|
|
readOnly: true
|
|
mountPath: /usr/local/share/ca-certificates/ca/
|
|
- name: master-cert
|
|
readOnly: true
|
|
mountPath: /usr/local/share/ca-certificates/master/
|
|
- name: volume-cert
|
|
readOnly: true
|
|
mountPath: /usr/local/share/ca-certificates/volume/
|
|
- name: filer-cert
|
|
readOnly: true
|
|
mountPath: /usr/local/share/ca-certificates/filer/
|
|
- name: client-cert
|
|
readOnly: true
|
|
mountPath: /usr/local/share/ca-certificates/client/
|
|
{{- end }}
|
|
{{ tpl .Values.s3.extraVolumeMounts . | nindent 12 | trim }}
|
|
ports:
|
|
- containerPort: {{ .Values.s3.port }}
|
|
name: swfs-s3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /status
|
|
port: {{ .Values.s3.port }}
|
|
scheme: HTTP
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 15
|
|
successThreshold: 1
|
|
failureThreshold: 100
|
|
timeoutSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /status
|
|
port: {{ .Values.s3.port }}
|
|
scheme: HTTP
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 60
|
|
successThreshold: 1
|
|
failureThreshold: 20
|
|
timeoutSeconds: 10
|
|
{{- if .Values.s3.resources }}
|
|
resources:
|
|
{{ tpl .Values.s3.resources . | nindent 12 | trim }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: config-users
|
|
secret:
|
|
defaultMode: 420
|
|
secretName: seaweedfs-s3-secret
|
|
{{- if eq .Values.s3.logs.type "hostPath" }}
|
|
- name: logs
|
|
hostPath:
|
|
path: /storage/logs/seaweedfs/s3
|
|
type: DirectoryOrCreate
|
|
{{- end }}
|
|
{{- if .Values.global.enableSecurity }}
|
|
- name: security-config
|
|
configMap:
|
|
name: {{ template "seaweedfs.name" . }}-security-config
|
|
- name: ca-cert
|
|
secret:
|
|
secretName: {{ template "seaweedfs.name" . }}-ca-cert
|
|
- name: master-cert
|
|
secret:
|
|
secretName: {{ template "seaweedfs.name" . }}-master-cert
|
|
- name: volume-cert
|
|
secret:
|
|
secretName: {{ template "seaweedfs.name" . }}-volume-cert
|
|
- name: filer-cert
|
|
secret:
|
|
secretName: {{ template "seaweedfs.name" . }}-filer-cert
|
|
- name: client-cert
|
|
secret:
|
|
secretName: {{ template "seaweedfs.name" . }}-client-cert
|
|
{{- end }}
|
|
{{ tpl .Values.s3.extraVolumes . | indent 8 | trim }}
|
|
{{- if .Values.s3.nodeSelector }}
|
|
nodeSelector:
|
|
{{ tpl .Values.s3.nodeSelector . | indent 8 | trim }}
|
|
{{- end }}
|
|
{{- end }}
|