-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add flag to set CNI bin dir, and use it on gci nodes #32151
Conversation
Can a kubernetes member verify that this patch is reasonable to test? If so, please reply "ok to test". Regular contributors should join the org to skip this step. |
e35fae3
to
4503359
Compare
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
4503359
to
144f06c
Compare
CLAs look good, thanks! |
Oh, one question: the default for NetworkPluginDir is in |
@@ -147,7 +147,9 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) { | |||
fs.Int32Var(&s.LowDiskSpaceThresholdMB, "low-diskspace-threshold-mb", s.LowDiskSpaceThresholdMB, "The absolute free disk space, in MB, to maintain. When disk space falls below this threshold, new pods would be rejected. Default: 256") | |||
fs.DurationVar(&s.VolumeStatsAggPeriod.Duration, "volume-stats-agg-period", s.VolumeStatsAggPeriod.Duration, "Specifies interval for kubelet to calculate and cache the volume disk usage for all pods and volumes. To disable volume calculations, set to 0. Default: '1m'") | |||
fs.StringVar(&s.NetworkPluginName, "network-plugin", s.NetworkPluginName, "<Warning: Alpha feature> The name of the network plugin to be invoked for various events in kubelet/pod lifecycle") | |||
fs.StringVar(&s.NetworkPluginDir, "network-plugin-dir", s.NetworkPluginDir, "<Warning: Alpha feature> The full path of the directory in which to search for network plugins") | |||
fs.StringVar(&s.NetworkPluginDir, "network-plugin-dir", s.NetworkPluginDir, "<Warning: Alpha feature> The full path of the directory in which to search for network plugins or CNI config") |
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.
You probably want to mark it deprecated...
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.
That would only be appropriate for the CNI usage of the flag; there is another meaning for non-CNI plugins.
Maybe non-CNI plugins should be deprecated, but that's another conversation.
I think you also need to run |
OK, have run that and checked in the resulting changes. Thanks! |
@@ -147,7 +147,9 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) { | |||
fs.Int32Var(&s.LowDiskSpaceThresholdMB, "low-diskspace-threshold-mb", s.LowDiskSpaceThresholdMB, "The absolute free disk space, in MB, to maintain. When disk space falls below this threshold, new pods would be rejected. Default: 256") | |||
fs.DurationVar(&s.VolumeStatsAggPeriod.Duration, "volume-stats-agg-period", s.VolumeStatsAggPeriod.Duration, "Specifies interval for kubelet to calculate and cache the volume disk usage for all pods and volumes. To disable volume calculations, set to 0. Default: '1m'") | |||
fs.StringVar(&s.NetworkPluginName, "network-plugin", s.NetworkPluginName, "<Warning: Alpha feature> The name of the network plugin to be invoked for various events in kubelet/pod lifecycle") | |||
fs.StringVar(&s.NetworkPluginDir, "network-plugin-dir", s.NetworkPluginDir, "<Warning: Alpha feature> The full path of the directory in which to search for network plugins") | |||
fs.StringVar(&s.NetworkPluginDir, "network-plugin-dir", s.NetworkPluginDir, "<Warning: Alpha feature> The full path of the directory in which to search for network plugins or CNI config") | |||
fs.StringVar(&s.CNIConfDir, "cni-conf-dir", s.CNIConfDir, "<Warning: Alpha feature> The full path of the directory in which to search for CNI config files") |
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.
Could we include the default values for these options? Most of the other options have them listed.
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.
Sure; any views on my question about which file the default should be implemented in?
I feel like the defaults should be left up to each plugin type, either exec or CNI. I think that was just an omission in Rajat's original CNI branch. I don't think a kubelet global default is really appropriate here, since different plugins have different conventions. So maybe remove the default from defaults.go and put it into exec.go? Edit: that said, I think we can do CNI defaults in the Flags() calls though, since these are obviously CNI specific. I just meant that the non-CNI defualt dir, which is left-over from exec, should be moved out of defaults.go and into exec.go somewhere, and --network-plugin-dir would be left without a default value, which each plugin could fill in by itself. |
Also make clearer the function of --network-plugin-dir when using CNI
I think you have to run |
Thanks. LGTM. assuming tests will pass. |
GCE e2e build/test passed for commit 8a69683. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 8a69683. |
Automatic merge from submit-queue |
Automatic merge from submit-queue Add flag to set CNI bin dir, and use it on gci nodes **What this PR does / why we need it**: When using `kube-up` on GCE, following kubernetes#31023 which moved the workers from debian to gci, CNI just isn't working. The root cause is basically as discussed in kubernetes#28563: one flag (`--network-plugin-dir`) means two different things, and the `configure-helper` script uses it for the wrong purpose. This PR adds a new flag `--cni-bin-dir`, then uses it to configure CNI as desired. As discussed at kubernetes#28563, I have also added a flag `--cni-conf-dir` so users can be explicit **Which issue this PR fixes** : fixes kubernetes#28563 **Special notes for your reviewer**: I left the old flag largely alone for backwards-compatibility, with the exception that I stop setting the default when CNI is in use. The value of `"/usr/libexec/kubernetes/kubelet-plugins/net/exec/"` is unlikely to be what is wanted there. **Release note**: ```release-note Added new kubelet flags `--cni-bin-dir` and `--cni-conf-dir` to specify where CNI files are located. Fixed CNI configuration on GCI platform when using CNI. ``` (cherry picked from commit c4893df)
Commit found in the "release-1.4" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
New default (for k8s 1.4) set by this PR kubernetes/kubernetes#32151
Automatic merge from submit-queue Add flag to set CNI bin dir, and use it on gci nodes **What this PR does / why we need it**: When using `kube-up` on GCE, following kubernetes#31023 which moved the workers from debian to gci, CNI just isn't working. The root cause is basically as discussed in kubernetes#28563: one flag (`--network-plugin-dir`) means two different things, and the `configure-helper` script uses it for the wrong purpose. This PR adds a new flag `--cni-bin-dir`, then uses it to configure CNI as desired. As discussed at kubernetes#28563, I have also added a flag `--cni-conf-dir` so users can be explicit **Which issue this PR fixes** : fixes kubernetes#28563 **Special notes for your reviewer**: I left the old flag largely alone for backwards-compatibility, with the exception that I stop setting the default when CNI is in use. The value of `"/usr/libexec/kubernetes/kubelet-plugins/net/exec/"` is unlikely to be what is wanted there. **Release note**: ```release-note Added new kubelet flags `--cni-bin-dir` and `--cni-conf-dir` to specify where CNI files are located. Fixed CNI configuration on GCI platform when using CNI. ``` (cherry picked from commit c4893df)
As per kubernetes/kubernetes#32151, kubelet doesn't search for CNI configs in /usr/libexec/kubernetes/kubelet-plugins/net/exec/ by default anymore. Signed-off-by: Martynas Pumputis <martynas@covalent.io>
As per kubernetes/kubernetes#32151, kubelet doesn't search for CNI configs in /usr/libexec/kubernetes/kubelet-plugins/net/exec/ by default anymore. Signed-off-by: Martynas Pumputis <m@lambda.lt>
As per kubernetes/kubernetes#32151, kubelet doesn't search for CNI configs in /usr/libexec/kubernetes/kubelet-plugins/net/exec/ by default anymore. Signed-off-by: Martynas Pumputis <m@lambda.lt>
As per kubernetes/kubernetes#32151, kubelet doesn't search for CNI configs in /usr/libexec/kubernetes/kubelet-plugins/net/exec/ by default anymore. Signed-off-by: Martynas Pumputis <m@lambda.lt>
As per kubernetes/kubernetes#32151, kubelet doesn't search for CNI configs in /usr/libexec/kubernetes/kubelet-plugins/net/exec/ by default anymore. Signed-off-by: Martynas Pumputis <m@lambda.lt>
What this PR does / why we need it:
When using
kube-up
on GCE, following #31023 which moved the workers from debian to gci, CNI just isn't working. The root cause is basically as discussed in #28563: one flag (--network-plugin-dir
) means two different things, and theconfigure-helper
script uses it for the wrong purpose.This PR adds a new flag
--cni-bin-dir
, then uses it to configure CNI as desired.As discussed at #28563, I have also added a flag
--cni-conf-dir
so users can be explicitWhich issue this PR fixes : fixes #28563
Special notes for your reviewer:
I left the old flag largely alone for backwards-compatibility, with the exception that I stop setting the default when CNI is in use. The value of
"/usr/libexec/kubernetes/kubelet-plugins/net/exec/"
is unlikely to be what is wanted there.Release note:
This change is