Skip to content

Commit a4c85e2

Browse files
committed
Lab 9, task 2
1 parent 451e551 commit a4c85e2

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

k8s/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,32 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
1111
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 22m
1212
service/web-app-py LoadBalancer 10.109.167.161 <pending> 80:30520/TCP 39s
1313
```
14+
15+
## Manifest-based setup
16+
17+
```
18+
$ kubectl get pods,svc
19+
NAME READY STATUS RESTARTS AGE
20+
pod/web-app-py-54bf57f5d4-g8ktf 1/1 Running 0 3m23s
21+
pod/web-app-py-54bf57f5d4-k8ngh 1/1 Running 0 3m23s
22+
pod/web-app-py-54bf57f5d4-p4d6p 1/1 Running 0 3m23s
23+
24+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
25+
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 4m43s
26+
service/web-app-py LoadBalancer 10.105.228.85 <pending> 5000:31951/TCP 3m23s
27+
$ minikube service --all
28+
|-----------|------------|-------------|--------------|
29+
| NAMESPACE | NAME | TARGET PORT | URL |
30+
|-----------|------------|-------------|--------------|
31+
| default | kubernetes | | No node port |
32+
|-----------|------------|-------------|--------------|
33+
😿 service default/kubernetes has no node port
34+
|-----------|------------|-------------|---------------------------|
35+
| NAMESPACE | NAME | TARGET PORT | URL |
36+
|-----------|------------|-------------|---------------------------|
37+
| default | web-app-py | 5000 | http://192.168.49.2:31951 |
38+
|-----------|------------|-------------|---------------------------|
39+
🎉 Opening service default/web-app-py in default browser...
40+
Opening in existing browser session.
41+
$
42+
```

k8s/web-app-py-deployment.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: web-app-py
5+
spec:
6+
replicas: 3
7+
selector:
8+
matchLabels:
9+
app: web-app-py
10+
template:
11+
metadata:
12+
labels:
13+
app: web-app-py
14+
spec:
15+
containers:
16+
- name: web-app-py
17+
image: kolay0ne/app_py:lab8
18+
ports:
19+
- containerPort: 5000
20+
name: web-ui
21+
strategy:
22+
type: RollingUpdate
23+
rollingUpdate:
24+
maxUnavailable: 1

k8s/web-app-py-service.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: web-app-py
5+
spec:
6+
selector:
7+
app: web-app-py
8+
ports:
9+
- protocol: TCP
10+
port: 5000
11+
targetPort: web-ui
12+
type: LoadBalancer

0 commit comments

Comments
 (0)