Skip to content

Commit

Permalink
Merge pull request #25 from huanggze/master
Browse files Browse the repository at this point in the history
fluentbit supports nodeSelector
  • Loading branch information
Benjamin Huo authored Aug 24, 2020
2 parents 41542bb + f4d31d6 commit 3cbf894
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 6 deletions.
27 changes: 27 additions & 0 deletions Dockerfile.migrator
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Build the manager binary
FROM golang:1.13 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# Copy the go source
COPY cmd/migrator/main.go main.go
COPY api/ api/
COPY pkg/ pkg/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o migrator main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/migrator .
USER nonroot:nonroot

ENTRYPOINT ["/migrator"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Success!

## API Doc

The listing below shows supported plugins currently. It is based on Fluent Bit v1.5.0. For more information, see API docs of each plugin.
The listing below shows supported plugins currently. It is based on Fluent Bit v1.4.6. For more information, see API docs of each plugin.

- [Input](docs/crd.md#input)
- [dummy](docs/plugins/input/dummy.md)
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha2/fluentbit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type FluentBitSpec struct {
PositionDB corev1.VolumeSource `json:"positionDB,omitempty"`
// Container log path
ContainerLogRealPath string `json:"containerLogRealPath,omitempty"`
// NodeSelector
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// Tolerations
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// Fluentbitconfig object associated with this Fluentbit
Expand Down
7 changes: 7 additions & 0 deletions api/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions config/crd/bases/logging.kubesphere.io_fluentbits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ spec:
imagePullPolicy:
description: Fluent Bit image pull policy.
type: string
nodeSelector:
additionalProperties:
type: string
description: NodeSelector
type: object
positionDB:
description: Storage for position db. You will use it if tail input
is enabled.
Expand Down
1 change: 1 addition & 0 deletions docs/crd.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ FluentBitSpec defines the desired state of FluentBit
| imagePullPolicy | Fluent Bit image pull policy. | corev1.PullPolicy |
| positionDB | Storage for position db. You will use it if tail input is enabled. | [corev1.VolumeSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#volume-v1-core) |
| containerLogRealPath | Container log path | string |
| nodeSelector | NodeSelector | map[string]string |
| tolerations | Tolerations | [][corev1.Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#toleration-v1-core) |
| fluentBitConfigName | Fluentbitconfig object associated with this Fluentbit | string |
| secrets | The Secrets are mounted into /fluent-bit/secrets/<secret-name>. | []string |
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/go-logr/logr v0.1.0
github.com/go-openapi/errors v0.19.2
github.com/joho/godotenv v1.3.0
github.com/json-iterator/go v1.1.8
github.com/oklog/run v1.1.0
github.com/onsi/ginkgo v1.10.3
github.com/onsi/gomega v1.7.1
Expand All @@ -15,5 +16,6 @@ require (
k8s.io/api v0.17.2
k8s.io/apimachinery v0.17.2
k8s.io/client-go v0.16.4
k8s.io/klog v1.0.0
sigs.k8s.io/controller-runtime v0.4.0
)
4 changes: 2 additions & 2 deletions manifests/logging-stack/fluentbit-fluentBit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
namespace: kubesphere-logging-system
labels:
app.kubernetes.io/name: fluent-bit
app.kubernetes.io/version: v1.5.0
app.kubernetes.io/version: v1.4.6
spec:
image: kubespheredev/fluent-bit:v1.5.0
image: kubespheredev/fluent-bit:v1.4.6
positionDB:
emptyDir: {}
fluentBitConfigName: fluent-bit-config
Expand Down
4 changes: 2 additions & 2 deletions manifests/quick-start/fluentbit-fluentBit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: kubesphere-logging-system
labels:
app.kubernetes.io/name: fluent-bit
app.kubernetes.io/version: v1.5.0
app.kubernetes.io/version: v1.4.6
spec:
image: kubespheredev/fluent-bit:v1.5.0
image: kubespheredev/fluent-bit:v1.4.6
fluentBitConfigName: fluent-bit-config
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ spec:
imagePullPolicy:
description: Fluent Bit image pull policy.
type: string
nodeSelector:
additionalProperties:
type: string
description: NodeSelector
type: object
positionDB:
description: Storage for position db. You will use it if tail input
is enabled.
Expand Down
3 changes: 2 additions & 1 deletion pkg/operator/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ func MakeDaemonSet(fb v1alpha2.FluentBit, logPath string) appsv1.DaemonSet {
},
},
},
Tolerations: fb.Spec.Tolerations,
NodeSelector: fb.Spec.NodeSelector,
Tolerations: fb.Spec.Tolerations,
},
},
},
Expand Down

0 comments on commit 3cbf894

Please sign in to comment.