99 lines
3.2 KiB
YAML
99 lines
3.2 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ .Values.name }}
|
|
namespace: {{ .Values.namespace }}
|
|
labels:
|
|
app.kubernetes.io/name: {{ .Values.name }}
|
|
spec:
|
|
revisionHistoryLimit: 3
|
|
replicas: 1
|
|
strategy:
|
|
type: RollingUpdate
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: {{ .Values.name }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: {{ .Values.name }}
|
|
spec:
|
|
serviceAccountName: {{ .Values.name }}
|
|
automountServiceAccountToken: true
|
|
dnsPolicy: ClusterFirst
|
|
enableServiceLinks: true
|
|
initContainers:
|
|
- name: substitute-config
|
|
image: alpine
|
|
envFrom:
|
|
- secretRef:
|
|
name: {{ .Values.secrets.api-secrets }}
|
|
command:
|
|
- "sh"
|
|
- "-c"
|
|
- apk add gettext && envsubst < /mnt/init/services.yaml > /mnt/services.yaml
|
|
volumeMounts:
|
|
- name: homepage-config
|
|
mountPath: /mnt/init/services.yaml
|
|
subPath: services.yaml
|
|
- name: tmp
|
|
mountPath: /mnt
|
|
subPath: services.yaml
|
|
containers:
|
|
- name: {{ .Values.name }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
imagePullPolicy: IfNotPresent
|
|
env:
|
|
- name: HOMEPAGE_ALLOWED_HOSTS
|
|
value: "{{ .Values.env.HOMEPAGE_ALLOWED_HOSTS }}"
|
|
volumeMounts:
|
|
- mountPath: /app/config/custom.js
|
|
name: homepage-config
|
|
subPath: custom.js
|
|
- mountPath: /app/config/custom.css
|
|
name: homepage-config
|
|
subPath: custom.css
|
|
- mountPath: /app/config/bookmarks.yaml
|
|
name: homepage-config
|
|
subPath: bookmarks.yaml
|
|
- mountPath: /app/config/docker.yaml
|
|
name: homepage-config
|
|
subPath: docker.yaml
|
|
- mountPath: /app/config/kubernetes.yaml
|
|
name: homepage-config
|
|
subPath: kubernetes.yaml
|
|
- mountPath: /app/config
|
|
name: tmp
|
|
subPath: services.yaml
|
|
- mountPath: /app/config/settings.yaml
|
|
name: homepage-config
|
|
subPath: settings.yaml
|
|
- mountPath: /app/config/widgets.yaml
|
|
name: homepage-config
|
|
subPath: widgets.yaml
|
|
- mountPath: /app/config/logs
|
|
name: logs
|
|
- mountPath: /app/public/images
|
|
name: images
|
|
volumes:
|
|
- name: homepage-config
|
|
configMap:
|
|
name: {{ .Values.name }}-config
|
|
- name: logs
|
|
emptyDir: {}
|
|
- name: tmp
|
|
emptyDir: {}
|
|
{{- if and .Values.customImagesDirectory.enabled .Values.customImagesDirectory.existingClaim }}
|
|
- name: images
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Values.customImagesDirectory.claimName }}
|
|
{{- else if .Values.customImagesDirectory.enabled }}
|
|
- name: images
|
|
persistentVolumeClaim:
|
|
claimName: longhorn-{{ .Values.name }}-images
|
|
{{- else }}
|
|
- name: images
|
|
emptyDir: {}
|
|
{{- end }}
|