Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
85feccd
Refactor some conformance tests to utilize SRIOV_NODE_AND_DEVICE_NAME…
evgenLevin Sep 3, 2024
91e04f6
metrics: Add PrometheusRule for namespaced metrics
zeeke Jul 10, 2024
b49cf15
metrics: Add permissions to remove monitor objects
zeeke Aug 28, 2024
aecb4bb
Merge pull request #732 from zeeke/metrics-exporter-rules
adrianchiris Sep 19, 2024
60c6404
Merge pull request #771 from zeeke/us/e2e-filter-devices
zeeke Sep 19, 2024
6aedb8c
Fix merge annotation function
SchSeba Sep 18, 2024
644fcf2
Delete webhooks when SriovOperatorConfig is deleted
zeeke Sep 19, 2024
e2d0611
Merge pull request #776 from SchSeba/fix_render
zeeke Sep 20, 2024
f17bb2a
metrics: Fix typo in `METRICS_EXPORTER_PROMETHEUS_DEPLOY_RULES`
zeeke Sep 19, 2024
f94fa64
Fix syntax for RDMA_CNI_IMAGE var substitution
mandre Sep 20, 2024
4bae6ce
Merge pull request #780 from mandre/fix-RDMA_CNI_IMAGE
zeeke Sep 22, 2024
3ff1b85
metrics: Add `node` label to `sriov_*` metrics
zeeke Sep 12, 2024
084810a
openstack: dynamically mount the config-drive
EmilienM Sep 11, 2024
ba21df0
Enclose array expansions in double quote
mandre Sep 23, 2024
3d553bf
Add missing shebang
mandre Sep 23, 2024
63246d6
Explicitly expand array values
mandre Sep 23, 2024
3529811
Iterate over globs.
mandre Sep 23, 2024
61aacb5
Fix: GetDevlinkDeviceParam to handle edge-cases correctly
ykulazhenkov Sep 23, 2024
6f44ae5
Merge pull request #779 from zeeke/us/OCPBUGS-41897
e0ne Oct 1, 2024
31175eb
Merge pull request #782 from ykulazhenkov/pr-fix-getdevlinkdeviceparam
e0ne Oct 2, 2024
aecf473
Merge pull request #774 from zeeke/metrics-exporter-drop-labels
SchSeba Oct 7, 2024
a01a139
metrics: Fix `Metrics should have the correct labels` test
zeeke Oct 7, 2024
6abdfe6
Fix NRI rbac
SchSeba Oct 8, 2024
9143c95
Merge pull request #787 from SchSeba/add_rbac_to_nri
zeeke Oct 9, 2024
fb193e8
Use grep for matching args with sh
mandre Sep 26, 2024
5394d21
CI: Add a bash linter to pre-submits
mandre Sep 23, 2024
e35f3d4
Merge pull request #785 from zeeke/us/metrics-e2e-fix
ykulazhenkov Oct 9, 2024
c02e517
Merge pull request #781 from mandre/shellcheck
ykulazhenkov Oct 9, 2024
92cf81c
Merge pull request #773 from EmilienM/configDrive
zeeke Oct 9, 2024
f286a04
config-daemon: Restart all instances of device-plugin
zeeke Oct 4, 2024
a85ab70
Merge pull request #783 from zeeke/us/multiple-device-plugins
zeeke Oct 9, 2024
85063dc
Add Intel Corporation Ethernet Controller E810-XXV for backplane, E82…
wizhaoredhat Oct 10, 2024
6556c92
Add NVIDIA ConnectX-8 to supported NICs list
e0ne Sep 19, 2024
8fe7a5e
Merge pull request #790 from wizhaoredhat/add_netsec_ethernet_control…
bn222 Oct 11, 2024
9782923
logging: Reduce device discovering verbosity
zeeke Oct 18, 2024
68b6c02
Merge pull request #793 from zeeke/us/config-daemon-reduce-logging
adrianchiris Oct 21, 2024
b5b0d6b
Add a note in documentation regarding systemd mode
souleb Oct 22, 2024
dc299c4
Fixing daemon sriov VFs config, where PF pci address got unbind inste…
heyvister1 Oct 27, 2024
df1407d
Fix k8s CI
SchSeba Oct 29, 2024
eb96108
Merge pull request #778 from e0ne/connectx-8-support
SchSeba Oct 29, 2024
ab79e2c
Merge pull request #794 from souleb/post-delete-systemd
SchSeba Oct 29, 2024
8d9e8da
Merge pull request #797 from heyvister1/fix-daemon-unbind-pf
SchSeba Oct 29, 2024
09a3af9
Merge pull request #801 from SchSeba/fix_k8s_ci_virtual_cluster
adrianchiris Oct 29, 2024
0d9a707
adding sriov operator config finalizer, to control generated cluster …
heyvister1 Oct 13, 2024
b1bb044
adding sriov operator config cleanup binary, to be used under helm un…
heyvister1 Oct 28, 2024
5009e99
Merge pull request #791 from heyvister1/webhooks-k8s-objects-deletion
zeeke Oct 30, 2024
6d32ec0
kernel: Set arguments based on CPU architecture
zeeke Oct 25, 2024
5522c96
Update `github.com/jaypipes/ghw`
zeeke Oct 25, 2024
2b02ba1
Merge pull request #796 from zeeke/us/OCPBUGS-43654
SchSeba Oct 31, 2024
73c1f81
RDMA subsystem is implemented via ib_core module config.
e0ne Mar 23, 2024
02c6b00
Add kernel args for rdma mode to complement the modprobe file
SchSeba Oct 28, 2024
92fee7b
Merge pull request #799 from SchSeba/rdma-subsytem-mode
SchSeba Nov 11, 2024
baa41c9
redesign device plugin
SchSeba Nov 7, 2024
8950f76
deploy: relax Operator node affinity
EmilienM Nov 14, 2024
623c339
Merge pull request #747 from SchSeba/device_plugin_redesign
SchSeba Nov 19, 2024
5fce462
Merge pull request #806 from EmilienM/nodeAffinity
SchSeba Nov 20, 2024
f6ea7b4
Fix corner case for pausing machine config
SchSeba Nov 11, 2024
8f45dce
re-organize drain controller package
SchSeba Nov 11, 2024
8d4ae20
Add waitForDevicesInitialization to systemd service
ykulazhenkov Nov 21, 2024
9fd85a2
Fixing pre-delete-webhook template for missing imagePullSecrets
heyvister1 Nov 24, 2024
4185aa4
Merge pull request #809 from heyvister1/fix-pre-delete-wh-pullsecret
ykulazhenkov Nov 25, 2024
71d2d16
Merge pull request #808 from ykulazhenkov/pr-systemd-wait-for-devices
e0ne Nov 26, 2024
f819a2b
Merge pull request #803 from SchSeba/drain_improve
SchSeba Nov 26, 2024
045c858
logging: Increase verbosity of `NeedToUpdateSriov`
zeeke Nov 26, 2024
5f492e5
Merge pull request #810 from zeeke/us/needtoupdatesriov-verbosity
zeeke Nov 27, 2024
5ad4ae9
feat: Update controller logic to handle stale SriovNetworkNodeState C…
ykulazhenkov Oct 28, 2024
093893c
e2e: Avoid setting wrong routes for `host-local` IPAM
zeeke Dec 4, 2024
df2a973
e2e: Improve `findUnusedSriovDevices` errors
zeeke Dec 5, 2024
07a7f05
Merge pull request #812 from zeeke/us/fix-test-ip-routes
zeeke Dec 5, 2024
c621f29
e2e: Don't allocate TTY when executing commands
zeeke Dec 9, 2024
7f8eff4
e2e: Use `cat` instead of `more` to read files
zeeke Dec 10, 2024
87c93e9
Merge pull request #814 from zeeke/us/fix-tty
SchSeba Dec 11, 2024
c33774a
Unit test for RdmaMode
zeeke Dec 5, 2024
fdffa3d
Avoid overwriting coverage files for different `CLUSTER_TYPE`s
zeeke Dec 5, 2024
7c9da38
Merge pull request #813 from zeeke/us/flaky-coveralls
SchSeba Dec 11, 2024
8e565e9
build(deps): bump golang.org/x/crypto from 0.23.0 to 0.31.0
dependabot[bot] Dec 12, 2024
d172b52
Merge pull request #815 from k8snetworkplumbingwg/dependabot/go_modul…
zeeke Dec 12, 2024
60a777c
Do not configure BlueField NICs in DPU mode
e0ne Dec 13, 2024
0c4edb3
functest: add retry for rdma functest
SchSeba Dec 16, 2024
cfd160f
Merge pull request #817 from SchSeba/add_retry_on_delete
SchSeba Dec 18, 2024
ed25caa
hack/env.sh: move checking of environment variables outside SKIP_VAR_…
thom311 Dec 19, 2024
4164d69
bump `golang.org/x/net` to `v0.33.0`
zeeke Dec 20, 2024
eb2fa5f
Merge pull request #820 from zeeke/us/CVE-2024-45338
zeeke Dec 20, 2024
d7d2e57
add link state enable on test
SchSeba Dec 23, 2024
260d7eb
functest: Fix ip link command output
SchSeba Dec 24, 2024
270d88b
Merge pull request #822 from SchSeba/fix_ip_link_command_tests
adrianchiris Dec 30, 2024
0af8dc5
Merge pull request #821 from SchSeba/fix_mtu_disconnected_test
SchSeba Dec 31, 2024
81c67cc
Skip kernel parameters configuration for Ubuntu
e0ne Dec 17, 2024
d798856
Bump the k8s version we use in the CI system to 1.32.0
SchSeba Jan 1, 2025
1ae809e
Merge pull request #798 from ykulazhenkov/pr-keep-stale-node-state
SchSeba Jan 1, 2025
0ebe7ae
Merge pull request #818 from e0ne/kargs-ubuntu
SchSeba Jan 2, 2025
d62b546
Merge pull request #827 from SchSeba/bump_k8s_version_ci
zeeke Jan 2, 2025
1a8d74c
Do not return DPU mode on error
e0ne Jan 6, 2025
e49dac0
Support mtu_request for OVS
rollandf Jan 6, 2025
688cdde
extend func-test timeout
SchSeba Jan 9, 2025
009c691
Merge pull request #829 from SchSeba/extend_time
adrianchiris Jan 9, 2025
220247d
Merge pull request #819 from thom311/th/hack-env-check
adrianchiris Jan 13, 2025
0860d53
Merge pull request #828 from rollandf/mtu-ovs
zeeke Jan 13, 2025
84d0a6d
ovs: add internal interface
rollandf Jan 12, 2025
f891498
Merge pull request #830 from rollandf/ovs-internal
zeeke Jan 13, 2025
7990611
Merge pull request #816 from e0ne/dpu-mode
SchSeba Jan 15, 2025
009c45f
Make rdma functional tests robust for single node environments
SchSeba Dec 31, 2024
aaba54c
Merge pull request #825 from SchSeba/rdma-functest
zeeke Jan 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ jobs:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.55.2

shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
severity: error

test-coverage:
name: test-coverage
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ FROM golang:1.22 AS builder
WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
COPY . .
RUN make _build-manager BIN_PATH=build/_output/cmd
RUN make _build-sriov-network-operator-config-cleanup BIN_PATH=build/_output/cmd

FROM quay.io/centos/centos:stream9
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/manager /usr/bin/sriov-network-operator
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
COPY bindata /bindata
ENV OPERATOR_NAME=sriov-network-operator
CMD ["/usr/bin/sriov-network-operator"]
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ GOLANGCI_LINT_VER = v1.55.2

all: generate lint build

build: manager _build-sriov-network-config-daemon _build-webhook
build: manager _build-sriov-network-config-daemon _build-webhook _build-sriov-network-operator-config-cleanup

_build-%:
WHAT=$* hack/build-go.sh
Expand Down Expand Up @@ -226,10 +226,10 @@ test-e2e-k8s: export NAMESPACE=sriov-network-operator
test-e2e-k8s: test-e2e

test-bindata-scripts: fakechroot
fakechroot ./test/scripts/enable-kargs_test.sh
fakechroot ./test/scripts/kargs_test.sh

test-%: generate manifests envtest
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir=/tmp -p path)" HOME="$(shell pwd)" go test ./$*/... -coverprofile cover-$*.out -coverpkg ./... -v
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir=/tmp -p path)" HOME="$(shell pwd)" go test ./$*/... -coverprofile cover-$*-$(CLUSTER_TYPE).out -coverpkg ./... -v

