-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeployment.yaml
129 lines (121 loc) · 2.68 KB
/
deployment.yaml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
apiVersion: v1
kind: Service
metadata:
name: dev-cat-ops
namespace: dhge
spec:
ports:
- port: 3000
selector:
app: dev-cat-ops
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dev-cat-ops
namespace: dhge
annotations:
cert-manager.io/cluster-issuer: letsencrypt
spec:
ingressClassName: traefik
rules:
- host: cats.pein-gera.de
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: dev-cat-ops
port:
number: 3000
tls:
- hosts:
- cats.pein-gera.de
secretName: cats-pein-gera-de-tls
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dev-cat-ops
namespace: dhge
spec:
selector:
matchLabels:
app: dev-cat-ops
template:
metadata:
labels:
app: dev-cat-ops
spec:
containers:
- image: gewuerznud3l/dev-cat-ops:latest
name: dev-cat-ops
imagePullPolicy: Always
volumeMounts:
- name: uploads
mountPath: /opt/devcatops/uploads
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: dev-cat-ops-db-password
key: password
- name: DATABASE_URL
value: "mysql://root:$(DB_PASSWORD)@localhost:3306/dev-cat-ops"
- name: CLASSIFI_CAT_ION_URL
value: "http://classifi-cat-ion:5000"
- image: mariadb:lts
name: mariadb
env:
- name: MYSQL_DATABASE
value: dev-cat-ops
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: dev-cat-ops-db-password
key: password
volumeMounts:
- name: db-data
mountPath: /var/lib/mysql
volumes:
- name: db-data
persistentVolumeClaim:
claimName: dev-cat-ops-db-data
- name: uploads
persistentVolumeClaim:
claimName: dev-cat-ops-uploads
topologySpreadConstraints:
- maxSkew: 1
topologyKey: node.kubernetes.io/instance-type # all nodes should have 'k3s'
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchExpressions:
- key: app
operator: Exists
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: dev-cat-ops-db-data
namespace: dhge
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: dev-cat-ops-uploads
namespace: dhge
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 1Gi