-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathk8s-testserver-rke2.yaml
129 lines (124 loc) · 2.86 KB
/
k8s-testserver-rke2.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: Namespace
metadata:
name: miaow-test
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: k8s-testserver-deployment
namespace: miaow-test
labels:
app: k8s-testserver-demo
annotations:
authors: isas-fsd
spec:
replicas: 2
selector:
matchLabels:
app: k8s-testserver-demo
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: k8s-testserver-demo
version: 0.0.1
spec:
containers:
- image: 'epflsi/k8s-testserver:latest'
imagePullPolicy: Always
name: k8s-testserver-demo
ports:
- containerPort: 3000
protocol: TCP
resources:
limits:
cpu: 150m
memory: 150Mi
requests:
cpu: 50m
memory: 50Mi
envFrom:
- secretRef:
name: k8ssecret
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 15
timeoutSeconds: 1
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 15
timeoutSeconds: 1
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: k8s-testserver-service
namespace: miaow-test
labels:
app: k8s-testserver-demo
annotations:
authors: isas-fsd
spec:
ports:
- name: "80"
port: 80
protocol: TCP
targetPort: 3000
selector:
app: k8s-testserver-demo
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: miaow
namespace: miaow-test
spec:
rules:
# itsgitlab0002.xaas.epfl.ch and itsgitlab0003.xaas.epfl.ch are
# our worker nodes according to
# https://docs.google.com/spreadsheets/d/19_g6eNCIMY3F8Wi6VnAozZ_7LzlJyh-l0yhyOmOA7RI/edit?gid=0#gid=0
# ; as part of our “poor man's” test deployment (whence the Træfik
# chart is simply configured with ports.websecure.hostPort set to
# 443), Træfik can be on either node at any given time. (Find out
# with `kubectl get pods -n traefik-ingress-system -o wide`).
# Therefore we need two rules:
- host: itswbhst0018.xaas.epfl.ch
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: k8s-testserver-service
port:
number: 80
- host: itswbhst0020.xaas.epfl.ch
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: k8s-testserver-service
port:
number: 80
---
apiVersion: v1
kind: Secret
metadata:
name: k8ssecret
namespace: miaow-test
stringData:
K8SSECRET: monsupersecret
password: miaowmiaowmiaow
username: lechat
type: Opaque