Updated virtual-kubelet-configuration file to handle podCIDR#25
Updated virtual-kubelet-configuration file to handle podCIDR#25Bianco95 wants to merge 3 commits into
Conversation
|
Cannot merge, what happens when no values are specified? I'm afraid the deployment will fail |
…nto 24-missing-podcidr-in-virtual-kubelet-configuration-template-file
There was a problem hiding this comment.
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
PodCIDRsection inInterLinkConfig.yamlwhenvirtualNode.podCIDRis provided. - Add a commented
podCIDRexample block tovalues.yamlfor 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.
| # podCIDR: | ||
| # subnet: 10.42.122.0/24 | ||
| # minIP: 2 | ||
| # maxIP: 250 |
There was a problem hiding this comment.
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).
| # podCIDR: | |
| # subnet: 10.42.122.0/24 | |
| # minIP: 2 | |
| # maxIP: 250 | |
| # podCIDR: | |
| # subnet: 10.42.122.0/24 | |
| # minIP: 2 | |
| # maxIP: 250 |
| {{- if .Values.virtualNode.podCIDR }} | ||
| PodCIDR: | ||
| Subnet: {{ .Values.virtualNode.podCIDR.subnet }} | ||
| MinIP: {{ .Values.virtualNode.podCIDR.minIP }} | ||
| MaxIP: {{ .Values.virtualNode.podCIDR.maxIP }} | ||
| {{- end }} |
There was a problem hiding this comment.
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.
| {{- 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 }} |
Added
and put a commented example in values.yaml