Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3b52f2a
ignore .cache and .claude
cw-Guo May 15, 2026
45cf1ca
clean the cert-manager related setup
cw-Guo May 15, 2026
ce4b4d2
clean the manager config
cw-Guo May 15, 2026
d8e33b0
clean the network-policy config
cw-Guo May 15, 2026
51cb5d0
move the systemd.lua script to logging-stack
cw-Guo May 15, 2026
59987ed
fix the role generation
cw-Guo May 15, 2026
3f43f6a
improve manifests generate
cw-Guo May 15, 2026
497972b
remove the not in use webhook files
cw-Guo May 15, 2026
cd6e2e0
update config to reflect the production manifest
cw-Guo May 15, 2026
7a40d95
generate setup.yaml based on config
cw-Guo May 15, 2026
cf230ec
fix release-tool based on the latest layout
cw-Guo May 15, 2026
fe5b4fe
enable the leader election and namespace creation
cw-Guo May 15, 2026
9a969b1
fix the missing rbac
cw-Guo May 15, 2026
4a9b5a2
use nonroot user
cw-Guo May 15, 2026
c378f6e
support multi-arch build
cw-Guo May 15, 2026
7cd754e
fix missing rbac roles
cw-Guo May 16, 2026
638d9be
resolve comments
cw-Guo May 20, 2026
05517f2
fix comments
cw-Guo May 20, 2026
3917fb7
remove namespace object
cw-Guo May 23, 2026
2840188
fix shellcheck
cw-Guo May 23, 2026
65d2398
remove namespace
cw-Guo May 23, 2026
d456520
remove empty release-tool.yaml
cw-Guo May 23, 2026
eb4acb7
fix make install and uninstall
cw-Guo May 23, 2026
504b64a
use make manifest to verify crd and add instructions to create namesp…
cw-Guo May 23, 2026
6929971
fix make run
cw-Guo May 23, 2026
2fde44a
add namespace and comments
cw-Guo May 23, 2026
a3d2aa8
enable secure metrics endpoint
cw-Guo May 23, 2026
f39ab63
clean up config: align labels, fix metrics selectors, drop stale RBAC
cw-Guo May 23, 2026
526d9e4
add namespace environment variable back
cw-Guo May 26, 2026
fa548d2
Merge branch 'master' into feat/clean-config
cw-Guo May 27, 2026
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ testbin/
.DS_Store
.envrc
charts/fluent-operator.tgz

.cache
.claude
31 changes: 18 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ SHELL = /usr/bin/env bash -o pipefail

VERSION ?= $(shell cat version.txt | tr -d " \t\n\r")
FB_VERSION?=$(shell grep -v '^#' cmd/fluent-watcher/fluentbit/VERSION | tr -d " \t\n\r")
FD_VERSION?=$(shell grep -v '^#' cmd/fluent-watcher/fluentd/VERSION | tr -d " \t\n\r")
# Image URL to use all building/pushing image targets
FB_IMG ?= ghcr.io/fluent/fluent-operator/fluent-bit:v${FB_VERSION}
FB_IMG_DEBUG ?= ghcr.io/fluent/fluent-operator/fluent-bit:v${FB_VERSION}-debug
FD_IMG ?= ghcr.io/fluent/fluent-operator/fluentd:v1.19.2
FO_IMG ?= kubesphere/fluent-operator:$(VERSION)
FD_IMG ?= ghcr.io/fluent/fluent-operator/fluentd:v${FD_VERSION}
FO_IMG ?= ghcr.io/fluent/fluent-operator/fluent-operator:$(VERSION)

ARCH ?= arm64

Expand Down Expand Up @@ -51,16 +52,20 @@ help: ## Display this help.
shellcheck:
@find . -type f -name *.sh -exec docker run --rm -v $(shell pwd):/mnt koalaman/shellcheck:stable {} +

MANIFEST_PATHS := ./apis/fluentbit/...;./apis/fluentd/...;./controllers/...

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentbit/..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentd/..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentbit/..." output:crd:artifacts:config=charts/fluent-operator/crds
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentd/..." output:crd:artifacts:config=charts/fluent-operator/crds
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentbit/..." output:crd:artifacts:config=charts/fluent-operator-fluent-bit-crds/templates
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentd/..." output:crd:artifacts:config=charts/fluent-operator-fluentd-crds/templates
kubectl kustomize config/crd/bases/ | sed -e '/creationTimestamp/d' > manifests/setup/fluent-operator-crd.yaml
kubectl kustomize manifests/setup/ | sed -e '/creationTimestamp/d' > manifests/setup/setup.yaml
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=fluent-operator webhook \
paths="$(MANIFEST_PATHS)" \
output:crd:artifacts:config=config/crd/bases
Comment thread
cw-Guo marked this conversation as resolved.
Comment thread
cw-Guo marked this conversation as resolved.
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="$(MANIFEST_PATHS)" \
output:crd:artifacts:config=charts/fluent-operator/crds
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./apis/fluentbit/...;./controllers/..." \
output:crd:artifacts:config=charts/fluent-operator-fluent-bit-crds/templates
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./apis/fluentd/...;./controllers/..." \
output:crd:artifacts:config=charts/fluent-operator-fluentd-crds/templates
kubectl kustomize config/default/ | sed -e '/creationTimestamp/d' > manifests/setup/setup.yaml
hack/mutate-crds.sh

.PHONY: generate
Expand Down Expand Up @@ -135,7 +140,7 @@ build: generate fmt vet ## Build manager binary.
go build -o bin/fd-watcher ./cmd/fluent-watcher/fluentd

run: manifests generate fmt vet ## Run a controller from your host.
go run cmd/fluent-manager/main.go
go run ./cmd/fluent-manager/

# Build amd64/arm64 Fluent Operator container image
.PHONY: build-op
Expand Down Expand Up @@ -200,10 +205,10 @@ push-amd64:
##@ Deployment

install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd/bases/ | kubectl create -f -
$(KUSTOMIZE) build config/crd/ | kubectl create -f -

uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd/bases/ | kubectl delete -f -
$(KUSTOMIZE) build config/crd/ | kubectl delete -f -

deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
kubectl create -f manifests/setup/setup.yaml
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Kubernetes v1.16.13+ is necessary for running Fluent Operator.
Install the latest stable version

```shell
kubectl create namespace fluent
kubectl apply -f https://github.com/fluent/fluent-operator/releases/latest/download/setup.yaml

# You can change the namespace in manifests/setup/kustomization.yaml
Expand All @@ -143,6 +144,7 @@ kubectl apply -f https://github.com/fluent/fluent-operator/releases/latest/downl
Install the development version

```shell
kubectl create namespace fluent
kubectl apply -f https://raw.githubusercontent.com/fluent/fluent-operator/master/manifests/setup/setup.yaml

# You can change the namespace in manifests/setup/kustomization.yaml
Expand Down
2 changes: 1 addition & 1 deletion cmd/fluent-manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
USER nonroot:nonroot
USER 65532:65532

ENTRYPOINT ["/manager"]
20 changes: 0 additions & 20 deletions config/certmanager/certificate-metrics.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions config/certmanager/certificate-webhook.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions config/certmanager/issuer.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions config/certmanager/kustomization.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions config/certmanager/kustomizeconfig.yaml

This file was deleted.

66 changes: 0 additions & 66 deletions config/crd/bases/kustomization.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions config/crd/bases/kustomizeconfig.yaml

This file was deleted.

