Skip to content

Commit dc6eb11

Browse files
committed
WIP
Signed-off-by: Sebastian Sch <[email protected]>
1 parent d172b52 commit dc6eb11

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1511
-1257
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ RUN make _build-manager BIN_PATH=build/_output/cmd
55
RUN make _build-sriov-network-operator-config-cleanup BIN_PATH=build/_output/cmd
66

77
FROM quay.io/centos/centos:stream9
8+
RUN yum -y install delve procps-ng
89
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/manager /usr/bin/sriov-network-operator
910
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/sriov-network-operator-config-cleanup /usr/bin/sriov-network-operator-config-cleanup
1011
COPY bindata /bindata

Dockerfile.sriov-network-config-daemon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FROM quay.io/centos/centos:stream9
77
ARG MSTFLINT=mstflint
88
# We have to ensure that pciutils is installed. This package is needed for mstfwreset to succeed.
99
# xref pkg/vendors/mellanox/mellanox.go#L150
10-
RUN ARCH_DEP_PKGS=$(if [ "$(uname -m)" != "s390x" ]; then echo -n ${MSTFLINT} ; fi) && yum -y install hwdata pciutils $ARCH_DEP_PKGS && yum clean all
10+
RUN ARCH_DEP_PKGS=$(if [ "$(uname -m)" != "s390x" ]; then echo -n ${MSTFLINT} ; fi) && yum -y install delve procps-ng hwdata pciutils $ARCH_DEP_PKGS && yum clean all
1111
LABEL io.k8s.display-name="sriov-network-config-daemon" \
1212
io.k8s.description="This is a daemon that manage and config sriov network devices in Kubernetes cluster"
1313
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/sriov-network-config-daemon /usr/bin/

bindata/manifests/daemon/daemonset.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,24 @@ spec:
130130
containers:
131131
- name: sriov-network-config-daemon
132132
image: {{.Image}}
133-
command:
134-
- sriov-network-config-daemon
133+
imagePullPolicy: Always
135134
securityContext:
136135
privileged: true
136+
command:
137+
- sriov-network-config-daemon
137138
args:
138139
- "start"
140+
# command:
141+
# - dlv
142+
# - --listen=:2345
143+
# - --headless=true
144+
# - --api-version=2
145+
# - --accept-multiclient
146+
# - --log
147+
# - exec
148+
# - /usr/bin/sriov-network-config-daemon
149+
# - --
150+
# - start
139151
{{- if .UsedSystemdMode}}
140152
- --use-systemd-service
141153
{{- end }}

bindata/manifests/operator-webhook/server.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ spec:
6464
containers:
6565
- name: webhook-server
6666
image: {{.SriovNetworkWebhookImage}}
67+
imagePullPolicy: Always
6768
command:
6869
- webhook
6970
args:

bindata/manifests/plugins/sriov-device-plugin.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ spec:
4242
containers:
4343
- name: sriov-device-plugin
4444
image: {{.SRIOVDevicePluginImage}}
45+
imagePullPolicy: Always
4546
args:
4647
- --log-level=10
4748
- --resource-prefix={{.ResourcePrefix}}

bindata/manifests/sriov-config-service/kubernetes/sriov-config-post-network-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ contents: |
66
77
[Service]
88
Type=oneshot
9-
ExecStart=/var/lib/sriov/sriov-network-config-daemon -v 2 --zap-log-level 2 service --phase post
9+
ExecStart=/var/lib/sriov/sriov-network-config-daemon service --phase post
1010
StandardOutput=journal+console
1111
1212
[Install]

bindata/manifests/sriov-config-service/kubernetes/sriov-config-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ contents: |
77
88
[Service]
99
Type=oneshot
10-
ExecStart=/var/lib/sriov/sriov-network-config-daemon -v 2 --zap-log-level 2 service --phase pre
10+
ExecStart=/var/lib/sriov/sriov-network-config-daemon service --phase pre
1111
StandardOutput=journal+console
1212
1313
[Install]

bindata/manifests/sriov-config-service/openshift/sriov-config-service.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spec:
2121
2222
[Service]
2323
Type=oneshot
24-
ExecStart=/var/lib/sriov/sriov-network-config-daemon service -v {{ .LogLevel }} --zap-log-level {{ .LogLevel }} --phase pre
24+
ExecStart=/var/lib/sriov/sriov-network-config-daemon service --phase pre
2525
StandardOutput=journal+console
2626
2727
[Install]
@@ -38,7 +38,7 @@ spec:
3838
3939
[Service]
4040
Type=oneshot
41-
ExecStart=/var/lib/sriov/sriov-network-config-daemon service -v {{ .LogLevel }} --zap-log-level {{ .LogLevel }} --phase post
41+
ExecStart=/var/lib/sriov/sriov-network-config-daemon service --phase post
4242
StandardOutput=journal+console
4343
4444
[Install]

bindata/manifests/webhook/server.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ spec:
6767
containers:
6868
- name: webhook-server
6969
image: {{.NetworkResourcesInjectorImage}}
70+
imagePullPolicy: Always
7071
command:
7172
- webhook
7273
args:

cmd/sriov-network-config-daemon/service.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ func runServiceCmd(cmd *cobra.Command, args []string) error {
8585
}
8686
// init logger
8787
snolog.InitLog()
88+
snolog.SetLogLevel(2)
8889
setupLog := log.Log.WithName("sriov-config-service").WithValues("phase", phaseArg)
8990

9091
setupLog.V(0).Info("Starting sriov-config-service", "version", version.Version)
@@ -163,12 +164,24 @@ func phasePre(setupLog logr.Logger, conf *systemd.SriovConfig, hostHelpers helpe
163164
hostHelpers.TryEnableTun()
164165
hostHelpers.TryEnableVhostNet()
165166

166-
return callPlugin(setupLog, PhasePre, conf, hostHelpers)
167+
// Add retry here as some time the kernel is not fully loaded, and we see issues like
168+
// unbindDriver(): failed to unbind driver "error": "open /sys/bus/pci/drivers/igbvf/unbind: permission denied"
169+
i := 0
170+
for i < 5 {
171+
err = callPlugin(setupLog, PhasePre, conf, hostHelpers)
172+
if err == nil {
173+
break
174+
}
175+
i++
176+
time.Sleep(time.Second)
177+
}
178+
179+
return err
167180
}
168181

169182
func phasePost(setupLog logr.Logger, conf *systemd.SriovConfig, hostHelpers helper.HostHelpersInterface) error {
170183
setupLog.V(0).Info("check result of the Pre phase")
171-
prePhaseResult, err := systemd.ReadSriovResult()
184+
prePhaseResult, _, err := systemd.ReadSriovResult()
172185
if err != nil {
173186
return fmt.Errorf("failed to read result of the pre phase: %v", err)
174187
}

0 commit comments

Comments
 (0)