Skip to content

Commit 83eac4a

Browse files
add privatebin
1 parent 19ff45c commit 83eac4a

File tree

10 files changed

+227
-0
lines changed

10 files changed

+227
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
apiVersion: "kustomize.config.k8s.io/v1alpha1"
3+
kind: "Component"
4+
patches:
5+
- target:
6+
kind: "Namespace"
7+
patch: |-
8+
- op: add
9+
path: "/metadata/labels/istio-injection"
10+
value: "enabled"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
apiVersion: networking.istio.io/v1alpha3
3+
kind: VirtualService
4+
metadata:
5+
name: privatebin
6+
spec:
7+
hosts:
8+
- privatebin.local
9+
gateways:
10+
- istio-system/gateway
11+
http:
12+
- match:
13+
- uri:
14+
prefix: /
15+
route:
16+
- destination:
17+
host: privatebin
18+
port:
19+
number: 80
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1alpha1
3+
kind: Component
4+
resources:
5+
- istio-virtualservice.yaml

apps/privatebin/conf.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
;<?php http_response_code(403);
2+
; config file for PrivateBin
3+
;
4+
; An explanation of each setting can be find online at https://github.com/PrivateBin/PrivateBin/wiki/Configuration.
5+
6+
[main]
7+
name = "bin"
8+
discussion = true
9+
opendiscussion = false
10+
password = true
11+
fileupload = true
12+
burnafterreadingselected = false
13+
defaultformatter = "plaintext"
14+
sizelimit = 10485760
15+
template = "bootstrap"
16+
languageselection = false
17+
18+
[expire]
19+
default = "1week"
20+
21+
[expire_options]
22+
5min = 300
23+
10min = 600
24+
1hour = 3600
25+
1day = 86400
26+
1week = 604800
27+
1month = 2592000
28+
1year = 31536000
29+
never = 0
30+
31+
[formatter_options]
32+
plaintext = "Plain Text"
33+
syntaxhighlighting = "Source Code"
34+
markdown = "Markdown"
35+
36+
[traffic]
37+
limit = 10
38+
39+
[purge]
40+
limit = 300
41+
batchsize = 10
42+
43+
[model]
44+
class = Filesystem
45+
[model_options]
46+
dir = PATH "data"
47+
48+
[yourls]

apps/privatebin/deployment.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
apiVersion: "apps/v1"
3+
kind: "Deployment"
4+
metadata:
5+
name: "privatebin"
6+
labels:
7+
app: "privatebin"
8+
annotations:
9+
reloader.stakater.com/auto: "true"
10+
spec:
11+
replicas: 1
12+
selector:
13+
matchLabels:
14+
app: "privatebin"
15+
template:
16+
metadata:
17+
labels:
18+
app: "privatebin"
19+
app.kubernetes.io/name: "privatebin"
20+
app.kubernetes.io/component: "privatebin"
21+
app.kubernetes.io/instance: "privatebin-prod"
22+
app.kubernetes.io/part-of: "privatebin"
23+
spec:
24+
securityContext:
25+
runAsUser: 23763
26+
runAsGroup: 23763
27+
fsGroup: 23763
28+
seccompProfile:
29+
type: "RuntimeDefault"
30+
containers:
31+
- name: "privatebin"
32+
image: "docker.io/privatebin/nginx-fpm-alpine:1.7.4@sha256:4cc5f26f5b558b734cb084ada4fdacd75bd9f5e4574f3f3df54165b3623d6b86"
33+
imagePullPolicy: "IfNotPresent"
34+
resources:
35+
requests:
36+
memory: "128Mi"
37+
cpu: "5m"
38+
limits:
39+
memory: "256Mi"
40+
ports:
41+
- containerPort: 8080
42+
name: "privatebin"
43+
readinessProbe:
44+
tcpSocket:
45+
port: "privatebin"
46+
livenessProbe:
47+
tcpSocket:
48+
port: "privatebin"
49+
securityContext:
50+
privileged: false
51+
allowPrivilegeEscalation: false
52+
readOnlyRootFilesystem: true
53+
runAsNonRoot: true
54+
runAsUser: 23763
55+
runAsGroup: 23763
56+
seccompProfile:
57+
type: "RuntimeDefault"
58+
capabilities:
59+
drop:
60+
- "ALL"
61+
volumeMounts:
62+
- name: "storage"
63+
mountPath: "/srv/data"
64+
- name: "config"
65+
mountPath: "/srv/cfg"
66+
- name: "tmp"
67+
mountPath: "/tmp"
68+
volumes:
69+
- name: "storage"
70+
emptyDir:
71+
sizeLimit: "1Gi"
72+
- name: "config"
73+
configMap:
74+
name: "privatebin-config"
75+
- name: "tmp"
76+
emptyDir:
77+
sizeLimit: "1Gi"

apps/privatebin/kustomization.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
resources:
5+
- deployment.yaml
6+
- service.yaml
7+
configMapGenerator:
8+
- name: privatebin-config
9+
files:
10+
- conf.php

apps/privatebin/service.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: "v1"
3+
kind: "Service"
4+
metadata:
5+
name: "privatebin"
6+
spec:
7+
ports:
8+
- port: 80
9+
targetPort: "privatebin"
10+
selector:
11+
app: "privatebin"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
apiVersion: external-secrets.io/v1beta1
3+
kind: ExternalSecret
4+
metadata:
5+
name: "memos"
6+
spec:
7+
refreshInterval: 12h
8+
secretStoreRef:
9+
name: "vault"
10+
kind: "ClusterSecretStore"
11+
target:
12+
name: "memos"
13+
template:
14+
engineVersion: v2
15+
data:
16+
MEMOS_DSN: "memos:{{ .password }}@tcp(dbs.ez.soeren.cloud:3306)/memos?charset=utf8&parseTime=True&loc=Local&tls=true"
17+
data:
18+
- secretKey: "password"
19+
remoteRef:
20+
key: "secret/soeren.cloud/env/prod/mariadb/galera-prod/memos/memos"
21+
property: "password"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
apiVersion: "kustomize.config.k8s.io/v1beta1"
3+
kind: "Kustomization"
4+
namespace: "privatebin"
5+
resources:
6+
- "namespace.yaml"
7+
- "../../../apps/privatebin"
8+
components:
9+
- "../../../apps/privatebin/components/istio"
10+
- "../../../apps/privatebin/components/istio-proxy"
11+
patches:
12+
- target:
13+
kind: "VirtualService"
14+
name: "privatebin"
15+
patch: |-
16+
- op: "replace"
17+
path: "/spec/hosts"
18+
value:
19+
- "privatebin.svc.ez.soeren.cloud"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
kind: "Namespace"
3+
apiVersion: "v1"
4+
metadata:
5+
name: "privatebin"
6+
labels:
7+
name: "privatebin"

0 commit comments

Comments
 (0)