Skip to content

Commit c8d0ff5

Browse files
committed
subindo arquivos k8s
1 parent 881cf36 commit c8d0ff5

6 files changed

Lines changed: 110 additions & 0 deletions

File tree

k8s/busybox-test.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: busybox-test
5+
namespace: tp2
6+
spec:
7+
containers:
8+
- name: busybox
9+
image: busybox
10+
command: ["sleep", "3600"]
11+
restartPolicy: Never

k8s/devcalc-deployment.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: devcalc-deployment
5+
namespace: tp2
6+
spec:
7+
replicas: 2
8+
selector:
9+
matchLabels:
10+
app: devcalc
11+
template:
12+
metadata:
13+
labels:
14+
app: devcalc
15+
spec:
16+
containers:
17+
- name: devcalc
18+
image: shyuu7/devcalc-api:latest
19+
ports:
20+
- containerPort: 8080
21+
livenessProbe:
22+
httpGet:
23+
path: /actuator/health/liveness
24+
port: 8080
25+
initialDelaySeconds: 60
26+
periodSeconds: 30
27+
timeoutSeconds: 10
28+
failureThreshold: 3
29+
readinessProbe:
30+
httpGet:
31+
path: /actuator/health/readiness
32+
port: 8080
33+
initialDelaySeconds: 90
34+
periodSeconds: 30
35+
timeoutSeconds: 10
36+
failureThreshold: 3

k8s/devcalc-service.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: devcalc-service
5+
namespace: tp2
6+
spec:
7+
selector:
8+
app: devcalc
9+
ports:
10+
- name: http
11+
port: 8080
12+
targetPort: 8080
13+
nodePort: 30003
14+
protocol: TCP
15+
type: NodePort
16+

k8s/namespace.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: tp2

k8s/nginx-busy-pod.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: nginx-busy-pod
5+
namespace: tp2
6+
labels:
7+
app: nginx-busybox
8+
spec:
9+
containers:
10+
- name: nginx
11+
image: nginx:1.29.3-alpine-slim
12+
ports:
13+
- containerPort: 80
14+
- name: busybox
15+
image: busybox
16+
env:
17+
- name: USER
18+
value: "root"
19+
- name: PASSWORD
20+
value: "123456"
21+
command: ["/bin/sh"]
22+
args:
23+
- -c
24+
- |
25+
while true; do
26+
echo "$(date): USER=$USER"
27+
wget -qO- http://localhost:80 || echo "Erro ao conectar ao Nginx"
28+
sleep 10
29+
done

k8s/nginx-service.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: nginx-service
5+
namespace: tp2
6+
spec:
7+
selector:
8+
app: nginx-busybox
9+
ports:
10+
- name: http
11+
port: 8081
12+
targetPort: 80
13+
protocol: TCP
14+
type: ClusterIP

0 commit comments

Comments
 (0)