Skip to content

Commit cba3034

Browse files
[8.13](backport #38659) Deploy K8S Pipeline migration (#38713)
* Deploy K8S Pipeline migration (#38659) * updated auditbeat & deploy k8s pipelines * added kind & kuve env vars, set higer ulimit * added k8s env setup (cherry picked from commit aaa4829) * updated filebeat pipeline --------- Co-authored-by: Olga Naydyonock <[email protected]>
1 parent ef48eb4 commit cba3034

23 files changed

+681
-359
lines changed

.buildkite/auditbeat/auditbeat-pipeline.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
name: "beats-auditbeat"
33

44
env:
5-
AWS_IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2004-aarch64"
5+
BEATS_PROJECT_NAME: "auditbeat"
66
IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204"
7-
IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2204-aarch64"
7+
AWS_IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2004-aarch64"
88
IMAGE_RHEL9: "family/platform-ingest-beats-rhel-9"
99
IMAGE_WIN_10: "family/platform-ingest-beats-windows-10"
1010
IMAGE_WIN_11: "family/platform-ingest-beats-windows-11"
1111
IMAGE_WIN_2016: "family/platform-ingest-beats-windows-2016"
1212
IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019"
1313
IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022"
1414
IMAGE_MACOS_X86_64: "generic-13-ventura-x64"
15-
BEATS_PROJECT_NAME: "auditbeat"
15+
IMAGE_MACOS_ARM: "generic-13-ventura-arm"
1616
GCP_DEFAULT_MACHINE_TYPE: "c2d-highcpu-8"
1717
GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16"
1818
GCP_WIN_MACHINE_TYPE: "n2-standard-8"
19-
AWS_ARM_INSTANCE_TYPE: "t4g.xlarge"
19+
AWS_ARM_INSTANCE_TYPE: "m6g.xlarge"
2020

2121
steps:
2222
- input: "Input Parameters"
@@ -62,7 +62,7 @@ steps:
6262

6363
- label: ":linux: Load dynamic auditbeat pipeline"
6464
key: "auditbeat-pipeline"
65-
command: ".buildkite/scripts/generate_auditbeat_pipeline.sh"
65+
command: ".buildkite/auditbeat/generate_auditbeat_pipeline.sh"
6666
notify:
6767
- github_commit_status:
6868
context: "${BEATS_PROJECT_NAME}: Load dynamic pipeline's steps"

.buildkite/scripts/generate_auditbeat_pipeline.sh renamed to .buildkite/auditbeat/generate_auditbeat_pipeline.sh

Lines changed: 86 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,77 +6,69 @@ set -euo pipefail
66

77
pipelineName="pipeline.auditbeat-dynamic.yml"
88

9-
# TODO: steps: must be always included
9+
# TODO: steps: must be always included
1010
echo "Add the mandatory and extended tests without additional conditions into the pipeline"
1111
if are_conditions_met_mandatory_tests; then
1212
cat > $pipelineName <<- YAML
1313
1414
steps:
1515
- group: "Auditbeat Mandatory Testing"
16-
key: "mandatory-tests"
16+
key: "mandatory-tests"
1717
1818
steps:
1919
- label: ":ubuntu: Unit Tests"
20-
command:
21-
- ".buildkite/auditbeat/scripts/unit-tests.sh"
20+
command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
2221
notify:
2322
- github_commit_status:
2423
context: "Auditbeat: linux/Unit Tests"
2524
agents:
2625
provider: "gcp"
2726
image: "${IMAGE_UBUNTU_X86_64}"
2827
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
29-
artifact_paths:
30-
- "auditbeat/build/*.xml"
31-
- "auditbeat/build/*.json"
28+
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
3229
3330
- label: ":rhel: Unit Tests"
34-
command:
35-
- ".buildkite/auditbeat/scripts/unit-tests.sh"
31+
command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
3632
notify:
3733
- github_commit_status:
3834
context: "Auditbeat: rhel/Unit Tests"
3935
agents:
4036
provider: "gcp"
4137
image: "${IMAGE_RHEL9}"
4238
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
43-
artifact_paths:
44-
- "auditbeat/build/*.xml"
45-
- "auditbeat/build/*.json"
39+
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
4640
4741
- label: ":windows:-2016 Unit Tests"
48-
command: ".buildkite/scripts/win_unit_tests.ps1"
42+
key: "windows-2016"
43+
command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
4944
notify:
5045
- github_commit_status:
51-
context: "Auditbeat: windows 2016/Unit Tests"
46+
context: "Auditbeat: windows-2016/Unit Tests"
5247
agents:
5348
provider: "gcp"
5449
image: "${IMAGE_WIN_2016}"
5550
machine_type: "${GCP_WIN_MACHINE_TYPE}"
5651
disk_size: 200
57-
disk_type: "pd-ssd"
58-
artifact_paths:
59-
- "auditbeat/build/*.xml"
60-
- "auditbeat/build/*.json"
52+
disk_type: "pd-ssd"
53+
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
6154
6255
- label: ":windows:-2022 Unit Tests"
63-
command: ".buildkite/scripts/win_unit_tests.ps1"
56+
key: "windows-2022"
57+
command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
6458
notify:
6559
- github_commit_status:
66-
context: "Auditbeat: windows 2022/Unit Tests"
60+
context: "Auditbeat: windows-2022/Unit Tests"
6761
agents:
6862
provider: "gcp"
6963
image: "${IMAGE_WIN_2022}"
7064
machine_type: "${GCP_WIN_MACHINE_TYPE}"
7165
disk_size: 200
72-
disk_type: "pd-ssd"
73-
artifact_paths:
74-
- "auditbeat/build/*.xml"
75-
- "auditbeat/build/*.json"
66+
disk_type: "pd-ssd"
67+
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
7668
7769
- label: ":linux: Crosscompile"
7870
command:
79-
- ".buildkite/auditbeat/scripts/crosscompile.sh"
71+
- "make -C auditbeat crosscompile"
8072
env:
8173
GOX_FLAGS: "-arch amd64"
8274
notify:
@@ -94,89 +86,126 @@ fi
9486

9587
echo "Check and add the Extended Tests into the pipeline"
9688

97-
if are_conditions_met_arm_tests; then
89+
if are_conditions_met_arm_tests || are_conditions_met_macos_tests; then
9890
cat >> $pipelineName <<- YAML
91+
9992
- group: "Extended Tests"
100-
key: "extended-tests-arm"
93+
key: "extended-tests"
10194
steps:
102-
- label: ":arm: ARM64 Unit Tests"
103-
key: "extended-arm64-unit-tests"
104-
command: ".buildkite/scripts/unit_tests.sh"
95+
96+
YAML
97+
fi
98+
99+
if are_conditions_met_macos_tests; then
100+
cat >> $pipelineName <<- YAML
101+
102+
- label: ":mac: MacOS Unit Tests"
103+
key: "macos-unit-tests-extended"
104+
command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
105+
notify:
106+
- github_commit_status:
107+
context: "Auditbeat: MacOS Unit Tests"
105108
agents:
106-
provider: "gcp"
107-
image: "${IMAGE_UBUNTU_ARM64}"
108-
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
109+
provider: "orka"
110+
imagePrefix: "${IMAGE_MACOS_X86_64}"
109111
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
112+
113+
- label: ":mac: MacOS ARM Unit Tests"
114+
key: "macos-arm64-unit-tests-extended"
115+
command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
116+
notify:
117+
- github_commit_status:
118+
context: "Auditbeat: MacOS ARM Unit Tests"
119+
agents:
120+
provider: "orka"
121+
imagePrefix: "${IMAGE_MACOS_ARM}"
122+
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
123+
124+
YAML
125+
fi
126+
127+
if are_conditions_met_arm_tests; then
128+
cat >> $pipelineName <<- YAML
129+
- label: ":linux: ARM Ubuntu Unit Tests"
130+
key: "extended-arm64-unit-test"
131+
command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
110132
notify:
111133
- github_commit_status:
112-
context: "Auditbeat: ARM Unit tests"
134+
context: "Auditbeat: Unit Tests ARM"
135+
agents:
136+
provider: "aws"
137+
imagePrefix: "${AWS_IMAGE_UBUNTU_ARM_64}"
138+
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
139+
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
140+
113141
YAML
114142
fi
115143

116144
if are_conditions_met_win_tests; then
117145
cat >> $pipelineName <<- YAML
118146
- group: "Windows Extended Testing"
119147
key: "extended-tests-win"
148+
120149
steps:
121-
- label: ":windows: Windows 2019 Unit Tests"
122-
key: "extended-win-2019-unit-tests"
123-
command: ".buildkite/scripts/win_unit_tests.ps1"
150+
- label: ":windows:-2019 Unit Tests"
151+
key: "windows-2019-extended"
152+
command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
153+
notify:
154+
- github_commit_status:
155+
context: "Auditbeat: Win-2019 Unit Tests"
124156
agents:
125157
provider: "gcp"
126158
image: "${IMAGE_WIN_2019}"
127159
machine_type: "${GCP_WIN_MACHINE_TYPE}"
128-
disk_size: 100
160+
disk_size: 200
129161
disk_type: "pd-ssd"
130162
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
163+
164+
- label: ":windows:-11 Unit Tests"
165+
key: "windows-11-extended"
166+
command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
131167
notify:
132168
- github_commit_status:
133-
context: "Auditbeat: Windows 2019 Unit Tests"
134-
135-
- label: ":windows: Windows 10 Unit Tests"
136-
key: "extended-win-10-unit-tests"
137-
command: ".buildkite/scripts/win_unit_tests.ps1"
169+
context: "Auditbeat: Win-11 Unit Tests"
138170
agents:
139171
provider: "gcp"
140-
image: "${IMAGE_WIN_10}"
172+
image: "${IMAGE_WIN_11}"
141173
machine_type: "${GCP_WIN_MACHINE_TYPE}"
142-
disk_size: 100
174+
disk_size: 200
143175
disk_type: "pd-ssd"
144176
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
177+
178+
- label: ":windows:-10 Unit Tests"
179+
key: "windows-10-extended"
180+
command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
145181
notify:
146182
- github_commit_status:
147-
context: "Auditbeat: Windows 10 Unit Tests"
148-
149-
- label: ":windows: Windows 11 Unit Tests"
150-
key: "extended-win-11-unit-tests"
151-
command: ".buildkite/scripts/win_unit_tests.ps1"
183+
context: "Auditbeat: Win-10 Unit Tests"
152184
agents:
153185
provider: "gcp"
154-
image: "${IMAGE_WIN_11}"
186+
image: "${IMAGE_WIN_10}"
155187
machine_type: "${GCP_WIN_MACHINE_TYPE}"
156-
disk_size: 100
188+
disk_size: 200
157189
disk_type: "pd-ssd"
158190
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
159-
notify:
160-
- github_commit_status:
161-
context: "Auditbeat: Windows 11 Unit Tests"
162191
YAML
163192
fi
164193

165194
echo "Check and add the Packaging into the pipeline"
166195
if are_conditions_met_packaging; then
167196
cat >> $pipelineName <<- YAML
168197
- group: "Packaging"
169-
key: "packaging"
198+
key: "packaging"
170199
depends_on:
171200
- "mandatory-tests"
201+
172202
steps:
173203
- label: Package pipeline
174204
commands: ".buildkite/scripts/packaging/package-step.sh"
175205
notify:
176206
- github_commit_status:
177207
context: "Auditbeat: Packaging"
178208
179-
180209
YAML
181210
fi
182211

.buildkite/auditbeat/scripts/crosscompile.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

.buildkite/auditbeat/scripts/unit-tests.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
11
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
22

3+
env:
4+
IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204"
5+
GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16"
6+
37
steps:
4-
- label: "Example test"
5-
command: echo "Hello!"
8+
- label: "Checks"
9+
command: ".buildkite/deploy/kubernetes/scripts/make.sh"
10+
if: build.env("BUILDKITE_PULL_REQUEST") != "false" && build.env("GITHUB_PR_LABELS") == "kubernetes"
11+
notify:
12+
- github_commit_status:
13+
context: "Deploy K8S/Checks"
14+
agents:
15+
provider: "gcp"
16+
image: "${IMAGE_UBUNTU_X86_64}"
17+
machineType: "${GCP_HI_PERF_MACHINE_TYPE}"
18+
19+
- label: "K8S Test/K8S version: v1.29.0"
20+
key: "k8s-test-129"
21+
env:
22+
K8S_VERSION: "v1.29.0"
23+
commands:
24+
- "MODULE=kubernetes make -C metricbeat integration-tests"
25+
- "make -C deploy/kubernetes test"
26+
agents:
27+
provider: "gcp"
28+
image: "${IMAGE_UBUNTU_X86_64}"
29+
machineType: "${GCP_HI_PERF_MACHINE_TYPE}"
30+
31+
- label: "K8S Test/K8S version: v1.28.0"
32+
key: "k8s-test-128"
33+
env:
34+
K8S_VERSION: "v1.28.0"
35+
commands:
36+
- "MODULE=kubernetes make -C metricbeat integration-tests"
37+
- "make -C deploy/kubernetes test"
38+
agents:
39+
provider: "gcp"
40+
image: "${IMAGE_UBUNTU_X86_64}"
41+
machineType: "${GCP_HI_PERF_MACHINE_TYPE}"
42+
43+
- label: "K8S Test/K8S version: v1.27.3"
44+
key: "k8s-test-1273"
45+
env:
46+
K8S_VERSION: "v1.27.3"
47+
commands:
48+
- "MODULE=kubernetes make -C metricbeat integration-tests"
49+
- "make -C deploy/kubernetes test"
50+
agents:
51+
provider: "gcp"
52+
image: "${IMAGE_UBUNTU_X86_64}"
53+
machineType: "${GCP_HI_PERF_MACHINE_TYPE}"
54+
55+
- label: "K8S Test/K8S version: v1.26.6"
56+
key: "k8s-test-1266"
57+
env:
58+
K8S_VERSION: "v1.26.6"
59+
commands:
60+
- "MODULE=kubernetes make -C metricbeat integration-tests"
61+
- "make -C deploy/kubernetes test"
62+
agents:
63+
provider: "gcp"
64+
image: "${IMAGE_UBUNTU_X86_64}"
65+
machineType: "${GCP_HI_PERF_MACHINE_TYPE}"

0 commit comments

Comments
 (0)