File tree 4 files changed +59
-7
lines changed
4 files changed +59
-7
lines changed Original file line number Diff line number Diff line change @@ -67,3 +67,4 @@ target/
67
67
.idea /*
68
68
* .iml
69
69
.vscode
70
+ test-requirements.txt
Original file line number Diff line number Diff line change @@ -4,18 +4,49 @@ metadata:
4
4
name : nginx-deployment
5
5
labels :
6
6
app : nginx
7
+
7
8
spec :
8
- replicas : 3
9
+ replicas : 5
9
10
selector :
10
11
matchLabels :
11
12
app : nginx
13
+
12
14
template :
13
15
metadata :
14
16
labels :
15
17
app : nginx
16
18
spec :
17
19
containers :
18
20
- name : nginx
19
- image : nginx:1.15.4
21
+ image : nginx:1.23.3
20
22
ports :
21
23
- containerPort : 80
24
+
25
+
26
+ livenessProbe :
27
+ httpGet :
28
+ path : /
29
+ port : 80
30
+ initialDelaySeconds : 5
31
+ periodSeconds : 10
32
+
33
+
34
+ readinessProbe :
35
+ httpGet :
36
+ path : /
37
+ port : 80
38
+ initialDelaySeconds : 3
39
+ periodSeconds : 5
40
+
41
+
42
+ resources :
43
+ requests :
44
+ cpu : " 100m"
45
+ memory : " 128Mi"
46
+ limits :
47
+ cpu : " 250m"
48
+ memory : " 256Mi"
49
+
50
+ env :
51
+ - name : WELCOME_MESSAGE
52
+ value : " Hello from Kubernetes!"
Original file line number Diff line number Diff line change
1
+ from kubernetes import client , config
2
+
3
+ # Load kubeconfig (Ensure you have access to a cluster)
4
+ config .load_kube_config ()
5
+
6
+ # Create API client
7
+ v1 = client .CoreV1Api ()
8
+
9
+ # Fetch pods
10
+ pods = v1 .list_pod_for_all_namespaces ()
11
+
12
+ # Debugging: Print the total number of pods
13
+ print (f"Total pods found: { len (pods .items )} " )
14
+
15
+ # Iterate only if there are pods
16
+ if pods .items :
17
+ for pod in pods .items :
18
+ print (f"Pod: { pod .metadata .name } , Namespace: { pod .metadata .namespace } " )
19
+ else :
20
+ print ("No pods found." )
Original file line number Diff line number Diff line change 1
- coverage>=4.0.3
2
- nose>=1.3.7
1
+ coverage
2
+ nose
3
3
pytest
4
4
pytest-cov
5
- pluggy>=0.3.1
6
- randomize>=0.13
7
- sphinx>=1.4 # BSD
5
+ pluggy
6
+ randomize
7
+ sphinx# BSD
8
8
recommonmark
9
9
sphinx_markdown_tables
10
10
pycodestyle
You can’t perform that action at this time.
0 commit comments