Skip to content

Commit 6472cec

Browse files
authored
Merge pull request #1351 from kube-logging/release-4.2
release 4.2
2 parents bd9910c + abb654a commit 6472cec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+908
-1646
lines changed

.github/workflows/e2e.yaml

Lines changed: 75 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,52 @@ on:
99

1010
env:
1111
GO_VERSION: '1.20'
12-
KIND_VERSION: 'v0.17.0'
13-
KIND_NODE_VERSION: 'v1.23.13@sha256:ef453bb7c79f0e3caba88d2067d4196f427794086a7d0df8df4f019d5e336b61'
1412
KUBECTL_VERSION: 'v1.24.1'
1513

1614
jobs:
1715
build:
16+
name: Image build
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v2
24+
25+
- name: Build and export
26+
uses: docker/build-push-action@v4
27+
with:
28+
context: .
29+
tags: controller:local
30+
outputs: type=docker,dest=/tmp/controller.tar
31+
32+
- name: Upload artifact
33+
uses: actions/upload-artifact@v3
34+
with:
35+
name: controller
36+
path: /tmp/controller.tar
37+
38+
go:
1839
name: Go end2end tests
1940
runs-on: ubuntu-latest
41+
needs: build
2042

2143
steps:
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v2
46+
47+
- name: Download artifact
48+
uses: actions/download-artifact@v3
49+
with:
50+
name: controller
51+
path: /tmp
52+
53+
- name: Load image
54+
run: |
55+
docker load --input /tmp/controller.tar
56+
docker image ls -a
57+
2258
- name: Set up Go
2359
uses: actions/setup-go@v4
2460
with:
@@ -32,6 +68,9 @@ jobs:
3268
- name: Checkout code
3369
uses: actions/checkout@v3
3470

71+
- name: Make docker-build
72+
run: make docker-build
73+
3574
- name: Run e2e tests
3675
run: make test-e2e
3776

@@ -43,11 +82,26 @@ jobs:
4382
path: build/_test
4483
retention-days: 5
4584

46-
basic_flow:
85+
chart-minio:
4786
name: Shell script tests with chart install
4887
runs-on: ubuntu-latest
88+
needs: build
4989

5090
steps:
91+
- name: Set up Docker Buildx
92+
uses: docker/setup-buildx-action@v2
93+
94+
- name: Download artifact
95+
uses: actions/download-artifact@v3
96+
with:
97+
name: controller
98+
path: /tmp
99+
100+
- name: Load image
101+
run: |
102+
docker load --input /tmp/controller.tar
103+
docker image ls -a
104+
51105
- name: Set up Go
52106
uses: actions/setup-go@v4
53107
with:
@@ -58,41 +112,30 @@ jobs:
58112
with:
59113
version: ${{ env.KUBECTL_VERSION }}
60114

61-
- name: Set up KinD
62-
uses: engineerd/[email protected]
63-
with:
64-
version: "${{ env.KIND_VERSION }}"
65-
image: "kindest/node:${{ env.KIND_NODE_VERSION }}"
66-
67115
- name: Checkout code
68116
uses: actions/checkout@v3
69117

70-
- name: Stern
71-
run: make stern && test -x bin/stern
72-
73-
- name: Build controller image
74-
run: make docker-build IMG='controller:local'
118+
- name: Make docker-build
119+
run: make docker-build
75120

76-
- name: Build e2e fluentd image
77-
run: make docker-build-e2e-fluentd IMG='fluentd:local'
78-
79-
- name: Create logging namespace
80-
run: kubectl create namespace logging
81-
82-
- name: Start MinIO
83-
run: |
84-
kubectl create -f hack/minio.yaml
85-
kubectl wait --namespace logging --for=condition=available deployment/minio-deployment --timeout=120s
86-
minio="$(kubectl get pod --namespace logging -l app=minio -o 'jsonpath={.items[0].metadata.name}')"
87-
kubectl wait --namespace logging --for=condition=Ready pod "${minio}" --timeout=120s
121+
- name: Make setup
122+
run: make kind-cluster stern
88123

