Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 7 deletions api/v1alpha1/networkconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ type DevicePluginSpec struct {
// +optional
DevicePluginTolerations []v1.Toleration `json:"devicePluginTolerations,omitempty"`

// device plugin arguments is used to pass supported flags and their values while starting device plugin daemonset
// supported flag values: {"resource_naming_strategy": {"single", "mixed"}}
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="DevicePluginArguments",xDescriptors={"urn:alm:descriptor:com.amd.networkconfigs:devicePluginArguments"}
// +optional
DevicePluginArguments map[string]string `json:"devicePluginArguments,omitempty"`

// node labeller image
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="NodeLabellerImage",xDescriptors={"urn:alm:descriptor:com.amd.networkconfigs:nodeLabellerImage"}
// +optional
Expand Down Expand Up @@ -229,7 +223,7 @@ type DriverSpec struct {
AMDNetworkInstallerRepoURL string `json:"AMDNetworkInstallerRepoURL,omitempty"`

// version of the drivers source code, can be used as part of image of dockerfile source image
// default value for different OS is: ubuntu: 1.117.1-a-42, coreOS: 1.117.1-a-42
// default value for different OS is: ubuntu: 1.117.5-a-147, coreOS: 1.117.5-a-147
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Version",xDescriptors={"urn:alm:descriptor:com.amd.NetworkConfigs:version"}
// +optional
Version string `json:"version,omitempty"`
Expand Down Expand Up @@ -501,6 +495,8 @@ type MetricsExporterSpec struct {
// Port is the internal port used for in-cluster and node access to pull metrics from the metrics-exporter (default 5001).
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Port",xDescriptors={"urn:alm:descriptor:com.amd.networkconfigs:port"}
// +kubebuilder:default=5001
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
Port int32 `json:"port,omitempty"`

// ServiceType service type for metrics, clusterIP/NodePort, clusterIP by default
Expand Down
7 changes: 0 additions & 7 deletions api/v1alpha1/zz_generated.deepcopy.go

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

11 changes: 3 additions & 8 deletions config/crd/bases/amd.com_networkconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,6 @@ spec:
devicePlugin:
description: device plugin
properties:
devicePluginArguments:
additionalProperties:
type: string
description: |-
device plugin arguments is used to pass supported flags and their values while starting device plugin daemonset
supported flag values: {"resource_naming_strategy": {"single", "mixed"}}
type: object
devicePluginImage:
description: device plugin image
pattern: ^([a-z0-9]+(?:[._-][a-z0-9]+)*(:[0-9]+)?)(/[a-z0-9]+(?:[._-][a-z0-9]+)*)*(?::[a-z0-9._-]+)?(?:@[a-zA-Z0-9]+:[a-f0-9]+)?$
Expand Down Expand Up @@ -594,7 +587,7 @@ spec:
version:
description: |-
version of the drivers source code, can be used as part of image of dockerfile source image
default value for different OS is: ubuntu: 1.117.1-a-42, coreOS: 1.117.1-a-42
default value for different OS is: ubuntu: 1.117.5-a-147, coreOS: 1.117.5-a-147
type: string
type: object
metricsExporter:
Expand Down Expand Up @@ -657,6 +650,8 @@ spec:
node access to pull metrics from the metrics-exporter (default
5001).
format: int32
maximum: 65535
minimum: 1
type: integer
prometheus:
description: Prometheus configuration for metrics exporter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ metadata:
description: |-
Operator responsible for deploying AMD Network kernel drivers, device plugin, node labeller and device metrics exporter
For more information, visit [documentation](https://instinct.docs.amd.com/projects/network-operator/en/latest/)
devicePluginImage: docker.io/rocm/k8s-network-device-plugin:v0.0.1
devicePluginImage: docker.io/rocm/k8s-network-device-plugin:v1.2.1
features.operators.openshift.io/disconnected: "true"
features.operators.openshift.io/fips-compliant: "false"
features.operators.openshift.io/proxy-aware: "true"
features.operators.openshift.io/tls-profiles: "false"
features.operators.openshift.io/token-auth-aws: "false"
features.operators.openshift.io/token-auth-azure: "false"
features.operators.openshift.io/token-auth-gcp: "false"
metricsExporterImage: docker.io/rocm/device-metrics-exporter:nic-v0.0.1
nodelabellerImage: docker.io/rocm/k8s-network-node-labeller:v0.0.1
metricsExporterImage: docker.io/rocm/device-metrics-exporter:nic-v1.2.1
nodelabellerImage: docker.io/rocm/k8s-network-node-labeller:v1.2.1
operatorframework.io/cluster-monitoring: "true"
operatorframework.io/suggested-namespace: openshift-amd-network
operators.openshift.io/valid-subscription: '[]'
Expand Down Expand Up @@ -144,13 +144,6 @@ spec:
path: devicePlugin
x-descriptors:
- urn:alm:descriptor:com.amd.NetworkConfigs:devicePlugin
- description: 'device plugin arguments is used to pass supported flags and
their values while starting device plugin daemonset supported flag values:
{"resource_naming_strategy": {"single", "mixed"}}'
displayName: DevicePluginArguments
path: devicePlugin.devicePluginArguments
x-descriptors:
- urn:alm:descriptor:com.amd.networkconfigs:devicePluginArguments
- description: device plugin image
displayName: DevicePluginImage
path: devicePlugin.devicePluginImage
Expand Down Expand Up @@ -391,8 +384,8 @@ spec:
x-descriptors:
- urn:alm:descriptor:com.amd.networkconfigs:useSourceImage
- description: 'version of the drivers source code, can be used as part of image
of dockerfile source image default value for different OS is: ubuntu: 1.117.1-a-42,
coreOS: 1.117.1-a-42'
of dockerfile source image default value for different OS is: ubuntu: 1.117.5-a-147,
coreOS: 1.117.5-a-147'
displayName: Version
path: driver.version
x-descriptors:
Expand Down
11 changes: 3 additions & 8 deletions helm-charts-k8s/crds/networkconfig-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
labels:
app.kubernetes.io/component: amd-network
app.kubernetes.io/part-of: amd-network
helm.sh/chart: network-operator-charts-v1.2.0
helm.sh/chart: network-operator-charts-v1.2.1
app.kubernetes.io/name: network-operator-charts
app.kubernetes.io/instance: amd-network
app.kubernetes.io/version: "dev"
Expand Down Expand Up @@ -203,13 +203,6 @@ spec:
devicePlugin:
description: device plugin
properties:
devicePluginArguments:
additionalProperties:
type: string
description: |-
device plugin arguments is used to pass supported flags and their values while starting device plugin daemonset
supported flag values: {"resource_naming_strategy": {"single", "mixed"}}
type: object
devicePluginImage:
description: device plugin image
pattern: ^([a-z0-9]+(?:[._-][a-z0-9]+)*(:[0-9]+)?)(/[a-z0-9]+(?:[._-][a-z0-9]+)*)*(?::[a-z0-9._-]+)?(?:@[a-zA-Z0-9]+:[a-f0-9]+)?$
Expand Down Expand Up @@ -663,6 +656,8 @@ spec:
description: Port is the internal port used for in-cluster and node
access to pull metrics from the metrics-exporter (default 5001).
format: int32
maximum: 65535
minimum: 1
type: integer
prometheus:
description: Prometheus configuration for metrics exporter
Expand Down
8 changes: 1 addition & 7 deletions internal/deviceplugin/deviceplugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

const (
defaultInitContainerImage = "busybox:1.36"
defaultDevicePluginImage = "docker.io/rocm/k8s-network-device-plugin:v1.2.0"
defaultDevicePluginImage = "docker.io/rocm/k8s-network-device-plugin:v1.2.1"
defaultDevicePluginConfigMap = "amd-network-operator-device-plugin-config"
devicePluginSAName = "amd-network-operator-device-plugin"
DevicePluginName = "device-plugin"
Expand Down Expand Up @@ -120,12 +120,6 @@ func GenerateCommonDevicePluginSpec(nwConfig *amdv1alpha1.NetworkConfig, isOpenS
dpOut.MainContainer.IsHostNetwork = true
dpOut.MainContainer.Command = []string{}

var commandArgs string
for key, val := range specIn.DevicePluginArguments {
commandArgs += " -" + key + "=" + val
}
//dpOut.MainContainer.Command = []string{"sh", "-c", commandArgs}

hostPathDirectory := v1.HostPathDirectory
hostPathDirectoryOrCreate := v1.HostPathDirectoryOrCreate
dpOut.MainContainer.Envs = []v1.EnvVar{
Expand Down
3 changes: 1 addition & 2 deletions internal/kmmmodule/kmmmodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const (
defaultOcDriversImageTemplate = "image-registry.openshift-image-registry.svc:5000/$MOD_NAMESPACE/amdnetwork_kmod"
// start local registry image-registry:5000 in k8s
defaultDriversImageTemplate = "image-registry:5000/$MOD_NAMESPACE/amdnetwork_kmod"
defaultOcDriversVersion = "1.117.5-a-56"
defaultInstallerRepoURL = "https://repo.radeon.com"
defaultInitContainerImage = "busybox:1.36"
defaultSourceImageRepo = "docker.io/rocm/amdainic-driver"
Expand Down Expand Up @@ -397,7 +396,7 @@ func getKM(nwConfig *amdv1alpha1.NetworkConfig, node v1.Node, inTreeModuleToRemo

if isOpenShift {
if driversVersion == "" {
driversVersion = defaultOcDriversVersion
driversVersion = utils.DefaultOcDriversVersion
}
if driversImage == "" {
driversImage = defaultOcDriversImageTemplate
Expand Down
23 changes: 10 additions & 13 deletions internal/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ import (
)

const (
defaultOcDriversVersion = "1.117.1-a-42"
defaultUbuntuDriversVersion = "1.117.1-a-42"
DefaultOcDriversVersion = "1.117.5-a-147"
DefaultUbuntuDriversVersion = "1.117.5-a-147"
openShiftNodeLabel = "node.openshift.io/os_id"
NodeFeatureLabelAmdNic = "feature.node.kubernetes.io/amd-nic"
NodeFeatureLabelAmdVNic = "feature.node.kubernetes.io/amd-vnic"
ResourceNamingStrategyFlag = "resource_naming_strategy"
SingleStrategy = "single"
MixedStrategy = "mixed"
DefaultUtilsImage = "docker.io/rocm/network-operator-utils:v1.2.0"
DefaultUtilsImage = "docker.io/rocm/network-operator-utils:v1.2.1"

// worker pod related constants
KindNetworkConfig = "NetworkConfig"
Expand Down Expand Up @@ -77,27 +74,27 @@ func GetDefaultDriversVersion(node v1.Node) (string, error) {
var defaultDriverversionsMappers = map[string]func(fullImageStr string) (string, error){
"ubuntu": UbuntuDefaultDriverVersionsMapper,
"rhel": func(f string) (string, error) {
return defaultOcDriversVersion, nil
return DefaultOcDriversVersion, nil
},
"redhat": func(f string) (string, error) {
return defaultOcDriversVersion, nil
return DefaultOcDriversVersion, nil
},
"red hat": func(f string) (string, error) {
return defaultOcDriversVersion, nil
return DefaultOcDriversVersion, nil
},
}

func UbuntuDefaultDriverVersionsMapper(fullImageStr string) (string, error) {
if strings.Contains(fullImageStr, "20.04") {
return defaultUbuntuDriversVersion, nil
return DefaultUbuntuDriversVersion, nil
}
if strings.Contains(fullImageStr, "22.04") {
return defaultUbuntuDriversVersion, nil
return DefaultUbuntuDriversVersion, nil
}
if strings.Contains(fullImageStr, "24.04") {
return defaultUbuntuDriversVersion, nil
return DefaultUbuntuDriversVersion, nil
}
return "", fmt.Errorf("invalid ubuntu version, should be one of [20.04, 22.04]")
return "", fmt.Errorf("invalid ubuntu version, should be one of [20.04, 22.04, 24.04]")
}

func HasNodeLabelKey(node v1.Node, labelKey string) bool {
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (s *E2ESuite) TestDriverInstallDefault(c *C) {
logger.Infof("create %v", s.cfgName)
netCfg := s.getNetworkConfig()
netCfg.Spec.Selector = vnicselector
netCfg.Spec.Driver.Version = ""
netCfg.Spec.Driver.Version = "1.117.1-a-42"
s.createNetworkConfig(netCfg, c)
s.verifyOperandReadiness(c, netCfg)
s.verifyNodeDriverVersionLabel(netCfg, c)
Expand Down Expand Up @@ -138,7 +138,7 @@ func (s *E2ESuite) TestParallelUpgrade(c *C) {
}{
{
name: "default version to specific version",
fromVersion: "",
fromVersion: "1.117.1-a-42",
toVersion: "1.117.1-a-63",
upgradePolicy: v1alpha1.DriverUpgradePolicySpec{
Enable: boolPtr(true),
Expand All @@ -149,7 +149,7 @@ func (s *E2ESuite) TestParallelUpgrade(c *C) {
{
name: "specific version to default version",
fromVersion: "1.117.1-a-63",
toVersion: "",
toVersion: "1.117.1-a-42",
upgradePolicy: v1alpha1.DriverUpgradePolicySpec{
Enable: boolPtr(true),
RebootRequired: boolPtr(false),
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var (
helmChart = flag.String("helmchart", "", "helm chart reference")
operatorNS = flag.String("namespace", "kube-amd-network", "operator namespace")
cfgName = flag.String("networkConfigName", "networkconfig-example", "NetworkConfig name")
driverVersion = flag.String("driverVersion", "1.117.1-a-42", "driver version")
driverVersion = flag.String("driverVersion", "1.117.5-a-147", "driver version")
openshift = flag.Bool("openshift", false, "openshift deployment")
simEnable = flag.Bool("simEnable", false, "simulate (no hardware)")
ciEnv = flag.Bool("ciEnv", false, "CI environment")
Expand Down