summaryrefslogtreecommitdiff
path: root/apps/linkding
diff options
context:
space:
mode:
Diffstat (limited to 'apps/linkding')
-rw-r--r--apps/linkding/Chart.yaml5
-rw-r--r--apps/linkding/bookmarks.html12
-rw-r--r--apps/linkding/templates/_helpers.tpl15
-rw-r--r--apps/linkding/templates/configmap.yaml10
-rw-r--r--apps/linkding/templates/deployment.yaml49
-rw-r--r--apps/linkding/templates/ingress.yaml22
-rw-r--r--apps/linkding/templates/job.yaml47
-rw-r--r--apps/linkding/templates/pvc.yaml16
-rw-r--r--apps/linkding/templates/service.yaml15
-rw-r--r--apps/linkding/values.yaml30
10 files changed, 221 insertions, 0 deletions
diff --git a/apps/linkding/Chart.yaml b/apps/linkding/Chart.yaml
new file mode 100644
index 0000000..1e6c33c
--- /dev/null
+++ b/apps/linkding/Chart.yaml
@@ -0,0 +1,5 @@
+apiVersion: v2
+name: linkding
+description: Linkding bookmark manager
+type: application
+version: 0.1.0
diff --git a/apps/linkding/bookmarks.html b/apps/linkding/bookmarks.html
new file mode 100644
index 0000000..f86d6f0
--- /dev/null
+++ b/apps/linkding/bookmarks.html
@@ -0,0 +1,12 @@
+<!DOCTYPE NETSCAPE-Bookmark-file-1>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
+<TITLE>Bookmarks</TITLE>
+<H1>Bookmarks</H1>
+<DL><p>
+ <DT><A HREF="https://kubernetes.io/docs/" ADD_DATE="1" TAGS="k8s,docs">Kubernetes Docs</A>
+ <DT><A HREF="https://helm.sh/docs/" ADD_DATE="1" TAGS="helm,docs">Helm Docs</A>
+ <DT><A HREF="https://argo-cd.readthedocs.io/" ADD_DATE="1" TAGS="argocd,gitops">ArgoCD Docs</A>
+ <DT><A HREF="https://grafana.com/docs/" ADD_DATE="1" TAGS="grafana,monitoring">Grafana Docs</A>
+ <DT><A HREF="https://prometheus.io/docs/" ADD_DATE="1" TAGS="prometheus,monitoring">Prometheus Docs</A>
+ <DT><A HREF="https://github.com/awesome-selfhosted/awesome-selfhosted" ADD_DATE="1" TAGS="selfhosted,reference">Awesome Selfhosted</A>
+</DL><p>
diff --git a/apps/linkding/templates/_helpers.tpl b/apps/linkding/templates/_helpers.tpl
new file mode 100644
index 0000000..2bf188c
--- /dev/null
+++ b/apps/linkding/templates/_helpers.tpl
@@ -0,0 +1,15 @@
+{{- define "linkding.name" -}}
+{{- .Chart.Name }}
+{{- end }}
+
+{{- define "linkding.labels" -}}
+helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
+app.kubernetes.io/name: {{ include "linkding.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{- define "linkding.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "linkding.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
diff --git a/apps/linkding/templates/configmap.yaml b/apps/linkding/templates/configmap.yaml
new file mode 100644
index 0000000..bf38029
--- /dev/null
+++ b/apps/linkding/templates/configmap.yaml
@@ -0,0 +1,10 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ include "linkding.name" . }}-bookmarks
+ namespace: {{ .Release.Namespace }}
+ labels:
+ {{- include "linkding.labels" . | nindent 4 }}
+data:
+ bookmarks.html: |
+ {{- .Files.Get "bookmarks.html" | nindent 4 }}
diff --git a/apps/linkding/templates/deployment.yaml b/apps/linkding/templates/deployment.yaml
new file mode 100644
index 0000000..3db4ae4
--- /dev/null
+++ b/apps/linkding/templates/deployment.yaml
@@ -0,0 +1,49 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "linkding.name" . }}
+ namespace: {{ .Release.Namespace }}
+ labels:
+ {{- include "linkding.labels" . | nindent 4 }}
+spec:
+ replicas: {{ .Values.replicaCount }}
+ selector:
+ matchLabels:
+ {{- include "linkding.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ {{- include "linkding.selectorLabels" . | nindent 8 }}
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ ports:
+ - containerPort: 9090
+ protocol: TCP
+ env:
+ - name: LD_SUPERUSER_NAME
+ value: {{ .Values.env.superuserName | quote }}
+ - name: LD_SUPERUSER_PASSWORD
+ value: {{ .Values.env.superuserPassword | quote }}
+ volumeMounts:
+ - name: data
+ mountPath: /etc/linkding/data
+ - name: bookmarks
+ mountPath: /bookmarks
+ {{- with .Values.resources }}
+ resources:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ volumes:
+ - name: data
+ {{- if .Values.persistence.enabled }}
+ persistentVolumeClaim:
+ claimName: {{ include "linkding.name" . }}-pvc
+ {{- else }}
+ emptyDir: {}
+ {{- end }}
+ - name: bookmarks
+ configMap:
+ name: {{ include "linkding.name" . }}-bookmarks
diff --git a/apps/linkding/templates/ingress.yaml b/apps/linkding/templates/ingress.yaml
new file mode 100644
index 0000000..39f16ff
--- /dev/null
+++ b/apps/linkding/templates/ingress.yaml
@@ -0,0 +1,22 @@
+{{- if .Values.ingress.enabled }}
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: {{ include "linkding.name" . }}-ingress
+ namespace: {{ .Release.Namespace }}
+ labels:
+ {{- include "linkding.labels" . | nindent 4 }}
+spec:
+ ingressClassName: {{ .Values.ingress.className }}
+ rules:
+ - host: {{ .Values.ingress.host }}
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: {{ include "linkding.name" . }}-service
+ port:
+ number: {{ .Values.service.port }}
+{{- end }}
diff --git a/apps/linkding/templates/job.yaml b/apps/linkding/templates/job.yaml
new file mode 100644
index 0000000..8b0705b
--- /dev/null
+++ b/apps/linkding/templates/job.yaml
@@ -0,0 +1,47 @@
+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 "Waiting for linkding to be ready..."
+ until wget -qO- "http://{{ include "linkding.name" . }}-service:{{ .Values.service.port }}/health" > /dev/null 2>&1; do
+ echo "Not ready, retrying in 3s..."
+ sleep 3
+ done
+ echo "Linkding is up, waiting 5s for full init..."
+ sleep 5
+ echo "Importing bookmarks..."
+ python /etc/linkding/manage.py import_bookmarks \
+ /bookmarks/bookmarks.html \
+ --user {{ .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
diff --git a/apps/linkding/templates/pvc.yaml b/apps/linkding/templates/pvc.yaml
new file mode 100644
index 0000000..141f51c
--- /dev/null
+++ b/apps/linkding/templates/pvc.yaml
@@ -0,0 +1,16 @@
+{{- if .Values.persistence.enabled }}
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: {{ include "linkding.name" . }}-pvc
+ namespace: {{ .Release.Namespace }}
+ labels:
+ {{- include "linkding.labels" . | nindent 4 }}
+spec:
+ accessModes:
+ - ReadWriteOnce
+ storageClassName: {{ .Values.persistence.storageClass }}
+ resources:
+ requests:
+ storage: {{ .Values.persistence.size }}
+{{- end }}
diff --git a/apps/linkding/templates/service.yaml b/apps/linkding/templates/service.yaml
new file mode 100644
index 0000000..1475b17
--- /dev/null
+++ b/apps/linkding/templates/service.yaml
@@ -0,0 +1,15 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "linkding.name" . }}-service
+ namespace: {{ .Release.Namespace }}
+ labels:
+ {{- include "linkding.labels" . | nindent 4 }}
+spec:
+ type: {{ .Values.service.type }}
+ selector:
+ {{- include "linkding.selectorLabels" . | nindent 4 }}
+ ports:
+ - protocol: TCP
+ port: {{ .Values.service.port }}
+ targetPort: 9090
diff --git a/apps/linkding/values.yaml b/apps/linkding/values.yaml
new file mode 100644
index 0000000..4060b79
--- /dev/null
+++ b/apps/linkding/values.yaml
@@ -0,0 +1,30 @@
+replicaCount: 1
+
+image:
+ repository: sissbruecker/linkding
+ tag: "latest"
+ pullPolicy: IfNotPresent
+
+auth:
+ adminUser: admin
+ adminPassword: changeme
+
+service:
+ type: ClusterIP
+ port: 9090
+
+ingress:
+ enabled: true
+ className: nginx
+ host: linkding.local
+
+persistence:
+ enabled: true
+ storageClass: local-path
+ size: 1Gi
+
+env:
+ superuserName: admin
+ superuserPassword: changeme
+
+resources: {}