-
Notifications
You must be signed in to change notification settings - Fork 111
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
Implementation for new systemd configuration method #365
Conversation
Thanks for your PR,
To skip the vendors CIs use one of:
|
Thanks for your PR,
To skip the vendors CIs use one of:
|
Thanks for your PR,
To skip the vendors CIs use one of:
|
Thanks for your PR,
To skip the vendors CIs use one of:
|
1 similar comment
Thanks for your PR,
To skip the vendors CIs use one of:
|
Thanks for your PR,
To skip the vendors CIs use one of:
|
Can one of the admins verify this patch? |
Thanks for your PR,
To skip the vendors CIs use one of:
|
Thanks for your PR,
To skip the vendors CIs use one of:
|
bindata/manifests/siov-config-service/units/sriov-config-service.yaml
Outdated
Show resolved
Hide resolved
Thanks for your PR,
To skip the vendors CIs use one of:
|
Thanks for your PR,
To skip the vendors CIs use one of:
|
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 5322664195
💛 - Coveralls |
waiting for #409 |
Thanks for your PR,
To skip the vendors CIs use one of:
|
api/v1/helper.go
Outdated
type ConfigurationModeType string | ||
|
||
const ( | ||
DaemonConfigurationMode = "daemon" |
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.
Maybe it's better to create types consts here:
DaemonConfigurationMode ConfigurationModeType = "daemon"
SystemdConfigurationMode ConfigurationModeType = "systemd"
@@ -299,7 +319,7 @@ func (r *SriovOperatorConfigReconciler) deleteK8sResource(ctx context.Context, i | |||
|
|||
func (r *SriovOperatorConfigReconciler) syncK8sResource(ctx context.Context, cr *sriovnetworkv1.SriovOperatorConfig, in *uns.Unstructured) error { | |||
switch in.GetKind() { | |||
case "ClusterRole", "ClusterRoleBinding", "MutatingWebhookConfiguration", "ValidatingWebhookConfiguration": | |||
case "ClusterRole", "ClusterRoleBinding", "MutatingWebhookConfiguration", "ValidatingWebhookConfiguration", machineConfigCRDName: |
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: let's move all CRDs name into constant
command: | ||
- /bin/bash | ||
- -c | ||
- mkdir -p /host/var/lib/sriov/ && cp /usr/bin/sriov-network-config-daemon /host/var/lib/sriov/sriov-network-config-daemon && chcon -t bin_t /host/var/lib/sriov/sriov-network-config-daemon | true # Allow systemd to run the file, use pipe true to not failed if the system doesn't have selinux enabled |
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.
selinux => selinux or apparmor
} | ||
|
||
if mlx4Err != nil && mlx5Err != nil { | ||
glog.Errorf("tryEnableRdma(): no RDMA capable devices") |
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 Intel devices? will this check work for them?
return h.enableRDMAOnUbuntuMachine() | ||
} | ||
|
||
osName, err := h.getOSPrettyName() |
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.
line 167 returns result if isRhelSystem
link 176 returns result if isUbuntuSystem
what other OSs are supported to get into this code?
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.
@SchSeba ^^
@@ -0,0 +1,41 @@ | |||
/* | |||
Copyright 2021. |
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.
Copyright 2023
@@ -5,6 +5,7 @@ import ( | |||
"strings" |
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: it would be good to have more detailed commit message
Thanks for your PR,
To skip the vendors CIs use one of:
|
[Install] | ||
WantedBy=multi-user.target | ||
enabled: true | ||
name: sriov-config.service |
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.
Just thinking out loud, would we want to add templatisation for dependent services? Is it possible that some users may want to add services in the After=
field based on their host OS setup?
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 is a great Idea the question is how we will expose that template to the user?
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.
we definately need to have this configurable. Let's think about thi in a follow-up PR
Thanks for your PR,
To skip the vendors CIs use one of:
|
Thanks for your PR,
To skip the vendors CIs use one of:
|
Signed-off-by: Sebastian Sch <sebassch@gmail.com>
This is needed so we can static link everything in the binary Signed-off-by: Sebastian Sch <sebassch@gmail.com>
Signed-off-by: Sebastian Sch <sebassch@gmail.com>
Signed-off-by: Sebastian Sch <sebassch@gmail.com>
Signed-off-by: Sebastian Sch <sebassch@gmail.com>
Signed-off-by: Sebastian Sch <sebassch@gmail.com>
Signed-off-by: Sebastian Sch <sebassch@gmail.com>
Signed-off-by: Sebastian Sch <sebassch@gmail.com>
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.
Added few comments and nits which could be addressed in a new revision of this PR or in a follow up PR.
I tested these changes on the vanilla k8s only
@@ -69,6 +69,7 @@ func main() { | |||
var metricsAddr string | |||
var enableLeaderElection bool | |||
var probeAddr string | |||
|
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: this change is not needed
@@ -82,6 +83,7 @@ func main() { | |||
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts))) | |||
|
|||
restConfig := ctrl.GetConfigOrDie() | |||
|
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: this change is not needed
@@ -36,7 +36,7 @@ import ( | |||
"github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/pod" | |||
) | |||
|
|||
var waitingTime time.Duration = 20 * time.Minute | |||
var waitingTime = 20 * time.Minute |
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: this change is not needed
[Install] | ||
WantedBy=multi-user.target | ||
enabled: true | ||
name: sriov-config.service |
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.
we definately need to have this configurable. Let's think about thi in a follow-up PR
return i, nil | ||
} | ||
} | ||
return sriovnetworkv1.Interface{}, fmt.Errorf("unable to find interface: %v", name) |
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.
why don't you return 'nil, err' here?
return h.enableRDMAOnUbuntuMachine() | ||
} | ||
|
||
osName, err := h.getOSPrettyName() |
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.
@SchSeba ^^
Add a new configuration method called systemd mode.
With this new mode all the VFs are created before kubelet even starts this will allow the operator to have a much better recovery time after reboot.
it will also fix issues like kubernetes/kubernetes#109595
The downside of this solution and the reason why for now it will not be the "default" configuration mode is that every configuration change in sriov will require a node reboot.
After this PR is merged we will need to work on
#225
#226
to improve the configuration/reconfiguration/update time on large clusters