Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x](backport #41222) Switch K8s tests to Wolfi by default and make it configurable #41237

Merged
merged 5 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions deploy/kubernetes/Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
ALL=filebeat metricbeat auditbeat heartbeat
IMAGE_MODIFIER?="-wolfi"
BEAT_VERSION=$(shell head -n 1 ../../libbeat/docs/version.asciidoc | cut -c 17- )

.PHONY: all $(ALL)

all: $(ALL)

test: all
for FILE in $(shell ls *-kubernetes.yaml); do \
BEAT=$$(echo $$FILE | cut -d \- -f 1); \
@for BEAT in $(ALL); do \
echo; \
echo "$$BEAT"; \
FILE="$$BEAT-kubernetes.yaml"; \
kubectl create -f $$FILE; \
echo "Testing $$BEAT container for readiness..."; \
kubectl wait pods -n kube-system -l k8s-app=$$BEAT --for=condition=Ready --timeout=90s; \
echo "Deleting $$BEAT..."; \
kubectl delete -f $$FILE; \
done

clean:
@for f in $(ALL); do rm -f "$$f-kubernetes.yaml"; done

$(ALL):
@echo "Generating $@-kubernetes.yaml"
@echo "Generating $@-kubernetes.yaml for version ${BEAT_VERSION} and image modifier '${IMAGE_MODIFIER}'"
@rm -f $@-kubernetes.yaml
@for f in service-account role role-binding configmap deployment daemonset ; do \
if [ -f "$@/$@-$$f.yaml" ]; then \
echo "file: $@/$@-$$f.yaml"; \
sed "s/%VERSION%/${BEAT_VERSION}/g" $@/$@-$$f.yaml >> $@-kubernetes.yaml; \
cat $@/$@-$$f.yaml | sed "s/%VERSION%/${BEAT_VERSION}/g" | sed "s/%IMAGE_MODIFIER%/${IMAGE_MODIFIER}/g" >> $@-kubernetes.yaml; \
echo --- >> $@-kubernetes.yaml; \
fi \
done
4 changes: 4 additions & 0 deletions deploy/kubernetes/auditbeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: auditbeat
<<<<<<< HEAD
image: docker.elastic.co/beats/auditbeat:8.16.0
=======
image: docker.elastic.co/beats/auditbeat-wolfi:9.0.0
>>>>>>> 3492089397 (Switch K8s tests to Wolfi by default and make it configurable (#41222))
args: [
"-c", "/etc/auditbeat.yml",
"-e",
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/auditbeat/auditbeat-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: auditbeat
image: docker.elastic.co/beats/auditbeat:%VERSION%
image: docker.elastic.co/beats/auditbeat%IMAGE_MODIFIER%:%VERSION%
args: [
"-c", "/etc/auditbeat.yml",
"-e",
Expand Down
4 changes: 4 additions & 0 deletions deploy/kubernetes/filebeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: filebeat
<<<<<<< HEAD
image: docker.elastic.co/beats/filebeat:8.16.0
=======
image: docker.elastic.co/beats/filebeat-wolfi:9.0.0
>>>>>>> 3492089397 (Switch K8s tests to Wolfi by default and make it configurable (#41222))
args: [
"-c", "/etc/filebeat.yml",
"-e",
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/filebeat/filebeat-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: filebeat
image: docker.elastic.co/beats/filebeat:%VERSION%
image: docker.elastic.co/beats/filebeat%IMAGE_MODIFIER%:%VERSION%
args: [
"-c", "/etc/filebeat.yml",
"-e",
Expand Down
4 changes: 4 additions & 0 deletions deploy/kubernetes/heartbeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: heartbeat
<<<<<<< HEAD
image: docker.elastic.co/beats/heartbeat:8.16.0
=======
image: docker.elastic.co/beats/heartbeat-wolfi:9.0.0
>>>>>>> 3492089397 (Switch K8s tests to Wolfi by default and make it configurable (#41222))
args: [
"-c", "/etc/heartbeat.yml",
"-e",
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/heartbeat/heartbeat-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: heartbeat
image: docker.elastic.co/beats/heartbeat:%VERSION%
image: docker.elastic.co/beats/heartbeat%IMAGE_MODIFIER%:%VERSION%
args: [
"-c", "/etc/heartbeat.yml",
"-e",
Expand Down
4 changes: 4 additions & 0 deletions deploy/kubernetes/metricbeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: metricbeat
<<<<<<< HEAD
image: docker.elastic.co/beats/metricbeat:8.16.0
=======
image: docker.elastic.co/beats/metricbeat-wolfi:9.0.0
>>>>>>> 3492089397 (Switch K8s tests to Wolfi by default and make it configurable (#41222))
args: [
"-c", "/etc/metricbeat.yml",
"-e",
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/metricbeat/metricbeat-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: metricbeat
image: docker.elastic.co/beats/metricbeat:%VERSION%
image: docker.elastic.co/beats/metricbeat%IMAGE_MODIFIER%:%VERSION%
args: [
"-c", "/etc/metricbeat.yml",
"-e",
Expand Down
Loading