Installing using Kuberenets
To deploy Personal Ledger in a Kubernetes cluster you can use the following snippet. This will create a deployment, pod and service registration in the Kubernetes cluster.
After this you should create your own reverse proxy to expose it, either using Nginx, Apache or a Traefik ingress.
![]() |
Kubernetes is an advanced platform and should only be used if you already have some experience. |
Kubernetes deployment
The following snippet can be used to deploy Pledger.io in a Kubernetes cluster. This will start a single pod with a single container running Pledger.io.
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
description: Personal Ledger
labels:
app: pledger
name: pledger
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: pledger
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: pledger
spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
containers:
- image: ghcr.io/pledger-io/amd64-core:stable
name: pledger
ports:
- name: http
containerPort: 8080
volumeMounts:
- mountPath: 'opt/storage/logs'
name: pledger-log-volume
- mountPath: 'opt/storage/upload'
name: pledger-data-volume
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 60
failureThreshold: 5
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 60
failureThreshold: 5
timeoutSeconds: 10
env:
- name: DB_TYPE
value: "mysql"
- name: DATABASE_HOST
value: "pledger_db"
- name: DATABASE_SCHEMA
value: "pledger"
- name: DATABASE_USER
value: "pledger"
- name: DATABASE_PASSWORD
value: "pledger"
volumes:
- name: pledger-log-volume
hostPath:
path: '/mnt/data/pledger/logs'
- name: pledger-data-volume
hostPath:
path: '/mnt/data/pledger/data'
Kubernetes service
The following snippet can be used to create a service registration for Pledger.io in a Kubernetes cluster.
1
2
3
4
5
6
7
8
9
10
11
apiVersion: v1
kind: Service
metadata:
name: pledger
spec:
selector:
app: pledger
ports:
- protocol: TCP
port: 8080
targetPort: 8080
Kubernetes ingress
The following snippet can be used to create an ingress registration for Pledger.io in a Kubernetes cluster.
![]() |
Your K8S cluster should have an ingress controller installed and configured. |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: pledger
spec:
rules:
- host: pledger.example.com
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: pledger
port:
number: 8080