-
Notifications
You must be signed in to change notification settings - Fork 3
208 lines (203 loc) · 7.22 KB
/
detailed-e2e.yml
File metadata and controls
208 lines (203 loc) · 7.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
---
name: "Detailed Integration Tests"
on:
repository_dispatch:
types: [dispatch-with-artifacts, test-dispatch-with-artifacts]
jobs:
build:
name: Build Step Details
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-go@v3
with:
go-version: '^1.20.3'
- name: Display Go version
run: go version
- name: Checkout code
uses: actions/checkout@v2
- name: Build k8s-toolbox with details
run: |
echo "=== Build Details ==="
echo "Timestamp: $(date -Iseconds)"
echo "Go version: $(go version)"
echo "Working directory: $(pwd)"
echo "Repository: $GITHUB_REPOSITORY"
echo "Commit SHA: $GITHUB_SHA"
echo ""
echo "=== Building k8s-toolbox ==="
go build -v .
echo ""
echo "=== Binary details ==="
ls -la ktbx
file ktbx
./ktbx version || echo "Version command not available"
echo ""
echo "=== Installing binary ==="
go install .
echo "Build completed successfully"
kind_install:
name: Kind Installation Details
runs-on: ubuntu-22.04
needs: build
steps:
- uses: actions/setup-go@v3
with:
go-version: '^1.20.3'
- name: Checkout code
uses: actions/checkout@v2
- name: Install k8s-toolbox
run: go install .
- name: Install kind with details
run: |
echo "=== Kind Installation Details ==="
echo "Timestamp: $(date -Iseconds)"
echo "System info:"
uname -a
echo "Available disk space:"
df -h
echo "Memory info:"
free -h
echo ""
echo "=== Installing kind ==="
ktbx install kind
echo ""
echo "=== Kind installation verification ==="
which kind
kind version
echo "Kind installation completed successfully"
cluster_create:
name: Cluster Creation Details
runs-on: ubuntu-22.04
needs: kind_install
steps:
- uses: actions/setup-go@v3
with:
go-version: '^1.20.3'
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: |
go install .
ktbx install kind
ktbx install helm
- name: Create cluster with details
run: |
echo "=== Cluster Creation Details ==="
echo "Timestamp: $(date -Iseconds)"
echo "Docker info:"
docker version
docker info | grep -E "(CPUs|Memory|Storage)"
echo ""
echo "=== Creating single-node cluster ==="
ktbx create --single
echo ""
echo "=== Cluster creation verification ==="
kind get clusters
kubectl cluster-info
kubectl config current-context
echo "Cluster creation completed successfully"
verify_pods:
name: Pod Verification Details
runs-on: ubuntu-22.04
needs: cluster_create
steps:
- uses: actions/setup-go@v3
with:
go-version: '^1.20.3'
- name: Checkout code
uses: actions/checkout@v2
- name: Setup cluster
run: |
go install .
ktbx install kind
ktbx install helm
ktbx create --single
- name: Verify pods with details
run: |
echo "=== Pod Verification Details ==="
echo "Timestamp: $(date -Iseconds)"
echo ""
echo "=== All pods across all namespaces ==="
kubectl get pods --all-namespaces -o wide
echo ""
echo "=== Kube-system pods detailed view ==="
kubectl get pods -n kube-system -o yaml
echo ""
echo "=== Pod status summary ==="
echo "Total pods:"
kubectl get pods --all-namespaces --no-headers | wc -l
echo "Running pods:"
kubectl get pods --all-namespaces --no-headers | grep Running | wc -l
echo "Pending pods:"
kubectl get pods --all-namespaces --no-headers | grep Pending | wc -l
echo "Failed pods:"
kubectl get pods --all-namespaces --no-headers | grep -E "(Failed|Error|CrashLoopBackOff)" | wc -l
echo ""
echo "=== Events related to pods ==="
kubectl get events --all-namespaces --sort-by=.metadata.creationTimestamp
echo "Pod verification completed successfully"
verify_nodes:
name: Node Verification Details
runs-on: ubuntu-22.04
needs: cluster_create
steps:
- uses: actions/setup-go@v3
with:
go-version: '^1.20.3'
- name: Checkout code
uses: actions/checkout@v2
- name: Setup cluster
run: |
go install .
ktbx install kind
ktbx install helm
ktbx create --single
- name: Verify nodes with details
run: |
echo "=== Node Verification Details ==="
echo "Timestamp: $(date -Iseconds)"
echo ""
echo "=== Node overview ==="
kubectl get nodes -o wide
echo ""
echo "=== Node detailed information ==="
kubectl describe nodes
echo ""
echo "=== Node capacity and allocatable resources ==="
kubectl get nodes -o json | jq -r '.items[] | {name: .metadata.name, capacity: .status.capacity, allocatable: .status.allocatable}'
echo ""
echo "=== Node conditions ==="
kubectl get nodes -o json | jq -r '.items[] | {name: .metadata.name, conditions: [.status.conditions[] | {type: .type, status: .status, reason: .reason}]}'
echo ""
echo "=== System info from nodes ==="
kubectl get nodes -o json | jq -r '.items[] | {name: .metadata.name, nodeInfo: .status.nodeInfo}'
echo ""
echo "=== Resource usage (if metrics-server available) ==="
kubectl top nodes || echo "metrics-server not available"
echo "Node verification completed successfully"
summary:
name: Test Summary
runs-on: ubuntu-22.04
needs: [build, kind_install, cluster_create, verify_pods, verify_nodes]
if: always()
steps:
- name: Display test results summary
run: |
echo "=== Detailed Integration Test Summary ==="
echo "Timestamp: $(date -Iseconds)"
echo ""
echo "📋 Test Steps Results:"
echo " build: ${{ needs.build.result }} ($(date -Iseconds))"
echo " kind_install: ${{ needs.kind_install.result }} ($(date -Iseconds))"
echo " cluster_create: ${{ needs.cluster_create.result }} ($(date -Iseconds))"
echo " verify_pods: ${{ needs.verify_pods.result }} ($(date -Iseconds))"
echo " verify_nodes: ${{ needs.verify_nodes.result }} ($(date -Iseconds))"
echo ""
echo "=== Overall Status ==="
if [[ "${{ needs.build.result }}" == "success" && "${{ needs.kind_install.result }}" == "success" && "${{ needs.cluster_create.result }}" == "success" && "${{ needs.verify_pods.result }}" == "success" && "${{ needs.verify_nodes.result }}" == "success" ]]; then
echo "✅ All tests passed successfully"
exit 0
else
echo "❌ Some tests failed"
exit 1
fi