77 changes: 29 additions & 48 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,56 +1,37 @@
# This kustomization.yaml is not intended to be run by itself,
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
# resources:
# - bases/fluentbit.fluent.io_fluentbitconfigs.yaml
# - bases/fluentbit.fluent.io_fluentbits.yaml
# - bases/fluentbit.fluent.io_inputs.yaml
# - bases/fluentbit.fluent.io_filters.yaml
# - bases/fluentbit.fluent.io_outputs.yaml
# - bases/fluentbit.fluent.io_parsers.yaml
# - bases/fluentd.fluent.io_fluentds.yaml
# - bases/fluentd.fluent.io_clusterfluentdconfigs.yaml
# - bases/fluentd.fluent.io_fluentdconfigs.yaml
# - bases/fluentd.fluent.io_clusterfilters.yaml
# - bases/fluentd.fluent.io_filters.yaml
# - bases/fluentd.fluent.io_outputs.yaml
# - bases/fluentd.fluent.io_clusteroutputs.yaml
#+kubebuilder:scaffold:crdkustomizeresource
resources:
- bases/fluentbit.fluent.io_clusterfluentbitconfigs.yaml
- bases/fluentbit.fluent.io_fluentbits.yaml
- bases/fluentbit.fluent.io_clusterinputs.yaml
- bases/fluentbit.fluent.io_clusterfilters.yaml
- bases/fluentbit.fluent.io_clustermultilineparsers.yaml
- bases/fluentbit.fluent.io_clusteroutputs.yaml
- bases/fluentbit.fluent.io_clusterparsers.yaml
- bases/fluentbit.fluent.io_collectors.yaml
- bases/fluentbit.fluent.io_fluentbitconfigs.yaml
- bases/fluentbit.fluent.io_filters.yaml
- bases/fluentbit.fluent.io_multilineparsers.yaml
- bases/fluentbit.fluent.io_outputs.yaml
- bases/fluentbit.fluent.io_parsers.yaml
- bases/fluentd.fluent.io_fluentds.yaml
- bases/fluentd.fluent.io_clusterfluentdconfigs.yaml
- bases/fluentd.fluent.io_fluentdconfigs.yaml
- bases/fluentd.fluent.io_filters.yaml
- bases/fluentd.fluent.io_clusterinputs.yaml
- bases/fluentd.fluent.io_inputs.yaml
- bases/fluentd.fluent.io_clusterfilters.yaml
- bases/fluentd.fluent.io_outputs.yaml
- bases/fluentd.fluent.io_clusteroutputs.yaml
# +kubebuilder:scaffold:crdkustomizeresource

# patchesStrategicMerge:
#patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
# - patches/webhook_in_fluentbitconfigs.yaml
# - patches/webhook_in_fluentbits.yaml
# - patches/webhook_in_inputs.yaml
# - patches/webhook_in_filters_fluentbit.yaml
# - patches/webhook_in_outputs_fluentbit.yaml
# - patches/webhook_in_parsers.yaml
# - patches/webhook_in_fluentds.yaml
# - patches/webhook_in_clusterfluentdconfigs.yaml
# - patches/webhook_in_fluentdconfigs.yaml
# - patches/webhook_in_clusterfilters.yaml
# - patches/webhook_in_clusteroutputs.yaml
# - patches/webhook_in_filters_fluentd.yaml
# - patches/webhook_in_outputs_fluentd.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch

# [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
# - patches/cainjection_in_fluentbitconfigs.yaml
# - patches/cainjection_in_fluentbits.yaml
# - patches/cainjection_in_inputs.yaml
# - patches/cainjection_in_filters_fluentbit.yaml
# - patches/cainjection_in_outputs_fluentbit.yaml
# - patches/cainjection_in_parsers.yaml
# - patches/cainjection_in_fluentds.yaml
# - patches/cainjection_in_clusterfluentdconfigs.yaml
# - patches/cainjection_in_fluentdconfigs.yaml
# - patches/cainjection_in_clusterfilters.yaml
# - patches/cainjection_in_clusteroutputs.yaml
# - patches/cainjection_in_filters_fluentd.yaml
# - patches/cainjection_in_outputs_fluentd.yamlpatch
# +kubebuilder:scaffold:crdkustomizewebhookpatch

# [WEBHOOK] To enable webhook, uncomment the following section
# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
- kustomizeconfig.yaml
#configurations:
#- kustomizeconfig.yaml
16 changes: 0 additions & 16 deletions config/crd/patches/webhook_in_clusterfilters.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions config/crd/patches/webhook_in_clusterfluentdconfigs.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions config/crd/patches/webhook_in_clusteroutputs.yaml

This file was deleted.

Loading
Loading