diff --git a/deploy/kubernetes/Makefile b/deploy/kubernetes/Makefile index 166c83bf515..d05b6a88683 100644 --- a/deploy/kubernetes/Makefile +++ b/deploy/kubernetes/Makefile @@ -1,4 +1,5 @@ ALL=filebeat metricbeat auditbeat heartbeat +IMAGE_MODIFIER?="-wolfi" BEAT_VERSION=$(shell head -n 1 ../../libbeat/docs/version.asciidoc | cut -c 17- ) .PHONY: all $(ALL) @@ -6,21 +7,27 @@ BEAT_VERSION=$(shell head -n 1 ../../libbeat/docs/version.asciidoc | cut -c 17- 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 diff --git a/deploy/kubernetes/auditbeat-kubernetes.yaml b/deploy/kubernetes/auditbeat-kubernetes.yaml index dc868a4f418..53dcc3a382e 100644 --- a/deploy/kubernetes/auditbeat-kubernetes.yaml +++ b/deploy/kubernetes/auditbeat-kubernetes.yaml @@ -209,7 +209,7 @@ spec: dnsPolicy: ClusterFirstWithHostNet containers: - name: auditbeat - image: docker.elastic.co/beats/auditbeat:8.16.0 + image: docker.elastic.co/beats/auditbeat-wolfi:8.16.0 args: [ "-c", "/etc/auditbeat.yml", "-e", diff --git a/deploy/kubernetes/auditbeat/auditbeat-daemonset.yaml b/deploy/kubernetes/auditbeat/auditbeat-daemonset.yaml index 39eaf726eef..39a2c35c3f1 100644 --- a/deploy/kubernetes/auditbeat/auditbeat-daemonset.yaml +++ b/deploy/kubernetes/auditbeat/auditbeat-daemonset.yaml @@ -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", diff --git a/deploy/kubernetes/filebeat-kubernetes.yaml b/deploy/kubernetes/filebeat-kubernetes.yaml index 15a733e53d6..b9765f3d529 100644 --- a/deploy/kubernetes/filebeat-kubernetes.yaml +++ b/deploy/kubernetes/filebeat-kubernetes.yaml @@ -183,7 +183,7 @@ spec: dnsPolicy: ClusterFirstWithHostNet containers: - name: filebeat - image: docker.elastic.co/beats/filebeat:8.16.0 + image: docker.elastic.co/beats/filebeat-wolfi:8.16.0 args: [ "-c", "/etc/filebeat.yml", "-e", diff --git a/deploy/kubernetes/filebeat/filebeat-daemonset.yaml b/deploy/kubernetes/filebeat/filebeat-daemonset.yaml index b6df8f31fdb..c027abede2a 100644 --- a/deploy/kubernetes/filebeat/filebeat-daemonset.yaml +++ b/deploy/kubernetes/filebeat/filebeat-daemonset.yaml @@ -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", diff --git a/deploy/kubernetes/heartbeat-kubernetes.yaml b/deploy/kubernetes/heartbeat-kubernetes.yaml index 15c8e521d29..735e984ad82 100644 --- a/deploy/kubernetes/heartbeat-kubernetes.yaml +++ b/deploy/kubernetes/heartbeat-kubernetes.yaml @@ -171,7 +171,7 @@ spec: dnsPolicy: ClusterFirstWithHostNet containers: - name: heartbeat - image: docker.elastic.co/beats/heartbeat:8.16.0 + image: docker.elastic.co/beats/heartbeat-wolfi:8.16.0 args: [ "-c", "/etc/heartbeat.yml", "-e", diff --git a/deploy/kubernetes/heartbeat/heartbeat-deployment.yaml b/deploy/kubernetes/heartbeat/heartbeat-deployment.yaml index 3f1a73d3324..ec95e50ee53 100644 --- a/deploy/kubernetes/heartbeat/heartbeat-deployment.yaml +++ b/deploy/kubernetes/heartbeat/heartbeat-deployment.yaml @@ -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", diff --git a/deploy/kubernetes/metricbeat-kubernetes.yaml b/deploy/kubernetes/metricbeat-kubernetes.yaml index ab119ff490c..41b300ba9b1 100644 --- a/deploy/kubernetes/metricbeat-kubernetes.yaml +++ b/deploy/kubernetes/metricbeat-kubernetes.yaml @@ -291,7 +291,7 @@ spec: dnsPolicy: ClusterFirstWithHostNet containers: - name: metricbeat - image: docker.elastic.co/beats/metricbeat:8.16.0 + image: docker.elastic.co/beats/metricbeat-wolfi:8.16.0 args: [ "-c", "/etc/metricbeat.yml", "-e", diff --git a/deploy/kubernetes/metricbeat/metricbeat-daemonset.yaml b/deploy/kubernetes/metricbeat/metricbeat-daemonset.yaml index c4004d91e28..e8c0074be6d 100644 --- a/deploy/kubernetes/metricbeat/metricbeat-daemonset.yaml +++ b/deploy/kubernetes/metricbeat/metricbeat-daemonset.yaml @@ -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",