-
Notifications
You must be signed in to change notification settings - Fork 114
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 disable plugins #569
Add disable plugins #569
Conversation
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 7744576897
💛 - Coveralls |
general question do we want to have this as part of SriovOperatorConfig CR instead of another env variable in the operator? :) |
im not sure, i see this decision (deciding if/which plugins to disable) is made during deployment time and should not change. moreover deleting sriov operator config CR will trigger creation of the default config which will have no plugins disabled by default which may be problematic. maybe we need to revisit the creation of default sriov operator config CR ? |
I am not fully familiar with helm but can't we request a CR also when we do the helm install? |
Even if the decision is not made, I also prefer to have it be part of the CR since that would cover more use cases. It feels cleaner. |
what other use-cases ? |
Suppose the customer decides that they want to disable some plugin, then at a later point in time, they change their mind. |
then IMO they need to redeploy. our (NVIDIA) use case that it should not change, depends on specific datacenter configuration, moreover accidently changing it may have catastrophic effect to workers (firmware parameters resetting). my concern is creating the default operator config obj in the operator. if you are ok with dropping its creation, we can set this in operator config CR. we discussed this in community meeting. Sebastian needs to double check internally. |
allowedDisablePlugins := map[string]struct{}{"mellanox": {}} | ||
for _, p := range startOpts.disabledPlugins { | ||
if _, ok := allowedDisablePlugins[p]; !ok { | ||
return fmt.Errorf("%s plugin is cannot be disabled", p) |
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.
nit: remove is
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.
ack
|
||
| Name | Type | Default | description | | ||
| ---- | ---- | ------- | ----------- | | ||
| `sriovConfigDaemon.disablePlugins` | []string | `nil` | List of plugins to disable, currently only `mellanox` plugin is allowed | |
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.
shouldn't we add "use-systemd" now that you're adding this?
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.
im not sure, that one can be configured during runtime.
this one is during deployment time.
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.
Right, didn't notice that this readme is for the helm chart
#sriovConfigDaemon: | ||
# disablePlugins: | ||
# - mellanox | ||
# - intel |
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.
remove intel?
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.
ack
@@ -43,6 +43,29 @@ import ( | |||
"github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/version" | |||
) | |||
|
|||
// stringList is a list of strings, implements pflag.Vaue interface |
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.
// stringList is a list of strings, implements pflag.Vaue interface | |
// stringList is a list of strings, implements pflag.Value interface |
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.
addressed will update PR soon
@@ -81,6 +106,14 @@ func runStartCmd(cmd *cobra.Command, args []string) error { | |||
startOpts.nodeName = name | |||
} | |||
|
|||
// TODO(adrianc): move allowed disable plugins to globals pkg | |||
allowedDisablePlugins := map[string]struct{}{"mellanox": {}} |
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.
allowedDisablePlugins
-> DisableablePlugins
WDYT?
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.
What about deactivatablePlugins
or activatablePlugins
if we switch to a positive instead (which is maybe better to avoid double negatives and have shorter names throughout).
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.
addressed, will upload PR soon
44a77c7
to
528b0c0
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
README.md
Outdated
configurations by the operator. | ||
|
||
This can be done by providing the names of plugins to disable as a comma separated list of strings via | ||
`SRIOV_NETWORK_CONFIG_DAEMON_DISABLE_PLUGINS` environment variable to the operator deployment or using |
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.
nit: I don't know what will be better, maybe _DISABLED_PLUGINS
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.
i prefer to keep it the same name as the flag (disable-plugins)
README.md
Outdated
defined for the particular environment. This will reduce or completely eliminate the need for reboot of nodes during SR-IOV | ||
configurations by the operator. | ||
|
||
This can be done by providing the names of plugins to disable as a comma separated list of strings via |
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.
nit: "comma-separated" here and below
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.
done.
@@ -66,6 +90,7 @@ func init() { | |||
startCmd.PersistentFlags().StringVar(&startOpts.kubeconfig, "kubeconfig", "", "Kubeconfig file to access a remote cluster (testing only)") | |||
startCmd.PersistentFlags().StringVar(&startOpts.nodeName, "node-name", "", "kubernetes node name daemon is managing") | |||
startCmd.PersistentFlags().BoolVar(&startOpts.systemd, "use-systemd-service", false, "use config daemon in systemd mode") | |||
startCmd.PersistentFlags().VarP(&startOpts.disabledPlugins, "disable-plugins", "", "comma separated list of plugins") |
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.
comma separated => comma-separated
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.
done
+1 on this. this option isn't supposed to be changed during runtime |
528b0c0
to
59ddaa9
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
@SchSeba PTAL |
please rebase LGTM |
prevK8sPluginFn := K8sPlugin | ||
|
||
BeforeEach(func() { | ||
vars.ClusterType = consts.ClusterTypeKubernetes |
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.
nit: can you reset global variables to its origin value?
vars.ClusterType = consts.ClusterTypeKubernetes | |
backupClusterType := vars.ClusterType | |
vars.ClusterType = consts.ClusterTypeKubernetes | |
DeferCleanup(func() { | |
vars.ClusterType = backupClusterType | |
}) |
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.
ack.
api/v1/sriovoperatorconfig_types.go
Outdated
@@ -45,6 +45,8 @@ type SriovOperatorConfigSpec struct { | |||
ConfigurationMode ConfigurationModeType `json:"configurationMode,omitempty"` | |||
// Flag to enable Container Device Interface mode for SR-IOV Network Device Plugin | |||
UseCDI bool `json:"useCDI,omitempty"` | |||
// DisablePlugins is a list of sriov-network-config-daemon plugins to disable | |||
DisablePlugins []string `json:"disablePlugins,omitempty"` |
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 can add a validation at the api level
// +kubebuilder:validation:Enum={"mellanox"}
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.
ack. thx
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.
tried this out, it doesnt work for lists just for scalar values
spec.disablePlugins: Unsupported value: []interface {}{"mellanox"}: supported values: "mellanox"
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.
I see, perhaps this kubernetes-sigs/kubebuilder#2812?
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.
works. PR updated.
59ddaa9
to
d1fdcaf
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
d1fdcaf
to
cb0cd55
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
cb0cd55
to
f0637f6
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
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.
LGTM
Failing tests are not related. They are also failing in other PRs.
This seems to help #600
f0637f6
to
f279398
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
rebased. @zeeke PTAL :) |
- remove _plugin suffix from plugin names as it doesnt add any important information. - rename logs Signed-off-by: adrianc <adrianc@nvidia.com>
This better reflects the meaning of whats being done. In addition it serves as prep work to support disable plugins as having both enabledPlugins and disabledPlugins attr in Daemon is confusing. Signed-off-by: adrianc <adrianc@nvidia.com>
- Add --disable-plugins CLI flag - parse and check flag values and pass to daemon - extend plugin load logic to skip disabled plugins Signed-off-by: adrianc <adrianc@nvidia.com>
- Make fake plugin name configurable via attribute - adjust daemon test code - add daemon plugins tests to cover plugin loading logic Signed-off-by: adrianc <adrianc@nvidia.com>
- Extend sriovOperatorConfig CRD with disablePlugins list attribute which contains list of plugins to disable in sriov-network-config-daemon - sriovOperatorConfig controller: Update template data - Set disable-plugin flag in daemonset yaml - Add tests Signed-off-by: adrianc <adrianc@nvidia.com>
update documentation for disable plugin feature Signed-off-by: adrianc <adrianc@nvidia.com>
f279398
to
baa18d0
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
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.
LGTM
Changes to CustomResourceDefinition have been introduced by - k8snetworkplumbingwg/sriov-network-operator#497 - k8snetworkplumbingwg/sriov-network-operator#569 Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
Changes to CustomResourceDefinition have been introduced by - k8snetworkplumbingwg/sriov-network-operator#497 - k8snetworkplumbingwg/sriov-network-operator#569 Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
Add option to disable sriov network config daemon plugins
some plugins perform vendor specific firmware configuration
to enable SR-IOV (e.g
mellanox
plugin). certain deployment environments may prefer to perform such configurationonce during node provisioning, while ensuring the configuration will be compatible with any sriov network node policy
defined for the particular environment. This will reduce or completely eliminate the need for reboot of nodes during SR-IOV
configurations by the operator.
This can be done by setting SriovOperatorConfig
default
CRspec.disablePlugins
with the list of desired pluginsto disable.