Skip to content

Commit 24688a7

Browse files
Artyoppchaigno
authored andcommitted
ci: use eks nodegroup action in egw scale test
This commit refactors eks nodegroup action to add egw specific setup. Avoid shell script duplication and improves readability of the workflow. Signed-off-by: Antony Reynaud <antony.reynaud@isovalent.com>
1 parent 39fcdb8 commit 24688a7

2 files changed

Lines changed: 131 additions & 104 deletions

File tree

.github/actions/setup-eks-nodegroup/action.yml

Lines changed: 119 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,30 @@ inputs:
1818
description: ''
1919
required: false
2020
default: 'true'
21+
mode:
22+
description: ''
23+
required: false
24+
default: ''
25+
client_node_number:
26+
description: 'Node number, will only be used for egw mode'
27+
required: false
28+
default: '4'
29+
egw_default_zone:
30+
description: 'Availability zone that will be used for egw nodegroups'
31+
required: false
32+
default: ''
33+
egw_no_cilium_zone:
34+
description: 'Availability zone that will be used for no-cilium egw nodegroup'
35+
required: false
36+
default: ''
2137
runs:
2238
using: composite
2339
steps:
24-
- name: Create EKS nodegroup
40+
- name: Create nodegroup details (regular mode)
41+
if: ${{ inputs.mode != 'egw' }}
2542
shell: bash
2643
run: |
27-
cat <<EOF > eks-nodegroups.yaml
28-
apiVersion: eksctl.io/v1alpha5
29-
kind: ClusterConfig
30-
31-
metadata:
32-
name: ${{ inputs.cluster_name }}
33-
region: ${{ inputs.region }}
34-
version: "${{ inputs.version }}"
35-
tags:
36-
usage: "${{ github.repository_owner }}-${{ github.event.repository.name }}"
37-
owner: "${{ inputs.owner }}"
38-
44+
cat <<EOF > nodegroup-details.yaml
3945
managedNodeGroups:
4046
- name: ng-amd64
4147
instanceTypes:
@@ -63,4 +69,104 @@ runs:
6369
effect: "NoExecute"
6470
EOF
6571
72+
- name: Create nodegroup details (EGW mode)
73+
if: ${{ inputs.mode == 'egw' }}
74+
shell: bash
75+
run: |
76+
cat <<EOF > nodegroup-details.yaml
77+
managedNodeGroups:
78+
- name: ng-amd64-client
79+
instanceTypes:
80+
- m5n.xlarge
81+
availabilityZones:
82+
- ${{ inputs.egw_default_zone }}
83+
desiredCapacity: ${{ inputs.client_node_number }}
84+
spot: false
85+
privateNetworking: true
86+
volumeType: "gp3"
87+
volumeSize: 20
88+
maxPodsPerNode: 110
89+
taints:
90+
- key: "node.cilium.io/agent-not-ready"
91+
value: "true"
92+
effect: "NoExecute"
93+
labels:
94+
role.scaffolding/egw-client: "true"
95+
- name: ng-amd64-egw-node
96+
instanceTypes:
97+
- m5n.xlarge
98+
availabilityZones:
99+
- ${{ inputs.egw_default_zone }}
100+
desiredCapacity: 1
101+
spot: false
102+
privateNetworking: true
103+
volumeType: "gp3"
104+
volumeSize: 20
105+
maxPodsPerNode: 110
106+
taints:
107+
- key: "node.cilium.io/agent-not-ready"
108+
value: "true"
109+
effect: "NoExecute"
110+
labels:
111+
role.scaffolding/egw-node: "true"
112+
- name: ng-amd64-heapster
113+
instanceTypes:
114+
- m5n.xlarge
115+
availabilityZones:
116+
- ${{ inputs.egw_default_zone }}
117+
desiredCapacity: 1
118+
spot: false
119+
privateNetworking: true
120+
volumeType: "gp3"
121+
volumeSize: 20
122+
maxPodsPerNode: 110
123+
taints:
124+
- key: "node.cilium.io/agent-not-ready"
125+
value: "true"
126+
effect: "NoExecute"
127+
labels:
128+
role.scaffolding/monitoring: "true"
129+
- name: ng-amd64-no-cilium
130+
instanceTypes:
131+
- m5n.xlarge
132+
availabilityZones:
133+
- ${{ inputs.egw_no_cilium_zone }}
134+
desiredCapacity: 1
135+
spot: false
136+
privateNetworking: true
137+
volumeType: "gp3"
138+
volumeSize: 20
139+
taints:
140+
- key: "cilium.io/no-schedule"
141+
value: "true"
142+
effect: "NoSchedule"
143+
labels:
144+
cilium.io/no-schedule: "true"
145+
# Manually inject a dummy CNI configuration to let the Kubelet turn
146+
# ready. This is necessary as otherwise the node creation would
147+
# never complete. Regardless, no pods will be scheduled here given
148+
# that the node is tainted.
149+
preBootstrapCommands:
150+
- "echo '{ \"cniVersion\": \"0.3.1\", \"name\": \"dummy\", \"type\": \"dummy-cni\", \"log-file\": \"/var/run/dummy.log\" }' > /etc/cni/net.d/05-dummy.conf"
151+
EOF
152+
153+
- name: Create EKS nodegroup
154+
shell: bash
155+
run: |
156+
cat <<EOF > eks-nodegroups.yaml
157+
apiVersion: eksctl.io/v1alpha5
158+
kind: ClusterConfig
159+
160+
metadata:
161+
name: ${{ inputs.cluster_name }}
162+
region: ${{ inputs.region }}
163+
version: "${{ inputs.version }}"
164+
tags:
165+
usage: "${{ github.repository_owner }}-${{ github.event.repository.name }}"
166+
owner: "${{ inputs.owner }}"
167+
168+
EOF
169+
170+
cat ./nodegroup-details.yaml >> ./eks-nodegroups.yaml
171+
66172
eksctl create nodegroup -f ./eks-nodegroups.yaml

.github/workflows/scale-test-egw.yaml

Lines changed: 12 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -416,98 +416,19 @@ jobs:
416416
# This needs to be performed in a different step, because nodeGroups are not
417417
# supported during cluster creation in a cluster without VPC CNI. Cilium is
418418
# also required to be already installed for the step to complete successfully.
419-
- name: Create EKS nodegroups
420-
shell: bash
421-
run: |
422-
cat <<EOF > eks-nodegroup.yaml
423-
apiVersion: eksctl.io/v1alpha5
424-
kind: ClusterConfig
425-
426-
metadata:
427-
name: ${{ steps.vars.outputs.cluster_name }}
428-
region: ${{ steps.vars.outputs.eks_region }}
429-
version: "${{ steps.vars.outputs.eks_version }}"
430-
tags:
431-
usage: "${{ github.repository_owner }}-${{ github.event.repository.name }}"
432-
owner: "${{ steps.vars.outputs.owner }}"
433-
434-
managedNodeGroups:
435-
- name: ng-amd64-client
436-
instanceTypes:
437-
- ${{ steps.vars.outputs.node_instance_type }}
438-
availabilityZones:
439-
- ${{ steps.vars.outputs.eks_zone_1 }}
440-
desiredCapacity: ${{ steps.vars.outputs.num_client_nodes }}
441-
spot: false
442-
privateNetworking: true
443-
volumeType: "gp3"
444-
volumeSize: 20
445-
maxPodsPerNode: 110
446-
taints:
447-
- key: "node.cilium.io/agent-not-ready"
448-
value: "true"
449-
effect: "NoExecute"
450-
labels:
451-
role.scaffolding/egw-client: "true"
452-
- name: ng-amd64-egw-node
453-
instanceTypes:
454-
- ${{ steps.vars.outputs.node_instance_type }}
455-
availabilityZones:
456-
- ${{ steps.vars.outputs.eks_zone_1 }}
457-
desiredCapacity: 1
458-
spot: false
459-
privateNetworking: true
460-
volumeType: "gp3"
461-
volumeSize: 20
462-
maxPodsPerNode: 110
463-
taints:
464-
- key: "node.cilium.io/agent-not-ready"
465-
value: "true"
466-
effect: "NoExecute"
467-
labels:
468-
role.scaffolding/egw-node: "true"
469-
- name: ng-amd64-heapster
470-
instanceTypes:
471-
- ${{ steps.vars.outputs.node_instance_type }}
472-
availabilityZones:
473-
- ${{ steps.vars.outputs.eks_zone_1 }}
474-
desiredCapacity: 1
475-
spot: false
476-
privateNetworking: true
477-
volumeType: "gp3"
478-
volumeSize: 20
479-
maxPodsPerNode: 110
480-
taints:
481-
- key: "node.cilium.io/agent-not-ready"
482-
value: "true"
483-
effect: "NoExecute"
484-
labels:
485-
role.scaffolding/monitoring: "true"
486-
- name: ng-amd64-no-cilium
487-
instanceTypes:
488-
- ${{ steps.vars.outputs.node_instance_type }}
489-
availabilityZones:
490-
- ${{ steps.vars.outputs.eks_zone_2 }}
491-
desiredCapacity: 1
492-
spot: false
493-
privateNetworking: true
494-
volumeType: "gp3"
495-
volumeSize: 20
496-
taints:
497-
- key: "cilium.io/no-schedule"
498-
value: "true"
499-
effect: "NoSchedule"
500-
labels:
501-
cilium.io/no-schedule: "true"
502-
# Manually inject a dummy CNI configuration to let the Kubelet turn
503-
# ready. This is necessary as otherwise the node creation would
504-
# never complete. Regardless, no pods will be scheduled here given
505-
# that the node is tainted.
506-
preBootstrapCommands:
507-
- "echo '{ \"cniVersion\": \"0.3.1\", \"name\": \"dummy\", \"type\": \"dummy-cni\", \"log-file\": \"/var/run/dummy.log\" }' > /etc/cni/net.d/05-dummy.conf"
508-
EOF
509419

510-
eksctl create nodegroup -f ./eks-nodegroup.yaml --timeout=10m
420+
- name: Create EKS nodegroups
421+
uses: ./.github/actions/setup-eks-nodegroup
422+
with:
423+
cluster_name: ${{ steps.vars.outputs.cluster_name }}
424+
region: ${{ steps.vars.outputs.eks_region }}
425+
owner: "${{ steps.vars.outputs.owner }}"
426+
version: ${{ steps.vars.outputs.eks_version }}
427+
spot: false
428+
mode: "egw"
429+
client_node_number: ${{ steps.vars.outputs.num_client_nodes }}
430+
egw_default_zone: ${{ steps.vars.outputs.eks_zone_1 }}
431+
egw_no_cilium_zone: ${{ steps.vars.outputs.eks_zone_2 }}
511432

512433
- name: Wait for Cilium status to be ready
513434
run: |

0 commit comments

Comments
 (0)