Skip to content

Commit ab1781a

Browse files
committed
Add OpenShift and kubernetes yamls for easy deployment
1 parent 71bd5c8 commit ab1781a

File tree

3 files changed

+113
-0
lines changed

3 files changed

+113
-0
lines changed

openshift/01_deployment.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
app: caddy-upload
6+
name: caddy-upload
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: caddy-upload
12+
strategy:
13+
rollingUpdate:
14+
maxSurge: 25%
15+
maxUnavailable: 1
16+
type: RollingUpdate
17+
template:
18+
metadata:
19+
labels:
20+
app: caddy-upload
21+
spec:
22+
securityContext:
23+
seccompProfile:
24+
type: RuntimeDefault
25+
runAsNonRoot: true
26+
containers:
27+
- name: caddy-upload
28+
# TODO: Adopt to your image if wished
29+
image: me2digital/caddyv2-upload:latest
30+
imagePullPolicy: Always
31+
securityContext:
32+
allowPrivilegeEscalation: false
33+
capabilities:
34+
drop:
35+
- ALL
36+
env:
37+
- name: APPPORT
38+
value: ':2011'
39+
- name: XDG_DATA_HOME
40+
value: /opt/
41+
- name: SKIP_LOG
42+
value: 'true'
43+
ports:
44+
- containerPort: 2011
45+
name: http
46+
protocol: TCP
47+
readinessProbe:
48+
httpGet:
49+
path: /health
50+
port: 2011
51+
scheme: HTTP
52+
livenessProbe:
53+
httpGet:
54+
path: /health
55+
port: 2011
56+
scheme: HTTP
57+
initialDelaySeconds: 10
58+
timeoutSeconds: 1
59+
periodSeconds: 10
60+
successThreshold: 1
61+
failureThreshold: 3
62+
startupProbe:
63+
httpGet:
64+
path: /health
65+
port: 2011
66+
scheme: HTTP
67+
initialDelaySeconds: 10
68+
timeoutSeconds: 1
69+
periodSeconds: 10
70+
successThreshold: 1
71+
failureThreshold: 3
72+
resources:
73+
requests:
74+
cpu: 400m
75+
memory: 500Mi
76+
limits:
77+
cpu: 400m
78+
memory: 500Mi

openshift/02_service.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
app: caddy-upload
6+
name: caddy-upload
7+
spec:
8+
ports:
9+
- name: http
10+
port: 2011
11+
protocol: TCP
12+
targetPort: 2011
13+
selector:
14+
app: caddy-upload
15+
type: ClusterIP

openshift/03_route.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: route.openshift.io/v1
2+
kind: Route
3+
metadata:
4+
name: caddy-upload
5+
labels:
6+
app: caddy-upload
7+
annotations:
8+
# Needed so we get the original X-Forwarded headers
9+
haproxy.router.openshift.io/set-forwarded-headers: if-none
10+
spec:
11+
# host: TODO: Add optional host name
12+
port:
13+
targetPort: http
14+
tls:
15+
insecureEdgeTerminationPolicy: Redirect
16+
termination: edge
17+
to:
18+
kind: Service
19+
name: caddy-upload
20+
weight: null

0 commit comments

Comments
 (0)