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

Optimize the helm chart #208

Merged
merged 1 commit into from Feb 23, 2022
Merged

Optimize the helm chart #208

merged 1 commit into from Feb 23, 2022

Conversation

wenchajun
Copy link
Member

Signed-off-by: chengdehao wenchajun@gmail.com


#Set this to containerd or crio if you want to collect CRI format logs
containerRuntime: docker
Kubernetes: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this Kubernetes used for?
this operator can only be used for k8s

fluentd:

fluentd:
enable: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need resources for fluentd as well, @zhu733756 do you have any suggest values?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need resources for fluentd as well, @zhu733756 do you have any suggest values?

I have some suggests below, totally lgtm.

#Set this to containerd or crio if you want to collect CRI format logs
containerRuntime: docker
Kubernetes: false

operator:
image: "kubesphere/fluent-operator"
Copy link
Member

@zhu733756 zhu733756 Feb 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested to

initcontainer:
   image: xx
   tag: xx 
container:
   image: xxx
   tag: xxx

Or I think initcontainer can hard code in yaml.

forward:
enable: false
host: "fluentd.kubesphere-logging-system.svc"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does have anyway to keep host equals with fluentd.name,like host: "{fluentd.name}.kubesphere-logging-system.svc", Or this forward is determined by the fluentd section is enough?

name: flentd
port: 24224
image: "kubesphere/fluentd"
tag: "v1.14.4"
Copy link
Member

@zhu733756 zhu733756 Feb 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repo and tag always under the same field named image.
like :

image:
  repository: ""
  tag: ""

- kube-system
- kubesphere-monitoring-system
#Configure the output plugin parameter in FluentBit.
#You can set enable to true to output logs to the specified location.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment here should fix.

initcontainer:
image: "docker"
tag: "19.03"
container:
image: "kubesphere/fluent-operator"
Copy link
Member

@zhu733756 zhu733756 Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image here suggested to the field repository. I think image means repository+ tag.

@@ -202,6 +202,26 @@ If your container runtime is `cri-o`
helm upgrade fluentbit-operator --create-namespace -n kubesphere-logging-system charts/fluent-operator/ --set Kubernetes=true,containerRuntime=crio
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fluentbit-operator => fluent-operator

forward:
enable: false
host: "fluentd.kubesphere-logging-system.svc"
host: "kubesphere-logging-system.svc"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable: false should keep.

forward:
enable: false
host: "fluentd.kubesphere-logging-system.svc"
host: "kubesphere-logging-system.svc"
Copy link
Member

@zhu733756 zhu733756 Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think host and port should be removed and only defined in fluentd part. We should keep host and port defined in one place. Besides, forward.enabled to enable or disable the function of fluentd is enough.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do u guys think of? @benjaminhuo @wenchajun

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forward logs to fluentd should be controlled by the fluentd switch, and should be in the fluentd part.

Copy link
Member

@zhu733756 zhu733756 Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I almost get it. Fluentd can enable by its switch for other requirements. And logs from Fluent Bit forwarding to fluentd would use two switches.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that the forward profile is controlled by fluentd.enable and no dedicated forward profile is being set up. Is this right?

Copy link
Member

@zhu733756 zhu733756 Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If suggested to remove Fluentbit forward part and needs some docs to implement this case. User's confusion about the forward plugin can be defined to other fluentds. In addition, one fluentd activated, there must be one service, the docs also should implement this case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fluentbit forwarding to fluentd is only required when fluentd is enabled and there is requirements to receive logs from fluentbit. Fluentd can also receive logs from non-fluentd source such as HTTP or syslog

No need to add fluentbit forward CR in fluentbit configs because you don't know if the fluentd is enabled in fluentbit config.

@@ -112,19 +112,19 @@ Fluent Bit Operator supports `docker` as well as `containerd` and `CRI-O`. `cont
If your container runtime is `docker`

```shell
helm install fluentbit-operator --create-namespace -n kubesphere-logging-system charts/fluent-operator/ --set containerRuntime=docker
helm install fluent-operator --create-namespace -n kubesphere-logging-system charts/fluent-operator/ --set containerRuntime=docker
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namespace should use an env variable to set before any helm install cmd, and reference this env in the following helm install cmd

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

helm does not initially support the environment variable approach for security reasons. Please see:helm/helm#944 . helm3 can use set to set environment variables. But I don't think there is much difference between this way and the previous one. Perhaps we could create a namespace.yaml file and change its namespace by setting the value in value.yaml?

Copy link
Member

@zhu733756 zhu733756 Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use {{ .Release.Namespace }} to tell the CRs what's namespace the helm used?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, maybe we needn't change the namespace as a helm parameter.
My concern is this is a community project now, the kubesphere namespace is not appropriate anymore.

We might need to use a namespace like fluent for readme, helm, YAML and samples
@wenchajun you can do this in another PR and @zhu733756 can help to review

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK,I will revise and test as soon as possible

Signed-off-by: chengdehao <wenchajun@gmail.com>
@benjaminhuo benjaminhuo merged commit 0a7e3dd into fluent:master Feb 23, 2022
@wenchajun wenchajun deleted the fix branch March 3, 2022 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants