Skip to content

Updated virtual-kubelet-configuration file to handle podCIDR#25

Open
Bianco95 wants to merge 3 commits into
mainfrom
24-missing-podcidr-in-virtual-kubelet-configuration-template-file
Open

Updated virtual-kubelet-configuration file to handle podCIDR#25
Bianco95 wants to merge 3 commits into
mainfrom
24-missing-podcidr-in-virtual-kubelet-configuration-template-file

Conversation

@Bianco95

@Bianco95 Bianco95 commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

Added

PodCIDR:
      Subnet: {{ .Values.virtualNode.podCIDR.subnet }}
      MinIP: {{ .Values.virtualNode.podCIDR.minIP }}
      MaxIP: {{ .Values.virtualNode.podCIDR.maxIP }}

and put a commented example in values.yaml

@Bianco95 Bianco95 requested a review from dciangot as a code owner July 3, 2025 09:00
@Bianco95 Bianco95 linked an issue Jul 3, 2025 that may be closed by this pull request
@dciangot

dciangot commented Jul 4, 2025

Copy link
Copy Markdown
Member

Cannot merge, what happens when no values are specified? I'm afraid the deployment will fail

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds optional PodCIDR configuration to the virtual-kubelet ConfigMap template, and documents how to set it via Helm values.

Changes:

  • Render a PodCIDR section in InterLinkConfig.yaml when virtualNode.podCIDR is provided.
  • Add a commented podCIDR example block to values.yaml for discoverability.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
interlink/values.yaml Adds a commented podCIDR example for chart users.
interlink/templates/virtual-kubelet-config.yaml Conditionally emits PodCIDR fields into the generated InterLinkConfig.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread interlink/values.yaml
Comment on lines +67 to +70
# podCIDR:
# subnet: 10.42.122.0/24
# minIP: 2
# maxIP: 250

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

The commented podCIDR example is currently indented under virtualNode.resources, but the template reads .Values.virtualNode.podCIDR. If users uncomment this as-is, the chart will not render the PodCIDR config. Move the example to be a sibling of resources (same indentation as HTTPProxies/HTTP).

Suggested change
# podCIDR:
# subnet: 10.42.122.0/24
# minIP: 2
# maxIP: 250
# podCIDR:
# subnet: 10.42.122.0/24
# minIP: 2
# maxIP: 250

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +63
{{- if .Values.virtualNode.podCIDR }}
PodCIDR:
Subnet: {{ .Values.virtualNode.podCIDR.subnet }}
MinIP: {{ .Values.virtualNode.podCIDR.minIP }}
MaxIP: {{ .Values.virtualNode.podCIDR.maxIP }}
{{- end }}

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

This block only checks that virtualNode.podCIDR exists, but it will still render Subnet/MinIP/MaxIP as <no value> if any sub-keys are missing (e.g., podCIDR: {} or partially specified values), which can produce an invalid YAML config for the consumer. Consider switching to with on podCIDR (empty maps evaluate false) and/or guarding/requiring the individual fields before rendering them; also quoting Subnet would align with the rest of the template’s string handling.

Suggested change
{{- if .Values.virtualNode.podCIDR }}
PodCIDR:
Subnet: {{ .Values.virtualNode.podCIDR.subnet }}
MinIP: {{ .Values.virtualNode.podCIDR.minIP }}
MaxIP: {{ .Values.virtualNode.podCIDR.maxIP }}
{{- end }}
{{- with .Values.virtualNode.podCIDR }}
{{- if and .subnet .minIP .maxIP }}
PodCIDR:
Subnet: {{ .subnet | quote }}
MinIP: {{ .minIP | quote }}
MaxIP: {{ .maxIP | quote }}
{{- end }}
{{- end }}

Copilot uses AI. Check for mistakes.
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.

Missing PodCIDR in virtual kubelet configuration template file

3 participants