-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Injection: enable support for automatic detection of native sidecars #49570
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,9 +217,25 @@ var ( | |
EnableOptimizedServicePush = env.RegisterBoolVar("ISTIO_ENABLE_OPTIMIZED_SERVICE_PUSH", true, | ||
"If enabled, Istiod will not push changes on arbitrary annotation change.").Get() | ||
|
||
// This is used in injection templates, it is not unused. | ||
EnableNativeSidecars = env.Register("ENABLE_NATIVE_SIDECARS", false, | ||
"If set, used Kubernetes native Sidecar container support. Requires SidecarContainer feature flag.") | ||
EnableNativeSidecars = func() NativeSidecarMode { | ||
v := env.Register("ENABLE_NATIVE_SIDECARS", "false", | ||
"If set, used Kubernetes native Sidecar container support. Requires SidecarContainer feature flag."+ | ||
" Set to true or false to unconditionally enable. Set to auto-beta or auto-stable to automatically enable"+ | ||
" if support is detected (at the beta or stable level).").Get() | ||
switch v { | ||
case "never", "false": | ||
return NativeSidecarModeNever | ||
case "always", "true": | ||
return NativeSidecarModeAlways | ||
case "auto-beta": | ||
Comment on lines
+225
to
+230
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From my perspective this is not improve UX, on the opposite it is increasing complexity There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean auto-beta auto-stable, rare people can distinguish them There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would rather it just be |
||
return NativeSidecarModeAutoBeta | ||
case "auto-stable": | ||
return NativeSidecarModeAutoStable | ||
default: | ||
log.Warnf("unknown ENABLE_NATIVE_SIDECARS value %q", v) | ||
return NativeSidecarModeNever | ||
} | ||
}() | ||
|
||
OptimizedConfigRebuild = env.Register("ENABLE_OPTIMIZED_CONFIG_REBUILD", true, | ||
"If enabled, pilot will only rebuild config for resources that have changed").Get() | ||
|
@@ -228,3 +244,16 @@ var ( | |
"If enabled, istiod will persist the oldest first heuristic for subtly conflicting traffic policy selection"+ | ||
"(such as with overlapping wildcard hosts)").Get() | ||
) | ||
|
||
type NativeSidecarMode int | ||
|
||
const ( | ||
// Never use native sidecar | ||
NativeSidecarModeNever NativeSidecarMode = iota | ||
// Always use native sidecar | ||
NativeSidecarModeAlways = iota | ||
// AutoBeta will use native sidecars if its detected as supported at a beta+ stability level | ||
NativeSidecarModeAutoBeta = iota | ||
// AutoStable will use native sidecars if its detected as supported at a stable stability level | ||
NativeSidecarModeAutoStable = iota | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you articulate why we need both
auto-beta
andauto-stable
versus justauto
?That feels like a lot of knobs for a single feature (admittedly it's a critical one), and also I don't think it makes a lot of sense to have feature-level logic for opting-in depending on stability level - that should/will be defined elsewhere and can be implicit in
auto
.(Yes I realize this means people who are using pure stable will not use this. That's probably fine?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually I think the default should be
auto-stable
. We should not default to beta k8s features, only stable ones IMO. So the possible one to remove isauto-beta
IMO.The benefit of auto-beta is that a lot of users do want to use beta k8s features, and its IMO pretty reasonable to. So what they get is a bit of safety in doing that, rather than just
on
.Most of the complexity is in the detection anyways, beta vs stable is pretty simple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just do
never
,always
andauto
for now?Whether
auto
should ignore k8s beta features or not probably should be controlled globally by e.g. @whitneygriffith'sexperimental/stable
profiles and implicit in that (if you are inistio stable
you do not get to usek8s experimental
stuff, and if you are inistio experimental
you do, it is not per-feature), and not at the feature level.