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

istio-cni - use templated env from cm, simplify config #51050

Merged
merged 4 commits into from
May 17, 2024

Conversation

bleggett
Copy link
Contributor

@bleggett bleggett commented May 15, 2024

Please provide a description of this PR:
Our handling of istio-cni config is rather backwards - this attempts to decruftify it a bit.

  • Use envFrom
  • Actually use the configmap for config
  • Don't rely on configmap-based JSON blobs for CNI plugin config , when the structure of those blobs cannot be directly user configurable.
  • Don't rely on an external JSON template and string-replace - just use the actual struct from the actual plugin, using the actual cni libraries.

Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
@bleggett bleggett requested review from a team as code owners May 15, 2024 00:32
@istio-policy-bot istio-policy-bot added area/ambient Issues related to ambient mesh area/networking labels May 15, 2024
@istio-testing istio-testing added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 15, 2024
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
@bleggett
Copy link
Contributor Author

/retest-required

2 similar comments
@zirain
Copy link
Member

zirain commented May 15, 2024

/retest-required

@zirain
Copy link
Member

zirain commented May 15, 2024

/retest-required

Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
@bleggett bleggett force-pushed the bleggett/cni-config-cleanup branch from 1269a6c to bc501fc Compare May 15, 2024 15:41
@bleggett bleggett added area/networking/cni Istio CNI-related issues and removed area/networking labels May 15, 2024
Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

I didn't look too closely yet but seems like a good direction

@bleggett bleggett force-pushed the bleggett/cni-config-cleanup branch from 0549f54 to 09909a3 Compare May 16, 2024 23:23
@bleggett bleggett requested a review from howardjohn May 16, 2024 23:24
@bleggett bleggett force-pushed the bleggett/cni-config-cleanup branch 2 times, most recently from 55c977c to d2e18f8 Compare May 16, 2024 23:26
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
@bleggett bleggett force-pushed the bleggett/cni-config-cleanup branch from d2e18f8 to 0cf6736 Compare May 16, 2024 23:29
Copy link
Contributor

@ilrudie ilrudie left a comment

Choose a reason for hiding this comment

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

ran out of time so leaving a few minor comments now, so far it looks good though


b.WriteString("LogLevel: " + c.LogLevel + "\n")
b.WriteString("KubeconfigFilename: " + c.KubeconfigFilename + "\n")
b.WriteString("KubeconfigMode: " + fmt.Sprintf("%#o", c.KubeconfigMode) + "\n")
b.WriteString("KubeCAFile: " + c.KubeCAFile + "\n")
b.WriteString("SkipTLSVerify: " + fmt.Sprint(c.SkipTLSVerify) + "\n")

b.WriteString("ExcludeNamespaces: " + fmt.Sprint(c.ExcludeNamespaces) + "\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is K8sServiceAccountPath omitted on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorta. It's only override-able via unit tests so echoing it would just be noise.

// disable monitoring & repair
viper.Set(constants.MonitoringPort, 0)
viper.Set(constants.RepairEnabled, false)

// Don't set the CNI conf file env var if preConfFile is not set
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Don't set the CNI conf file env var if preConfFile is not set

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's still set but not an env var anymore.

cni/pkg/install/cniconfig.go Show resolved Hide resolved
@istio-testing istio-testing merged commit 1c56c05 into istio:master May 17, 2024
28 checks passed
@howardjohn
Copy link
Member

this broke old k8s versions (1.23 Nd 1.24) https://prow.istio.io/view/gs/istio-prow/logs/integ-k8s-123_istio_postsubmit/1791587628840128512

@bleggett
Copy link
Contributor Author

this broke old k8s versions (1.23 Nd 1.24) https://prow.istio.io/view/gs/istio-prow/logs/integ-k8s-123_istio_postsubmit/1791587628840128512

#51135 should fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ambient Issues related to ambient mesh area/networking/cni Istio CNI-related issues size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants