rancher-partner-charts/charts/aquarist-labs/s3gw/templates/deployment.yaml

123 lines
3.7 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "s3gw.labels" . | indent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{ include "s3gw.selectorLabels" . | indent 6 }}
strategy:
type: Recreate
template:
metadata:
labels:
{{ include "s3gw.selectorLabels" . | indent 8 }}
spec:
{{- if .Values.imageCredentials }}
imagePullSecrets:
- name: {{ .Release.Name }}-image-pull-secret
{{- end }}
containers:
- name: {{ .Release.Name }}
image: {{ include "s3gw.image" . | quote }}
imagePullPolicy: {{ default "IfNotPresent" .Values.imagePullPolicy }}
args:
- "--rgw-dns-name"
{{- if .Values.ingress.enabled }}
- {{ include "s3gw.serviceName" . }}.{{ .Values.publicDomain }},
{{ include "s3gw.serviceName" . }}.{{ .Release.Namespace }}.{{ .Values.privateDomain }}
{{- else}}
- {{ include "s3gw.serviceName" . }}.{{ .Release.Namespace }}.{{ .Values.privateDomain }}
{{- end }}
- "--rgw-backend-store"
- sfs
- "--debug-rgw"
- '{{ .Values.logLevel }}'
- "--rgw_frontends"
{{- if or .Values.useCertManager .Values.tls.publicDomain.crt }}
- "beast port=7480 ssl_port=7481
ssl_certificate=/s3gw-cluster-ip-tls/tls.crt
ssl_private_key=/s3gw-cluster-ip-tls/tls.key"
{{ else }}
- "beast port=7480"
{{ end }}
{{- range $.Values.rgwCustomArgs }}
- {{ . | quote}}
{{- end }}
env:
{{- range $.Values.rgwCustomEnvs }}
{{- if (regexMatch "[^=]+=[^=]+" .) }}
{{- $tokens := split "=" . }}
- name: {{ $tokens._0 }}
value: {{ $tokens._1 | quote}}
{{- else if (regexMatch "^[^=]" .) }}
- name: {{ . }}
{{- else }}
{{- fail (print ".Values.rgwCustomEnvs contains an invalid entry: " .) }}
{{- end }}
{{- end }}
ports:
- containerPort: 7480
name: s3
{{- if or .Values.useCertManager .Values.tls.publicDomain.crt }}
- containerPort: 7481
name: s3-tls
{{ end }}
envFrom:
- secretRef:
name: {{ include "s3gw.defaultUserCredentialsSecret" . }}
volumeMounts:
- name: s3gw-lh-store
mountPath: /data
- name: s3gw-cluster-ip-tls
mountPath: /s3gw-cluster-ip-tls
volumes:
- name: s3gw-lh-store
persistentVolumeClaim:
claimName: {{ .Release.Name }}-pvc
- name: s3gw-cluster-ip-tls
secret:
secretName: {{ .Release.Name }}-{{ .Release.Namespace }}-cluster-ip-tls
optional: false
{{- if .Values.ui.enabled }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: '{{ .Release.Name }}-ui'
namespace: {{ .Release.Namespace }}
labels:
{{ include "s3gw.labels" . | indent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{ include "s3gw-ui.selectorLabels" . | indent 6 }}
strategy: {}
template:
metadata:
labels:
{{ include "s3gw-ui.selectorLabels" . | indent 8}}
spec:
{{- if .Values.imageCredentials }}
imagePullSecrets:
- name: {{ .Release.Name }}-image-pull-secret
{{- end }}
containers:
- name: s3gw-ui
image: {{ include "s3gw-ui.image" . | quote }}
imagePullPolicy: {{ default "IfNotPresent" .Values.ui.imagePullPolicy }}
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: {{ include "s3gw.configMap" . }}
- secretRef:
name: {{ include "s3gw.defaultUserCredentialsSecret" . }}
{{- end }}