Skip to content

Commit 8c920f8

Browse files
authored
Update kubernetes-troubleshooting-scenarios.yml
1 parent e29df7e commit 8c920f8

File tree

1 file changed

+45
-120
lines changed

1 file changed

+45
-120
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Kubernetes Troubleshooting Scenarios
1+
name: Deploy Interview App
22

33
on:
44
workflow_dispatch:
@@ -10,7 +10,7 @@ on:
1010

1111
env:
1212
IMAGE_NAME: becloudready/k8s-troubleshooting-scenarios
13-
IMAGE_TAG: 2.0.0
13+
IMAGE_TAG: 7.0.0
1414

1515
jobs:
1616
deploy:
@@ -34,145 +34,70 @@ jobs:
3434
run: |
3535
kubectl create namespace ${{ inputs.namespace }} --dry-run=client -o yaml | kubectl apply -f -
3636
37-
- name: Deploy OOM Killer Scenario
37+
- name: Apply ConfigMap
3838
run: |
3939
cat <<EOF | kubectl apply -n ${{ inputs.namespace }} -f -
40-
apiVersion: apps/v1
41-
kind: Deployment
40+
apiVersion: v1
41+
kind: ConfigMap
4242
metadata:
43-
name: oom-deployment
44-
spec:
45-
replicas: 1
46-
selector:
47-
matchLabels:
48-
app: oom-app
49-
template:
50-
metadata:
51-
labels:
52-
app: oom-app
53-
spec:
54-
containers:
55-
- name: oom-container
56-
image: becloudready/k8s-troubleshooting-scenarios:2.0.0
57-
env:
58-
- name: FAILURE_MODE
59-
value: "oom"
60-
resources:
61-
limits:
62-
memory: "128Mi"
43+
name: app-config
44+
data:
45+
config.yml: |
46+
database:
47+
host: db-service
48+
port: 5432
49+
logging:
50+
level: debug
6351
EOF
6452
65-
- name: Deploy Missing File Scenario
53+
- name: Deploy Interview App
6654
run: |
6755
cat <<EOF | kubectl apply -n ${{ inputs.namespace }} -f -
6856
apiVersion: apps/v1
6957
kind: Deployment
7058
metadata:
71-
name: missing-file-deployment
59+
name: interview-app
7260
spec:
7361
replicas: 1
7462
selector:
7563
matchLabels:
76-
app: missing-file-app
64+
app: interview
7765
template:
7866
metadata:
7967
labels:
80-
app: missing-file-app
68+
app: interview
8169
spec:
70+
dnsPolicy: "Default"
71+
dnsConfig:
72+
nameservers:
73+
- "203.0.113.123"
74+
searches:
75+
- google.com
76+
options:
77+
- name: ndots
78+
value: "1"
8279
containers:
83-
- name: missing-file-container
84-
image: becloudready/k8s-troubleshooting-scenarios:2.0.0
85-
env:
86-
- name: FAILURE_MODE
87-
value: "missing_file"
88-
EOF
89-
90-
- name: Deploy DNS Issues Scenario
91-
run: |
92-
cat <<EOF | kubectl apply -n ${{ inputs.namespace }} -f -
93-
apiVersion: apps/v1
94-
kind: Deployment
95-
metadata:
96-
name: dns-issues-deployment
97-
spec:
98-
replicas: 1
99-
selector:
100-
matchLabels:
101-
app: dns-issues-app
102-
template:
103-
metadata:
104-
labels:
105-
app: dns-issues-app
106-
spec:
107-
dnsPolicy: Default
108-
containers:
109-
- name: dns-issues-container
110-
image: becloudready/k8s-troubleshooting-scenarios:2.0.0
111-
env:
112-
- name: FAILURE_MODE
113-
value: "dns"
114-
EOF
115-
116-
- name: Deploy Taints and Tolerations Example
117-
run: |
118-
cat <<EOF | kubectl apply -n ${{ inputs.namespace }} -f -
119-
apiVersion: apps/v1
120-
kind: Deployment
121-
metadata:
122-
name: tolerations-deployment
123-
spec:
124-
replicas: 1
125-
selector:
126-
matchLabels:
127-
app: tolerations-app
128-
template:
129-
metadata:
130-
labels:
131-
app: tolerations-app
132-
spec:
133-
tolerations:
134-
- key: "dedicated"
135-
operator: "Equal"
136-
value: "gpu"
137-
effect: "NoSchedule"
138-
containers:
139-
- name: tolerations-container
140-
image: becloudready/k8s-troubleshooting-scenarios:2.0.0
80+
- name: main
81+
image: \${{ env.IMAGE_NAME }}:\${{ env.IMAGE_TAG }}
82+
command: ["python3", "/app/troubleshoot_scenarios.py"]
83+
volumeMounts:
84+
- name: config-vol
85+
mountPath: /etc/app
86+
resources:
87+
limits:
88+
memory: "256Mi"
89+
cpu: "500m"
90+
volumes:
91+
- name: config-vol
92+
configMap:
93+
name: app-config
94+
items:
95+
- key: config1.yml
96+
path: config.yaml
14197
EOF
14298
143-
- name: Deploy Affinity/Anti-affinity Example
99+
- name: Verify Deployment
144100
run: |
145-
cat <<EOF | kubectl apply -n ${{ inputs.namespace }} -f -
146-
apiVersion: apps/v1
147-
kind: Deployment
148-
metadata:
149-
name: affinity-deployment
150-
spec:
151-
replicas: 3
152-
selector:
153-
matchLabels:
154-
app: affinity-app
155-
template:
156-
metadata:
157-
labels:
158-
app: affinity-app
159-
spec:
160-
affinity:
161-
podAntiAffinity:
162-
requiredDuringSchedulingIgnoredDuringExecution:
163-
- labelSelector:
164-
matchExpressions:
165-
- key: app
166-
operator: In
167-
values:
168-
- affinity-app
169-
topologyKey: "kubernetes.io/hostname"
170-
containers:
171-
- name: affinity-container
172-
image: becloudready/k8s-troubleshooting-scenarios:2.0.0
173-
EOF
101+
kubectl get pods -n ${{ inputs.namespace }}
174102
175-
- name: Verify deployments
176-
run: |
177-
kubectl get deployments -n ${{ inputs.namespace }}
178103

0 commit comments

Comments
 (0)