89-
- name: Setup MinIO CLI
124+
- name: Kubernetes setup
90125
run: |
91-
kubectl create -f hack/minio-mc.yaml
92-
kubectl wait --namespace logging --for=condition=available deployment/minio-mc-deployment --timeout=120s
93-
mc_pod="$(kubectl get pod --namespace logging -l app=minio-mc -o 'jsonpath={.items[0].metadata.name}')"
94-
kubectl wait --namespace logging --for=condition=Ready pod "${mc_pod}" --timeout=120s
95-
kubectl exec --namespace logging "${mc_pod}" -- \
126+
kubectl create namespace logging
127+
128+
kubectl create -n logging -f hack/minio.yaml
129+
kubectl wait -n logging --for=condition=available deployment/minio-deployment --timeout=120s
130+
minio="$(kubectl get pod -n logging -l app=minio -o 'jsonpath={.items[0].metadata.name}')"
131+
kubectl wait -n logging --for=condition=Ready pod "${minio}" --timeout=120s
132+
133+
kubectl create -n logging -f hack/minio-mc.yaml
134+
kubectl wait -n logging --for=condition=available deployment/minio-mc-deployment --timeout=120s
135+
mc_pod="$(kubectl get pod -n logging -l app=minio-mc -o 'jsonpath={.items[0].metadata.name}')"
136+
kubectl wait -n logging --for=condition=Ready pod "${mc_pod}" --timeout=120s
137+
138+
kubectl exec -n logging "${mc_pod}" -- \
96139
mc config host add minio \
97140
'http://minio-service.logging.svc.cluster.local:9000' \
98141
'minio_access_key' \

Makefile

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ DOCKER ?= docker
1111
GOVERSION = $(shell go env GOVERSION)
1212

1313
# Image name to use for building/pushing image targets
14-
IMG ?= controller:latest
14+
IMG ?= controller:local
1515

1616
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
1717
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false,maxDescLen=0"
@@ -23,7 +23,6 @@ VERSION := $(shell git describe --abbrev=0 --tags)
2323

2424
E2E_TEST_TIMEOUT ?= 20m
2525

26-
2726
CONTROLLER_GEN = ${BIN}/controller-gen
2827
CONTROLLER_GEN_VERSION = v0.6.0
2928

@@ -35,7 +34,9 @@ GOLANGCI_LINT := ${BIN}/golangci-lint
3534
GOLANGCI_LINT_VERSION := v1.51.2
3635

3736
KIND := ${BIN}/kind
38-
KIND_VERSION := v0.11.1
37+
KIND_VERSION := v0.19.0
38+
KIND_IMAGE := kindest/node:v1.23.17@sha256:f77f8cf0b30430ca4128cc7cfafece0c274a118cd0cdb251049664ace0dee4ff
39+
KIND_CLUSTER := kind
3940

4041
KUBEBUILDER := ${BIN}/kubebuilder
4142
KUBEBUILDER_VERSION = v3.1.0
@@ -70,14 +71,10 @@ deploy: manifests ## Deploy controller in the configured Kubernetes cluster in ~
7071

7172
.PHONY: docker-build
7273
docker-build: ## Build the docker image
73-
${DOCKER} build . -t ${IMG}
74+
docker image inspect ${IMG} && echo "docker image ${IMG} already built" || ${DOCKER} build . -t ${IMG}
7475
@echo "updating kustomize image patch file for manager resource"
7576
sed -i'' -e 's@image: .*@image: '"${IMG}"'@' ./config/default/manager_image_patch.yaml
7677

77-
.PHONY: docker-build-e2e-fluentd
78-
docker-build-e2e-fluentd: ## Build fluentd docker image
79-
${DOCKER} build ./fluentd-image/e2e-test -t ${IMG}
80-
8178
.PHONY: docker-build-drain-watch
8279
docker-build-drain-watch: ## Build the drain-watch docker image
8380
${DOCKER} build drain-watch-image -t ${DRAIN_WATCH_IMAGE_TAG_NAME}:${DRAIN_WATCH_IMAGE_TAG_VERSION}
@@ -103,10 +100,6 @@ generate: ${CONTROLLER_GEN} tidy ## Generate code
103100
cd pkg/sdk && $(CONTROLLER_GEN) object:headerFile=./../../hack/boilerplate.go.txt paths=./resourcebuilder/...
104101
cd pkg/sdk && go generate ./static
105102

