Skip to content

added support to use resources defined in values file#82

Merged
benjaminhuo merged 7 commits into
fluent:masterfrom
navneet066:patch-1
Jul 12, 2021
Merged

added support to use resources defined in values file#82
benjaminhuo merged 7 commits into
fluent:masterfrom
navneet066:patch-1

Conversation

@navneet066

Copy link
Copy Markdown
Contributor

in the current version, This is using the hardcoded values of resources here in this file. Calling the values of resources defined on the values.yaml file to the fluentbit-operator-deployment.yaml

in the current version, This is using the hardcoded values of resources here in this file. Calling the values of `resources` defined on the values.yaml file to the `fluentbit-operator-deployment.yaml`
@benjaminhuo

Copy link
Copy Markdown
Member

@navneet066 Thanks for the PR, the resources in values are for the fluentbit daemonset.
The resources for FluentBit Operator itself needn't to be configurable

@navneet066

Copy link
Copy Markdown
Contributor Author

I see. I think we should have the flexibility to modify resources for the operator also. If you are agreeing to this, we can add the resources section for fluentbit-operator deployment in values.yaml file. Please let me know your thoughts.

@benjaminhuo

Copy link
Copy Markdown
Member

The resources consumed by the operator usually keep consistent actually, so it's ok to use default values for that.
Of course you can also add them to values.

The values could be adjust like below:

fluentbit:
  # Fluent Bit resources. User can adjust it based on the log volume.
  resources:
     limits:
       cpu: 500m
       memory: 200Mi
     requests:
       cpu: 10m
       memory: 25Mi

operator:
  # FluentBit operator resources. Usually user needn't to adjust these.
  resources:
    limits:
      cpu: 200m
      memory: 50Mi
  requests:
    cpu: 100m
    memory: 20Mi

@navneet066

Copy link
Copy Markdown
Contributor Author

Yes. Usually, it is really low. But when the number of nodes in the K8S is high, say 100 or so, It may generate more pressure on the fluentbit-operator. Thanks for the snippet. Shall I add this to the file and update the PR?

@benjaminhuo

benjaminhuo commented Jul 9, 2021

Copy link
Copy Markdown
Member

Yes. Usually, it is really low. But when the number of nodes in the K8S is high, say 100 or so, It may generate more pressure on the fluentbit-operator. Thanks for the snippet. Shall I add this to the file and update the PR?

the fluentbit-operator just needs to reconcile several crds like FluentBit FluentBitConfig Input parser filter and output no matter how many nodes there actually.

Yes, you can add this to values and update the PR

@navneet066

Copy link
Copy Markdown
Contributor Author

Made the corresponding changes @benjaminhuo . Please have a review and let me know if any other changes are required

@benjaminhuo

Copy link
Copy Markdown
Member

@wanjunlei @wenchajun Please help to review this

@wenchajun

wenchajun commented Jul 11, 2021

Copy link
Copy Markdown
Member

Maybe you should check the format,such as resources (fluentbit-operator-deployment.yaml), fluentbit.resources.limit (values.yaml ). Please modify its format. Two spaces may be better.

@navneet066

Copy link
Copy Markdown
Contributor Author

Thank you for your suggestion @wenchajun . I updated the changes as per your comment.

@wanjunlei wanjunlei self-requested a review July 12, 2021 03:04
@wenchajun

Copy link
Copy Markdown
Member

Thanks a lot. But there's still something wrong here. You can learn more about the toyaml function. such as operator.requests (chart/fluentbit-operator/values.yaml). It is wrong.

requests:
cpu: 100m
memory: 20Mi
{{ toYaml .Values.resources.operator | indent 12 }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe {{ toYaml .Values.resources.operator.resources | nindent 10 }} is better.

path: /var/lib/fluent-bit/
resources:
{{- toYaml .Values.resources | nindent 4 }}
{{- toYaml .Values.resources.fluentbit | nindent 4 }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This line may need to be modified

Comment thread chart/fluentbit-operator/values.yaml Outdated
memory: 50Mi
requests:
cpu: 100m
memory: 20Mi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Invalid format

@navneet066

Copy link
Copy Markdown
Contributor Author

@wenchajun I have made the changes as per the review. Sorry for the iterations. It should be fine now

@benjaminhuo benjaminhuo merged commit 781135b into fluent:master Jul 12, 2021
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.

4 participants