blob: f34ed53944b06cf9a9282e055b2e777093f8ce1f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "linkding.name" . }}-import
namespace: {{ .Release.Namespace }}
labels:
{{- include "linkding.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "1"
"helm.sh/hook-delete-policy": hook-succeeded,hook-failed
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: import
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /bin/sh
- -c
- |
echo "Giving linkding time to start..."
sleep 20
echo "Waiting for linkding to be ready..."
until python -c "import urllib.request, sys; urllib.request.urlopen('http://linkding-service:{{ .Values.service.port }}/health'); sys.exit(0)" 2>/dev/null; do
echo "Not ready, retrying in 3s..."
sleep 3
done
echo "Linkding is ready, importing bookmarks..."
python /etc/linkding/manage.py import_netscape \
/bookmarks/bookmarks.html {{ .Values.auth.adminUser | quote }}
echo "Done!"
volumeMounts:
- name: data
mountPath: /etc/linkding/data
- name: bookmarks
mountPath: /bookmarks
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ include "linkding.name" . }}-pvc
- name: bookmarks
configMap:
name: {{ include "linkding.name" . }}-bookmarks
|