GOCOVMERGE = $(BIN_DIR)/gocovmerge
gocovmerge: ## Download gocovmerge locally if necessary.
Expand Down
78 changes: 62 additions & 16 deletions api/v1/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"sort"
"strconv"
"strings"
"time"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -26,11 +27,12 @@ import (
)

const (
LASTNETWORKNAMESPACE = "operator.sriovnetwork.openshift.io/last-network-namespace"
NETATTDEFFINALIZERNAME = "netattdef.finalizers.sriovnetwork.openshift.io"
POOLCONFIGFINALIZERNAME = "poolconfig.finalizers.sriovnetwork.openshift.io"
ESwithModeLegacy = "legacy"
ESwithModeSwitchDev = "switchdev"
LASTNETWORKNAMESPACE = "operator.sriovnetwork.openshift.io/last-network-namespace"
NETATTDEFFINALIZERNAME = "netattdef.finalizers.sriovnetwork.openshift.io"
POOLCONFIGFINALIZERNAME = "poolconfig.finalizers.sriovnetwork.openshift.io"
OPERATORCONFIGFINALIZERNAME = "operatorconfig.finalizers.sriovnetwork.openshift.io"
ESwithModeLegacy = "legacy"
ESwithModeSwitchDev = "switchdev"

SriovCniStateEnable = "enable"
SriovCniStateDisable = "disable"
Expand Down Expand Up @@ -260,23 +262,23 @@ func NeedToUpdateSriov(ifaceSpec *Interface, ifaceStatus *InterfaceExt) bool {
if ifaceSpec.Mtu > 0 {
mtu := ifaceSpec.Mtu
if mtu > ifaceStatus.Mtu {
log.V(2).Info("NeedToUpdateSriov(): MTU needs update", "desired", mtu, "current", ifaceStatus.Mtu)
log.V(0).Info("NeedToUpdateSriov(): MTU needs update", "desired", mtu, "current", ifaceStatus.Mtu)
return true
}
}
currentEswitchMode := GetEswitchModeFromStatus(ifaceStatus)
desiredEswitchMode := GetEswitchModeFromSpec(ifaceSpec)
if currentEswitchMode != desiredEswitchMode {
log.V(2).Info("NeedToUpdateSriov(): EswitchMode needs update", "desired", desiredEswitchMode, "current", currentEswitchMode)
log.V(0).Info("NeedToUpdateSriov(): EswitchMode needs update", "desired", desiredEswitchMode, "current", currentEswitchMode)
return true
}
if ifaceSpec.NumVfs != ifaceStatus.NumVfs {
log.V(2).Info("NeedToUpdateSriov(): NumVfs needs update", "desired", ifaceSpec.NumVfs, "current", ifaceStatus.NumVfs)
log.V(0).Info("NeedToUpdateSriov(): NumVfs needs update", "desired", ifaceSpec.NumVfs, "current", ifaceStatus.NumVfs)
return true
}

if ifaceStatus.LinkAdminState == consts.LinkAdminStateDown {
log.V(2).Info("NeedToUpdateSriov(): PF link status needs update", "desired to include", "up", "current", ifaceStatus.LinkAdminState)
log.V(0).Info("NeedToUpdateSriov(): PF link status needs update", "desired to include", "up", "current", ifaceStatus.LinkAdminState)
return true
}

Expand All @@ -285,24 +287,24 @@ func NeedToUpdateSriov(ifaceSpec *Interface, ifaceStatus *InterfaceExt) bool {
for _, groupSpec := range ifaceSpec.VfGroups {
if IndexInRange(vfStatus.VfID, groupSpec.VfRange) {
if vfStatus.Driver == "" {
log.V(2).Info("NeedToUpdateSriov(): Driver needs update - has no driver",
log.V(0).Info("NeedToUpdateSriov(): Driver needs update - has no driver",
"desired", groupSpec.DeviceType)
return true
}
if groupSpec.DeviceType != "" && groupSpec.DeviceType != consts.DeviceTypeNetDevice {
if groupSpec.DeviceType != vfStatus.Driver {
log.V(2).Info("NeedToUpdateSriov(): Driver needs update",
log.V(0).Info("NeedToUpdateSriov(): Driver needs update",
"desired", groupSpec.DeviceType, "current", vfStatus.Driver)
return true
}
} else {
if StringInArray(vfStatus.Driver, vars.DpdkDrivers) {
log.V(2).Info("NeedToUpdateSriov(): Driver needs update",
log.V(0).Info("NeedToUpdateSriov(): Driver needs update",
"desired", groupSpec.DeviceType, "current", vfStatus.Driver)
return true
}
if vfStatus.Mtu != 0 && groupSpec.Mtu != 0 && vfStatus.Mtu != groupSpec.Mtu {
log.V(2).Info("NeedToUpdateSriov(): VF MTU needs update",
log.V(0).Info("NeedToUpdateSriov(): VF MTU needs update",
"vf", vfStatus.VfID, "desired", groupSpec.Mtu, "current", vfStatus.Mtu)
return true
}
Expand All @@ -312,20 +314,20 @@ func NeedToUpdateSriov(ifaceSpec *Interface, ifaceStatus *InterfaceExt) bool {
// Node GUID. We intentionally skip empty Node GUID in vfStatus because this may happen
// when the VF is allocated to a workload.
if vfStatus.GUID == consts.UninitializedNodeGUID {
log.V(2).Info("NeedToUpdateSriov(): VF GUID needs update",
log.V(0).Info("NeedToUpdateSriov(): VF GUID needs update",
"vf", vfStatus.VfID, "current", vfStatus.GUID)
return true
}
}
// this is needed to be sure the admin mac address is configured as expected
if ifaceSpec.ExternallyManaged {
log.V(2).Info("NeedToUpdateSriov(): need to update the device as it's externally manage",
log.V(0).Info("NeedToUpdateSriov(): need to update the device as it's externally manage",
"device", ifaceStatus.PciAddress)
return true
}
}
if groupSpec.VdpaType != vfStatus.VdpaType {
log.V(2).Info("NeedToUpdateSriov(): VF VdpaType mismatch",
log.V(0).Info("NeedToUpdateSriov(): VF VdpaType mismatch",
"desired", groupSpec.VdpaType, "current", vfStatus.VdpaType)
return true
}
Expand Down Expand Up @@ -482,6 +484,10 @@ func (p *SriovNetworkNodePolicy) ApplyBridgeConfig(state *SriovNetworkNodeState)
Interface: p.Spec.Bridge.OVS.Uplink.Interface,
}},
}
if p.Spec.Mtu > 0 {
mtu := p.Spec.Mtu
ovsBridge.Uplinks[0].Interface.MTURequest = &mtu
}
log.Info("Update bridge for interface", "name", iface.Name, "bridge", ovsBridge.Name)

// We need to keep slices with bridges ordered to avoid unnecessary updates in the K8S API.
Expand Down Expand Up @@ -1004,3 +1010,43 @@ func GenerateBridgeName(iface *InterfaceExt) string {
func NeedToUpdateBridges(bridgeSpec, bridgeStatus *Bridges) bool {
return !reflect.DeepEqual(bridgeSpec, bridgeStatus)
}

// SetKeepUntilTime sets an annotation to hold the "keep until time" for the node’s state.
// The "keep until time" specifies the earliest time at which the state object can be removed
// if the daemon's pod is not found on the node.
func (s *SriovNetworkNodeState) SetKeepUntilTime(t time.Time) {
ts := t.Format(time.RFC3339)
annotations := s.GetAnnotations()
if annotations == nil {
annotations = map[string]string{}
}
annotations[consts.NodeStateKeepUntilAnnotation] = ts
s.SetAnnotations(annotations)
}

// GetKeepUntilTime returns the value that is stored in the "keep until time" annotation.
// The "keep until time" specifies the earliest time at which the state object can be removed
// if the daemon's pod is not found on the node.
// Return zero time instant if annotaion is not found on the object or if it has a wrong format.
func (s *SriovNetworkNodeState) GetKeepUntilTime() time.Time {
t, err := time.Parse(time.RFC3339, s.GetAnnotations()[consts.NodeStateKeepUntilAnnotation])
if err != nil {
return time.Time{}
}
return t
}

// ResetKeepUntilTime removes "keep until time" annotation from the state object.
// The "keep until time" specifies the earliest time at which the state object can be removed
// if the daemon's pod is not found on the node.
// Returns true if the value was removed, false otherwise.
func (s *SriovNetworkNodeState) ResetKeepUntilTime() bool {
annotations := s.GetAnnotations()
_, exist := annotations[consts.NodeStateKeepUntilAnnotation]
if !exist {
return false
}
delete(annotations, consts.NodeStateKeepUntilAnnotation)
s.SetAnnotations(annotations)
return true
}
2 changes: 2 additions & 0 deletions api/v1/sriovnetworknodepolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ type OVSInterfaceConfig struct {
ExternalIDs map[string]string `json:"externalIDs,omitempty"`
// other_config field in the Interface table in OVSDB
OtherConfig map[string]string `json:"otherConfig,omitempty"`
// mtu_request field in the Interface table in OVSDB
MTURequest *int `json:"mtuRequest,omitempty"`
}

// SriovNetworkNodePolicyStatus defines the observed state of SriovNetworkNodePolicy
Expand Down
8 changes: 8 additions & 0 deletions api/v1/sriovnetworknodestate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
type SriovNetworkNodeStateSpec struct {
Interfaces Interfaces `json:"interfaces,omitempty"`
Bridges Bridges `json:"bridges,omitempty"`
System System `json:"system,omitempty"`
}

type Interfaces []Interface
Expand Down Expand Up @@ -114,10 +115,17 @@ type OVSUplinkConfigExt struct {
Interface OVSInterfaceConfig `json:"interface,omitempty"`
}

type System struct {
// +kubebuilder:validation:Enum=shared;exclusive
//RDMA subsystem. Allowed value "shared", "exclusive".
RdmaMode string `json:"rdmaMode,omitempty"`
}

// SriovNetworkNodeStateStatus defines the observed state of SriovNetworkNodeState
type SriovNetworkNodeStateStatus struct {
Interfaces InterfaceExts `json:"interfaces,omitempty"`
Bridges Bridges `json:"bridges,omitempty"`
System System `json:"system,omitempty"`
SyncStatus string `json:"syncStatus,omitempty"`
LastSyncError string `json:"lastSyncError,omitempty"`
}
Expand Down
4 changes: 4 additions & 0 deletions api/v1/sriovnetworkpoolconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ type SriovNetworkPoolConfigSpec struct {
// Drain will respect Pod Disruption Budgets (PDBs) such as etcd quorum guards,
// even if maxUnavailable is greater than one.
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`

// +kubebuilder:validation:Enum=shared;exclusive
// RDMA subsystem. Allowed value "shared", "exclusive".
RdmaMode string `json:"rdmaMode,omitempty"`
}

type OvsHardwareOffloadConfig struct {
Expand Down
22 changes: 22 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions bindata/manifests/metrics-exporter/metrics-prometheus-rule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
{{ if and .IsPrometheusOperatorInstalled .PrometheusOperatorDeployRules }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: sriov-vf-rules
namespace: {{.Namespace}}
spec:
groups:
- name: sriov-network-metrics-operator.rules
interval: 30s
rules:
- expr: |
sriov_vf_tx_packets * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice
record: network:sriov_vf_tx_packets
- expr: |
sriov_vf_rx_packets * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice
record: network:sriov_vf_rx_packets
- expr: |
sriov_vf_tx_bytes * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice
record: network:sriov_vf_tx_bytes
- expr: |
sriov_vf_rx_bytes * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice
record: network:sriov_vf_rx_bytes
- expr: |
sriov_vf_tx_dropped * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice
record: network:sriov_vf_tx_dropped
- expr: |
sriov_vf_rx_dropped * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice
record: network:sriov_vf_rx_dropped
- expr: |
sriov_vf_rx_broadcast * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice
record: network:sriov_vf_rx_broadcast
- expr: |
sriov_vf_rx_multicast * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice
record: network:sriov_vf_rx_multicast
{{ end }}

11 changes: 11 additions & 0 deletions bindata/manifests/metrics-exporter/metrics-prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ spec:
bearerTokenFile: "/var/run/secrets/kubernetes.io/serviceaccount/token"
scheme: "https"
honorLabels: true
relabelings:
- action: replace
sourceLabels:
- __meta_kubernetes_endpoint_node_name
targetLabel: node
- action: labeldrop
regex: pod
- action: labeldrop
regex: container
- action: labeldrop
regex: namespace
tlsConfig:
serverName: sriov-network-metrics-exporter-service.{{.Namespace}}.svc
caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
Expand Down
2 changes: 1 addition & 1 deletion bindata/manifests/plugins/sriov-device-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
hostNetwork: true
nodeSelector:
{{- range $key, $value := .NodeSelectorField }}
{{ $key }}: {{ $value }}
{{ $key }}: "{{ $value }}"
{{- end }}
tolerations:
- operator: Exists
Expand Down
2 changes: 1 addition & 1 deletion bindata/manifests/webhook/002-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rules:
- apiGroups:
- ""
resources:
- configmap
- configmaps
verbs:
- 'watch'
- 'list'
Expand Down
Loading
Loading