Skip to content

Commit

Permalink
Add deployment support for nic-feature-discovery
Browse files Browse the repository at this point in the history
Update Helm chart and templates

Signed-off-by: adrianc <adrianc@nvidia.com>
  • Loading branch information
adrianchiris committed Aug 21, 2023
1 parent 5cc4b70 commit 31064a6
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 11 deletions.
35 changes: 24 additions & 11 deletions deployment/network-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ parameters.

### General parameters

| Name | Type | Default | description |
| Name | Type | Default | Description |
|------------------------------------------------------|--------|------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `nfd.enabled` | bool | `True` | deploy Node Feature Discovery |
| `nfd.deployNodeFeatureRules` | bool | `True` | deploy Node Feature Rules to label the nodes |
Expand Down Expand Up @@ -373,7 +373,7 @@ imagePullSecrets:

#### Mellanox OFED driver

| Name | Type | Default | description |
| Name | Type | Default | Description |
| ---- | ---- | ------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ofedDriver.deploy` | bool | `false` | deploy Mellanox OFED driver container |
| `ofedDriver.repository` | string | `mellanox` | Mellanox OFED driver image repository |
Expand All @@ -393,7 +393,7 @@ imagePullSecrets:

#### RDMA Device Plugin

| Name | Type | Default | description |
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| `rdmaSharedDevicePlugin.deploy` | bool | `true` | Deploy RDMA Shared device plugin |
| `rdmaSharedDevicePlugin.repository` | string | `nvcr.io/nvidia/cloud-native` | RDMA Shared device plugin image repository |
Expand Down Expand Up @@ -425,7 +425,7 @@ resources:

#### SR-IOV Network Device plugin

| Name | Type | Default | description |
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| `sriovDevicePlugin.deploy` | bool | `false` | Deploy SR-IOV Network device plugin |
| `sriovDevicePlugin.repository` | string | `ghcr.io/k8snetworkplumbingwg` | SR-IOV Network device plugin image repository |
Expand Down Expand Up @@ -464,7 +464,7 @@ Create/Update/Delete), reading the Pod's network annotation and fetching its cor
PKey, to add the newly generated Guid or the predefined Guid in guid field of CRD cni-args to that PKey, for pods with
annotation mellanox.infiniband.app.

| Name | Type | Default | description |
| Name | Type | Default | Description |
|---------------------------------------|--------|---------------------------|---------------------------------------------------------------------------------------------|
| `ibKubernetes.deploy` | bool | `false` | Deploy IB Kubernetes |
| `ibKubernetes.repository` | string | `ghcr.io/mellanox` | IB Kubernetes image repository |
Expand Down Expand Up @@ -501,7 +501,7 @@ data:
#### Secondary Network

| Name | Type | Default | description |
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| `secondaryNetwork.deploy` | bool | `true` | Deploy Secondary Network |

Expand All @@ -515,7 +515,7 @@ optionally deployed components:

##### CNI Plugin Secondary Network

| Name | Type | Default | description |
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| `cniPlugins.deploy` | bool | `true` | Deploy CNI Plugins Secondary Network |
| `cniPlugins.image` | string | `plugins` | CNI Plugins image name |
Expand All @@ -525,7 +525,7 @@ optionally deployed components:

##### Multus CNI Secondary Network

| Name | Type | Default | description |
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| `multus.deploy` | bool | `true` | Deploy Multus Secondary Network |
| `multus.image` | string | `multus-cni` | Multus image name |
Expand All @@ -536,7 +536,7 @@ optionally deployed components:

##### IPoIB CNI

| Name | Type | Default | description |
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| `ipoib.deploy` | bool | `false` | Deploy IPoIB CNI |
| `ipoib.image` | string | `ipoib-cni` | IPoIB CNI image name |
Expand All @@ -546,7 +546,7 @@ optionally deployed components:

##### IPAM CNI Plugin Secondary Network

| Name | Type | Default | description |
| Name | Type | Default | Description |
| ----------------------------- | ------ |--------------------------------| ----------- |
| `ipamPlugin.deploy` | bool | `true` | Deploy IPAM CNI Plugin Secondary Network |
| `ipamPlugin.image` | string | `whereabouts` | IPAM CNI Plugin image name |
Expand All @@ -556,7 +556,7 @@ optionally deployed components:

#### NVIDIA IPAM Plugin

| Name | Type | Default | description |
| Name | Type | Default | Description |
| ------------------------- | ------ |--------------------| -----------------------------------------------------------------------------------------|
| `nvIpam.deploy` | bool | `false` | Deploy NVIDIA IPAM Plugin |
| `nvIpam.image` | string | `nvidia-k8s-ipam` | NVIDIA IPAM Plugin image name |
Expand All @@ -565,6 +565,19 @@ optionally deployed components:
| `nvIpam.imagePullSecrets` | list | `[]` | An optional list of references to secrets to use for pulling any of the Plugin image |
| `nvIpam.config` | string | `"{"pools": {"rdma-pool": {"subnet": "192.168.0.0/16", "perNodeBlockSize": 100, "gateway": "192.168.0.1"}}}"` | Network pool configuration as described in [nvidia-k8s-ipam](https://github.com/Mellanox/nvidia-k8s-ipam), the default defines a single IP Pool named `"rdma-pool"`|

#### NVIDIA NIC Feature Discovery

[NVIDIA NIC Feature Discovery](https://github.com/Mellanox/nic-feature-discovery)
leverages [Node Feature Discovery](https://kubernetes-sigs.github.io/node-feature-discovery/stable/get-started/index.html)
to advertise NIC specific labels on K8s Node objects.

| Name | Type | Default | Description |
| -------------------------------- | ------ | ----------------------- | --------------------------------------------- |
| `nicFeatureDiscovery.deploy` | bool | `false` | Deploy NVIDIA NIC Feature Discovery |
| `nicFeatureDiscovery.image` | string | `nic-feature-discovery` | NVIDIA NIC Feature Discovery image name |
| `nicFeatureDiscovery.repository` | string | `ghcr.io/mellanox` | NVIDIA NIC Feature Discovery image repository |
| `nicFeatureDiscovery.version` | string | `v0.0.1` | NVIDIA NIC Feature Discovery image version |

## Deployment Examples

As there are several parameters that are required to be provided to create the custom resource during operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,28 @@ spec:
- repository
- version
type: object
nicFeatureDiscovery:
description: NicFeatureDiscoverySpec describes configuration options
for nic-feature-discovery
properties:
image:
pattern: '[a-zA-Z0-9\-]+'
type: string
imagePullSecrets:
items:
type: string
type: array
repository:
pattern: '[a-zA-Z0-9\.\-\/]+'
type: string
version:
pattern: '[a-zA-Z0-9\.-]+'
type: string
required:
- image
- repository
- version
type: object
nodeAffinity:
description: Node affinity is a group of node affinity scheduling
rules.
Expand Down
16 changes: 16 additions & 0 deletions deployment/network-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,19 @@ imagePullSecrets helpers
{{- end }}
{{- $imagePullSecrets | toJson }}
{{- end }}

{{- define "network-operator.nicFeatureDiscovery.imagePullSecrets" }}
{{- $imagePullSecrets := list }}
{{- if .Values.nicFeatureDiscovery.imagePullSecrets }}
{{- range .Values.nicFeatureDiscovery.imagePullSecrets }}
{{- $imagePullSecrets = append $imagePullSecrets . }}
{{- end }}
{{- else }}
{{- if .Values.imagePullSecrets }}
{{- range .Values.imagePullSecrets }}
{{- $imagePullSecrets = append $imagePullSecrets . }}
{{- end }}
{{- end }}
{{- end }}
{{- $imagePullSecrets | toJson }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,11 @@ spec:
config: {{ .Values.nvIpam.config | quote }}
{{- end }}
{{- end }}
{{- if .Values.nicFeatureDiscovery.deploy }}
nicFeatureDiscovery:
image: {{ .Values.nicFeatureDiscovery.image }}
repository: {{ .Values.nicFeatureDiscovery.repository }}
version: {{ .Values.nicFeatureDiscovery.version }}
imagePullSecrets: {{ include "network-operator.nicFeatureDiscovery.imagePullSecrets" . }}
{{- end }}
{{ end }}
7 changes: 7 additions & 0 deletions deployment/network-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,13 @@ secondaryNetwork:
version: v0.6.1-amd64
# imagePullSecrets: []

nicFeatureDiscovery:
deploy: false
image: nic-feature-discovery
repository: ghcr.io/mellanox
version: v0.0.1
# imagePullSecrets: []

# Can be set to nicclusterpolicy and override other ds node affinity,
# e.g. https://github.com/Mellanox/network-operator/blob/master/manifests/state-multus-cni/0050-multus-ds.yml#L26-L36
#nodeAffinity:
Expand Down
2 changes: 2 additions & 0 deletions hack/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Release struct {
Ipoib *mellanoxv1alpha1.ImageSpec
IpamPlugin *mellanoxv1alpha1.ImageSpec
NvIPAM *mellanoxv1alpha1.ImageSpec
NicFeatureDiscovery *mellanoxv1alpha1.ImageSpec
}

func readDefaults(releaseDefaults string) Release {
Expand Down Expand Up @@ -88,6 +89,7 @@ func readEnvironmentVariables(release *Release) {
initWithEnvVariale("IPOIB", release.Ipoib)
initWithEnvVariale("IPAM_PLUGIN", release.Ipoib)
initWithEnvVariale("NV_IPAM", release.NvIPAM)
initWithEnvVariale("NIC_FEATURE_DISCOVERY", release.NicFeatureDiscovery)
}

func main() {
Expand Down
4 changes: 4 additions & 0 deletions hack/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ nvIpam:
image: nvidia-k8s-ipam
repository: ghcr.io/mellanox
version: v0.0.3
nicFeatureDiscovery:
image: nic-feature-discovery
repository: ghcr.io/mellanox
version: v0.0.1
7 changes: 7 additions & 0 deletions hack/templates/values/values.template
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,13 @@ secondaryNetwork:
version: {{ .IpamPlugin.Version }}
# imagePullSecrets: []

nicFeatureDiscovery:
deploy: false
image: {{ .NicFeatureDiscovery.Image }}
repository: {{ .NicFeatureDiscovery.Repository }}
version: {{ .NicFeatureDiscovery.Version }}
# imagePullSecrets: []

# Can be set to nicclusterpolicy and override other ds node affinity,
# e.g. https://github.com/Mellanox/network-operator/blob/master/manifests/state-multus-cni/0050-multus-ds.yml#L26-L36
#nodeAffinity:
Expand Down

0 comments on commit 31064a6

Please sign in to comment.