Skip to content

Conversation

DrAuYueng
Copy link
Contributor

@DrAuYueng DrAuYueng commented Sep 8, 2025

Description

When kubelet specifies a hostname using the hostname-override parameter, for example: --hostname-override=192.168.0.10, the result will be different from the result obtained by the hostname command.
This means that the endpointHostnameFilter will filter out node-related event processing.
In this scenario, the hostname needs to be explicitly defined using the environment variable HOSTNAME.
In the calico-node daemonset yaml file, HOSTNAME can be defined using the following configuration:

        - name: HOSTNAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName

Related issues/PRs

Todos

  • Tests
  • Documentation
  • Release note

Release Note

Override hostname with determined nodename by default in CalculationGraph init.

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

@DrAuYueng DrAuYueng requested a review from a team as a code owner September 8, 2025 09:29
@marvin-tigera marvin-tigera added this to the Calico v3.31.0 milestone Sep 8, 2025
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Sep 8, 2025
@DrAuYueng DrAuYueng changed the title Override with HOSTNAME env var if set when hostname-override parameter specified in kubelet [Felix] Override with HOSTNAME env var if set when hostname-override parameter specified in kubelet Sep 8, 2025
@mazdakn
Copy link
Member

mazdakn commented Sep 9, 2025

/sem-approve

@DrAuYueng
Copy link
Contributor Author

The CI failure seems to be unrelated to the current PR. Is there something I missed?

@mazdakn
Copy link
Member

mazdakn commented Sep 10, 2025

@DrAuYueng no, it's not related to this PR. it's a known issue, and we are working to fix it.
I'm going to review the PR tomorrow.

@DrAuYueng
Copy link
Contributor Author

The hostname can be specified through the environment variable FELIX_FELIXHOSTNAME, configured as follows:

- name: FELIX_FELIXHOSTNAME
  valueFrom:
    fieldRef:
      apiVersion: v1
      fieldPath: spec.nodeName

, but I hope that automatic detection and processing can be done by default, after all, cni-plugin and calico node startup both do similar processing.

@DrAuYueng DrAuYueng changed the title [Felix] Override with HOSTNAME env var if set when hostname-override parameter specified in kubelet [Felix] Override hostname with determined nodename by default in CalculationGraph init Sep 17, 2025
@mazdakn
Copy link
Member

mazdakn commented Sep 19, 2025

@DrAuYueng I do not understand the motivation here. Felix is a process inside Calico node, and it is node's responsibility to auto detect hostname and pass it to Felix (which seems it does).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-pr-required Change is not yet documented release-note-required Change has user-facing impact (no matter how small)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants