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

Add helm values to configure hostNetwork and additional env vars #1878

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

tobiasgiese
Copy link
Member

@tobiasgiese tobiasgiese commented Sep 17, 2024

We have to run our NFD workers in the host network. Also we need additional env variables such as KUBERNETES_SERVICE_HOST and _PORT. To achieve this we can simply add generic helm values. The default behavior is not changed.

Also exposed all container ports because hostNetwork need this information, see

❯ k explain pod.spec.hostNetwork
[...]
DESCRIPTION:
    Host networking requested for this pod. Use the host's network namespace. If
    this option is set, the ports that will be used must be specified. Default
    to false.

out-of-scope: will make the health port configurable in a follow-up PR to be able to run all daemonsets in the host's network namespace (i.e., avoid port conflicts)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 17, 2024
Copy link

netlify bot commented Sep 17, 2024

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit af0592b
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/66eaf8c8f7927800081bcfa0
😎 Deploy Preview https://deploy-preview-1878--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 17, 2024
@@ -478,6 +482,8 @@ topologyUpdater:
enable: false
args: []
createCRDs: false
additionalEnvs: []
Copy link
Contributor

Choose a reason for hiding this comment

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

My only comment on this PR would be the name of this Var. maybe envs is just ok?

/assign @marquiz

Copy link
Member Author

@tobiasgiese tobiasgiese Sep 17, 2024

Choose a reason for hiding this comment

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

Also thought about this, but there are already envs in the container. The name additionalEnvs makes it more explicit that those are additional env vars IMO. Also okay to rename it to envs, no hard opinion here

Edit: but if we take a look at args it is the same; there are already args set but the helm value args is for additional arguments. Will rename it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, sorry about the hassle. I regret my original PR adding args. But now that's changed

@tobiasgiese tobiasgiese force-pushed the chart-without-cni branch 2 times, most recently from 221ce95 to b545d02 Compare September 17, 2024 13:17
Comment on lines 484 to 485
args: []
envs: []
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at this now, I'd prefer name extraEnvs.

I know envs is in line with args. I recall that I have myself added the args and I don't like the name 🙄. I'd suggest I rename that to extraArgs (in a separate PR) and you rename to extraEnvs in this PR.

WDYT?

Nevertheless,we need to document the new values in docs/deployment/helm.md

Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed to extraEnvs, rebased and updated the helm documentation

@tobiasgiese tobiasgiese force-pushed the chart-without-cni branch 3 times, most recently from 5861141 to 64ae839 Compare September 18, 2024 15:34
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 18, 2024
@k8s-ci-robot
Copy link
Contributor

@tobiasgiese: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-node-feature-discovery-build-image-cross-generic 64ae839 link true /test pull-node-feature-discovery-build-image-cross-generic

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 18, 2024
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 18, 2024
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Wouldn't we need this for nfd-gc, too?

We have to run our NFD workers in the host network.
Also we need additional env variables such as KUBERNETES_SERVICE_HOST and _PORT.
To achieve this we can simply add generic helm values. The default behavior is not changed.

Signed-off-by: Tobias Giese <[email protected]>
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Thank you @tobiasgiese for the improvement. This looks good to me, now
/assign @ArangoGutierrez

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 18, 2024
Copy link
Contributor

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 23, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 76881da39702170941dbb7922ead2421d162d726

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ArangoGutierrez, marquiz, tobiasgiese

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [ArangoGutierrez,marquiz]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ArangoGutierrez ArangoGutierrez mentioned this pull request Sep 23, 2024
14 tasks
@k8s-ci-robot k8s-ci-robot merged commit d858501 into kubernetes-sigs:master Sep 23, 2024
9 checks passed
@tobiasgiese tobiasgiese deleted the chart-without-cni branch September 23, 2024 07:18
@@ -55,11 +56,16 @@ spec:
name: grpc
- containerPort: {{ .Values.master.metricsPort | default "8081" }}
name: metrics
- containerPort: 8082
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to make this one configurable for the host network case ?

i.e also add cmdline flag since currently AFAIU value is fixed [1]

[1]

GrpcHealthPort = 8082

Copy link
Member Author

@tobiasgiese tobiasgiese Sep 23, 2024

Choose a reason for hiding this comment

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

See PR description :)

out-of-scope: will make the health port configurable in a follow-up PR to be able to run all daemonsets in the host's network namespace (i.e., avoid port conflicts)

Will create the PR in the next hour(s)

Copy link
Contributor

Choose a reason for hiding this comment

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

oh sorry :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Will be fixed in #1885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants