Skip to content

Commit

Permalink
How to debug Kubernetes? (Deployments, Services & Ingress) (antonputr…
Browse files Browse the repository at this point in the history
  • Loading branch information
antonputra authored Apr 24, 2024
1 parent 2d292ce commit 108c009
Show file tree
Hide file tree
Showing 56 changed files with 1,745 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# New Video - https://youtu.be/iE9Qb8dHqWI
# New Video - https://youtu.be/hixs2GIGrUw

[<img src="assets/192.png?raw=true">](https://youtu.be/iE9Qb8dHqWI)
[<img src="assets/193.png?raw=true">](https://youtu.be/hixs2GIGrUw)

# Playlists

Expand Down
Binary file removed assets/192.png
Binary file not shown.
Binary file added assets/193.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/contents.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,4 @@
- [190 - What is a Reverse Proxy? (vs. Forward Proxy)](../lessons/190)
- [191 - Types of Load Balancing Algorithms](../lessons/191)
- [192 - Kubernetes RBAC Explained](../lessons/192)
- [193 - How to debug Kubernetes? (Deployments, Services & Ingress)](../lessons/193)
22 changes: 22 additions & 0 deletions lessons/193/1-example/0-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
labels:
team: dev1
spec:
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- image: aputra/myapp-193:v6
name: my-container-1
ports:
- containerPort: 8080
12 changes: 12 additions & 0 deletions lessons/193/1-example/1-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: ClusterIP
ports:
- port: 7070
targetPort: 8080
selector:
app: my-app
16 changes: 16 additions & 0 deletions lessons/193/1-example/2-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-ingress
spec:
rules:
- http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: my-service
port:
number: 7070
11 changes: 11 additions & 0 deletions lessons/193/10-example/0-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
apiVersion: v1
kind: Pod
metadata:
name: myapp-1
spec:
containers:
- name: myapp
image: aputra/myapp-193:v16
ports:
- containerPort: 8080
11 changes: 11 additions & 0 deletions lessons/193/10-example/1-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
apiVersion: v1
kind: Pod
metadata:
name: myapp-2
spec:
containers:
- name: myapp
image: ubuntu:latest
command: ["/bin/bash", "-c", "--"]
args: ["sleep 2; echo 'System error: failed to write to Kafka'; exit 1;"]
11 changes: 11 additions & 0 deletions lessons/193/10-example/2-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
apiVersion: v1
kind: Pod
metadata:
name: myapp-3
spec:
containers:
- name: myapp
image: aputra/myapp-193:v6
ports:
- containerPort: 8080
29 changes: 29 additions & 0 deletions lessons/193/11-example/0-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
labels:
team: dev1
spec:
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- image: aputra/myapp-193:v6
name: my-container-1
ports:
- containerPort: 8080
volumeMounts:
- name: config-volume
mountPath: /etc/config
volumes:
- name: config-volume
configMap:
name: config
9 changes: 9 additions & 0 deletions lessons/193/11-example/1-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-config
data:
properties: |
level=hard
lives=3
31 changes: 31 additions & 0 deletions lessons/193/12-example/0-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
labels:
team: dev1
spec:
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- image: aputra/myapp-193:v6
name: my-container-1
ports:
- containerPort: 8080
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: role
operator: In
values:
- spot
28 changes: 28 additions & 0 deletions lessons/193/13-example/0-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
labels:
team: dev1
spec:
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- image: aputra/myapp-193:v6
name: my-container-1
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 3
periodSeconds: 5
22 changes: 22 additions & 0 deletions lessons/193/14-example/0-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
labels:
team: dev1
spec:
replicas: 2
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- image: aputra/myapp-193:v6
name: my-container-1
ports:
- containerPort: 8080
12 changes: 12 additions & 0 deletions lessons/193/14-example/1-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: ClusterIP
ports:
- port: 7070
targetPort: 8080
selector:
app: my-app
16 changes: 16 additions & 0 deletions lessons/193/14-example/2-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-ingress
spec:
rules:
- http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: my-service
port:
number: 7070
22 changes: 22 additions & 0 deletions lessons/193/2-example/0-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
labels:
team: dev1
spec:
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- image: aputra/myapp-193:v6
name: my-container-1
ports:
- containerPort: 8080
12 changes: 12 additions & 0 deletions lessons/193/2-example/1-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: ClusterIP
ports:
- port: 7070
targetPort: 8080
selector:
app: my-app
24 changes: 24 additions & 0 deletions lessons/193/3-example/0-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-blue-deployment
labels:
team: dev1
spec:
replicas: 1
selector:
matchLabels:
app: my-app
deployment: blue
template:
metadata:
labels:
app: my-app
deployment: blue
spec:
containers:
- image: aputra/myapp-193:v6
name: my-container-1
ports:
- containerPort: 8080
13 changes: 13 additions & 0 deletions lessons/193/3-example/1-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: v1
kind: Service
metadata:
name: my-blue-service
spec:
type: ClusterIP
ports:
- port: 7070
targetPort: 8080
selector:
app: my-app
deployment: blue
24 changes: 24 additions & 0 deletions lessons/193/4-example/0-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-blue-deployment
labels:
team: dev1
spec:
replicas: 1
selector:
matchLabels:
app: my-app
deployment: blue
template:
metadata:
labels:
app: my-app
deployment: blue
spec:
containers:
- image: aputra/myapp-193:v6
name: my-container-1
ports:
- containerPort: 8080
12 changes: 12 additions & 0 deletions lessons/193/4-example/1-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: Service
metadata:
name: my-blue-service
spec:
type: ClusterIP
ports:
- port: 8080
selector:
app: my-app
deployment: blue
23 changes: 23 additions & 0 deletions lessons/193/5-example/0-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
labels:
team: dev1
spec:
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- image: aputra/myapp-193:v6
name: my-container-1
ports:
- name: web
containerPort: 8080
Loading

0 comments on commit 108c009

Please sign in to comment.