106-
.PHONY: help
107-
help: ## Show this help message
108-
@grep -h -E '^[a-zA-Z0-9%_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | sort
109-
110103
.PHONY: install
111104
install: manifests ## Install CRDs into the cluster in ~/.kube/config
112105
kubectl create -f config/crd/bases || kubectl replace -f config/crd/bases
@@ -152,12 +145,18 @@ run: generate fmt vet ## Run against the configured Kubernetes cluster in ~/.kub
152145
test: generate fmt vet manifests ${ENVTEST_BINARY_ASSETS} ${KUBEBUILDER} ## Run tests
153146
cd pkg/sdk/logging && ENVTEST_BINARY_ASSETS=${ENVTEST_BINARY_ASSETS} go test ./...
154147
cd pkg/sdk/extensions && go test ./...
148+
cd pkg/sdk/logging/model/syslogng/config && go test ./...
155149
ENVTEST_BINARY_ASSETS=${ENVTEST_BINARY_ASSETS} go test ./controllers/logging/... ./pkg/... -coverprofile cover.out
156150
ENVTEST_BINARY_ASSETS=${ENVTEST_BINARY_ASSETS} go test ./controllers/extensions/... ./pkg/... -coverprofile cover.out
157151

158152
.PHONY: test-e2e
159153
test-e2e: ${KIND} docker-build generate fmt vet manifests stern ## Run E2E tests
160-
cd e2e && LOGGING_OPERATOR_IMAGE="${IMG}" PROJECT_DIR="$(PWD)" go test -v -timeout ${E2E_TEST_TIMEOUT} ./...
154+
cd e2e && \
155+
LOGGING_OPERATOR_IMAGE="${IMG}" \
156+
KIND_PATH="$(KIND)" \
157+
KIND_IMAGE="$(KIND_IMAGE)" \
158+
PROJECT_DIR="$(PWD)" \
159+
go test -v -timeout ${E2E_TEST_TIMEOUT} ./...
161160

162161
.PHONY: tidy
163162
tidy: ## Tidy Go modules
@@ -168,6 +167,10 @@ vet: ## Run go vet against code
168167
go vet ./...
169168
cd pkg/sdk && go vet ./...
170169

170+
.PHONY: kind-cluster
171+
kind-cluster: ${KIND}
172+
kind create cluster --name $(KIND_CLUSTER) --image $(KIND_IMAGE)
173+
171174
## =========================
172175
## == Tool dependencies ==
173176
## =========================
@@ -243,3 +246,9 @@ find ${BIN} -name '$(notdir ${IMPORT_PATH})_*' -exec rm {} +
243246
GOBIN=${BIN} go install ${IMPORT_PATH}@${VERSION}
244247
mv ${BIN}/$(notdir ${IMPORT_PATH}) $@
245248
endef
249+
250+
# Self-documenting Makefile
251+
.DEFAULT_GOAL = help
252+
.PHONY: help
253+
help: ## Show this help
254+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

config/crd/bases/logging.banzaicloud.io_loggings.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13660,6 +13660,13 @@ spec:
1366013660
type: object
1366113661
globalOptions:
1366213662
properties:
13663+
stats:
13664+
properties:
13665+
freq:
13666+
type: integer
13667+
level:
13668+
type: integer
13669+
type: object
1366313670
stats_freq:
1366413671
type: integer
1366513672
stats_level:

config/default/manager_image_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ spec:
88
spec:
99
containers:
1010
# Change the value of image field below to your controller image URL
11-
- image: controller:latest
11+
- image: controller:local
1212
name: manager

config/default/manager_image_patch.yaml-e

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ spec:
88
spec:
99
containers:
1010
# Change the value of image field below to your controller image URL
11-
- image: controller:latest
11+
- image: controller:local
1212
name: manager

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ spec:
2727
- /manager
2828
args:
2929
- --enable-leader-election
30-
image: controller:latest
30+
image: controller:local
3131
name: manager
3232
resources:
3333
limits:
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v2
22
type: application
33
name: logging-operator-logging
4-
version: 4.1.0
5-
kubeVersion: ">=1.16.0-0"
4+
version: 4.2.0
5+
kubeVersion: ">=1.22"
66
description: A Helm chart to configure logging resource for the Logging operator.
77
keywords:
88
- logging
@@ -18,14 +18,18 @@ annotations:
1818
description: Moved to to location
1919
artifacthub.io/images: |
2020
- name: fluent-bit
21-
image: fluent/fluent-bit:1.9.5
21+
image: fluent/fluent-bit:2.1.4
2222
- name: fluentd
23-
image: ghcr.io/kube-logging/fluentd:v1.15
23+
image: ghcr.io/kube-logging/fluentd:v1.15-ruby3
2424
- name: syslog-ng
25-
image: ghcr.io/axoflow/axosyslog:4.1.1
25+
image: ghcr.io/axoflow/axosyslog:4.2.0
2626
- name: logging-operator
27-
image: ghcr.io/kube-logging/logging-operator:4.0.0
27+
image: ghcr.io/kube-logging/logging-operator:4.2.0
2828
- name: config-reloader
29-
image: ghcr.io/kube-logging/config-reloader:v0.0.4
29+
image: ghcr.io/kube-logging/config-reloader:v0.0.5
3030
- name: node-exporter
31-
image: ghcr.io/kube-logging/node-exporter:v0.4.0
31+
image: ghcr.io/kube-logging/node-exporter:v0.6.1
32+
- name: syslog-ng-exporter
33+
image: ghcr.io/kube-logging/syslog-ng-exporter:v0.0.16
34+
- name: syslogng-reload
35+
image: ghcr.io/kube-logging/syslogng-reload:v1.3.1

e2e/charts/logging-operator-logging/templates/logging.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
{{- with .Values.flowConfigOverride }}
1818
flowConfigOverride: {{ . }}
1919
{{- end }}
20-
{{- if or .Values.tls.enabled .Values.fluentbit }}
20+
{{- if and (not .Values.fluentbitDisabled) (or .Values.tls.enabled .Values.fluentbit) }}
2121
fluentbit:
2222
{{- if .Values.tls.enabled }}
2323
tls:
@@ -29,7 +29,7 @@ spec:
2929
{{- toYaml . | nindent 4 }}
3030
{{- end }}
3131
{{- end }}
32-
{{- if or .Values.tls.enabled .Values.fluentd }}
32+
{{- if and (not .Values.fluentdDisabled) (or .Values.tls.enabled .Values.fluentd) }}
3333
fluentd:
3434
{{- if .Values.tls.enabled }}
3535
tls:

e2e/charts/logging-operator-logging/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ skipInvalidResources: false
3131
# -- Override generated config. This is a raw configuration string for troubleshooting purposes.
3232
flowConfigOverride: ""
3333

34+
# -- Flag to disable fluentbit completely
35+
fluentbitDisabled: false
3436
# -- Fluent-bit configurations https://kube-logging.github.io/docs/configuration/crds/v1beta1/fluentbit_types/
3537
fluentbit: {}
3638

39+
# -- Flag to disable fluentd completely
40+
fluentdDisabled: false
3741
# -- Fluentd configurations https://kube-logging.github.io/docs/configuration/crds/v1beta1/fluentd_types/
3842
fluentd: {}
3943
# 20Gi persistent storage is configured for fluentd by default.

e2e/charts/logging-operator/Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
apiVersion: v2
22
type: application
33
name: logging-operator
4-
version: 4.2.0
5-
appVersion: 4.1.0
6-
kubeVersion: ">=1.16.0-0"
4+
version: 4.2.1
5+
appVersion: 4.2.0
6+
kubeVersion: ">=1.22"
77
description: Logging operator for Kubernetes based on Fluentd and Fluentbit.
88
keywords:
99
- logging
@@ -19,4 +19,4 @@ annotations:
1919
description: Moved to to location
2020
artifacthub.io/images: |
2121
- name: logging-operator
22-
image: ghcr.io/kube-logging/logging-operator:4.0.0
22+
image: ghcr.io/kube-logging/logging-operator:4.2.0

0 commit comments

Comments
 (0)