-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mamduh Alassi <[email protected]>
- Loading branch information
Showing
18 changed files
with
1,131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v2 | ||
name: sriov-network-operator | ||
version: 0.1.0 | ||
kubeVersion: '>= 1.16.0' | ||
appVersion: 4.7.0 | ||
description: SR-IOV network operator configures and manages SR-IOV networks in the kubernetes cluster | ||
type: application | ||
keywords: | ||
- sriov | ||
home: https://github.com/k8snetworkplumbingwg/sriov-network-operator | ||
sources: | ||
- https://github.com/k8snetworkplumbingwg/sriov-network-operator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# SR-IOV Network Operator Helm Chart | ||
|
||
SR-IOV Network Operator Helm Chart provides an easy way to install, configure and manage | ||
the lifecycle of SR-IOV network operator. | ||
|
||
## SR-IOV Network Operator | ||
SR-IOV Network Operator leverages [Kubernetes CRDs](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) | ||
and [Operator SDK](https://github.com/operator-framework/operator-sdk) to configure and manage SR-IOV networks in a Kubernetes cluster. | ||
|
||
SR-IOV Network Operator features: | ||
- Initialize the supported SR-IOV NIC types on selected nodes. | ||
- Provision/upgrade SR-IOV device plugin executable on selected node. | ||
- Provision/upgrade SR-IOV CNI plugin executable on selected nodes. | ||
- Manage configuration of SR-IOV device plugin on host. | ||
- Generate net-att-def CRs for SR-IOV CNI plugin | ||
- Supports operation in a virtualized Kubernetes deployment | ||
- Discovers VFs attached to the Virtual Machine (VM) | ||
- Does not require attached of associated PFs | ||
- VFs can be associated to SriovNetworks by selecting the appropriate PciAddress as the RootDevice in the SriovNetworkNodePolicy | ||
|
||
## QuickStart | ||
|
||
### Prerequisites | ||
|
||
- Kubernetes v1.17+ | ||
- Helm v3 | ||
|
||
### Install Helm | ||
|
||
Helm provides an install script to copy helm binary to your system: | ||
``` | ||
$ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | ||
$ chmod 500 get_helm.sh | ||
$ ./get_helm.sh | ||
``` | ||
|
||
For additional information and methods for installing Helm, refer to the official [helm website](https://helm.sh/) | ||
|
||
### Deploy SR-IOV Network Operator | ||
|
||
``` | ||
# Install Operator | ||
$ helm install -n sriov-network-operator --create-namespace --wait sriov-network-operator ./ | ||
# View deployed resources | ||
$ kubectl -n sriov-network-operator get pods | ||
``` | ||
|
||
## Chart parameters | ||
|
||
In order to tailor the deployment of the network operator to your cluster needs | ||
We have introduced the following Chart parameters. | ||
|
||
### Operator parameters | ||
|
||
| Name | Type | Default | description | | ||
| ---- | ---- | ------- | ----------- | | ||
| `operator.resourcePrefix` | string | `openshift.io` | Device plugin resource prefix | | ||
| `operator.enableAdmissionController` | bool | `false` | Enable SR-IOV network resource injector and operator webhook | | ||
| `operator.cniBinPath` | string | `/opt/cni/bin` | Path for CNI binary | | ||
| `operator.clusterType` | string | `kubernetes` | Cluster environment type | | ||
|
||
### Images parameters | ||
|
||
| Name | description | | ||
| ---- | ----------- | | ||
| `images.operator` | Operator controller image | | ||
| `images.sriovConfigDaemon` | Daemon node agent image | | ||
| `images.sriovCni` | SR-IOV CNI image | | ||
| `images.ibSriovCni` | InfiniBand SR-IOV CNI image | | ||
| `images.sriovDevicePlugin` | SR-IOV device plugin image | | ||
| `images.resourcesInjector` | Resources Injector image | | ||
| `images.webhook` | Operator Webhook image | |
57 changes: 57 additions & 0 deletions
57
deployment/sriov-network-operator/crds/k8s.cni.cncf.io_networkattachmentdefinitions_crd.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Copyright 2020 NVIDIA | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: network-attachment-definitions.k8s.cni.cncf.io | ||
spec: | ||
group: k8s.cni.cncf.io | ||
scope: Namespaced | ||
names: | ||
plural: network-attachment-definitions | ||
singular: network-attachment-definition | ||
kind: NetworkAttachmentDefinition | ||
shortNames: | ||
- net-attach-def | ||
versions: | ||
- name: v1 | ||
served: true | ||
storage: true | ||
schema: | ||
openAPIV3Schema: | ||
description: 'NetworkAttachmentDefinition is a CRD schema specified by the Network Plumbing | ||
Working Group to express the intent for attaching pods to one or more logical or physical | ||
networks. More information available at: https://github.com/k8snetworkplumbingwg/multi-net-spec' | ||
type: object | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this represen | ||
tation of an object. Servers should convert recognized schemas to the | ||
latest internal value, and may reject unrecognized values. More info: | ||
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: 'NetworkAttachmentDefinition spec defines the desired state of a network attachment' | ||
type: object | ||
properties: | ||
config: | ||
description: 'NetworkAttachmentDefinition config is a JSON-formatted CNI configuration' | ||
type: string |
79 changes: 79 additions & 0 deletions
79
deployment/sriov-network-operator/crds/sriovnetwork.openshift.io_sriovibnetworks.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.3.0 | ||
creationTimestamp: null | ||
name: sriovibnetworks.sriovnetwork.openshift.io | ||
spec: | ||
group: sriovnetwork.openshift.io | ||
names: | ||
kind: SriovIBNetwork | ||
listKind: SriovIBNetworkList | ||
plural: sriovibnetworks | ||
singular: sriovibnetwork | ||
scope: Namespaced | ||
versions: | ||
- name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
description: SriovIBNetwork is the Schema for the sriovibnetworks API | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: SriovIBNetworkSpec defines the desired state of SriovIBNetwork | ||
properties: | ||
capabilities: | ||
description: 'Capabilities to be configured for this network. Capabilities | ||
supported: (infinibandGUID), e.g. ''{"infinibandGUID": true}''' | ||
type: string | ||
ipam: | ||
description: IPAM configuration to be used for this network. | ||
type: string | ||
linkState: | ||
description: VF link state (enable|disable|auto) | ||
enum: | ||
- auto | ||
- enable | ||
- disable | ||
type: string | ||
metaPlugins: | ||
description: MetaPluginsConfig configuration to be used in order to | ||
chain metaplugins to the sriov interface returned by the operator. | ||
type: string | ||
networkNamespace: | ||
description: Namespace of the NetworkAttachmentDefinition custom resource | ||
type: string | ||
resourceName: | ||
description: SRIOV Network device plugin endpoint resource name | ||
type: string | ||
required: | ||
- resourceName | ||
type: object | ||
status: | ||
description: SriovIBNetworkStatus defines the observed state of SriovIBNetwork | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
133 changes: 133 additions & 0 deletions
133
...yment/sriov-network-operator/crds/sriovnetwork.openshift.io_sriovnetworknodepolicies.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.3.0 | ||
creationTimestamp: null | ||
name: sriovnetworknodepolicies.sriovnetwork.openshift.io | ||
spec: | ||
group: sriovnetwork.openshift.io | ||
names: | ||
kind: SriovNetworkNodePolicy | ||
listKind: SriovNetworkNodePolicyList | ||
plural: sriovnetworknodepolicies | ||
singular: sriovnetworknodepolicy | ||
scope: Namespaced | ||
versions: | ||
- name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
description: SriovNetworkNodePolicy is the Schema for the sriovnetworknodepolicies | ||
API | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: SriovNetworkNodePolicySpec defines the desired state of SriovNetworkNodePolicy | ||
properties: | ||
deviceType: | ||
description: The driver type for configured VFs. Allowed value "netdevice", | ||
"vfio-pci". Defaults to netdevice. | ||
enum: | ||
- netdevice | ||
- vfio-pci | ||
type: string | ||
eSwitchMode: | ||
description: NIC Device Mode. Allowed value "legacy","switchdev". | ||
enum: | ||
- legacy | ||
- switchdev | ||
type: string | ||
isRdma: | ||
description: RDMA mode. Defaults to false. | ||
type: boolean | ||
linkType: | ||
description: NIC Link Type. Allowed value "eth", "ETH", "ib", and | ||
"IB". | ||
enum: | ||
- eth | ||
- ETH | ||
- ib | ||
- IB | ||
type: string | ||
mtu: | ||
description: MTU of VF | ||
minimum: 1 | ||
type: integer | ||
nicSelector: | ||
description: NicSelector selects the NICs to be configured | ||
properties: | ||
deviceID: | ||
description: The device hex code of SR-IoV device. Allowed value | ||
"0d58", "1572", "158b", "1013", "1015", "1017", "101b". | ||
type: string | ||
netFilter: | ||
description: Infrastructure Networking selection filter. Allowed | ||
value "openstack/NetworkID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
type: string | ||
pfNames: | ||
description: Name of SR-IoV PF. | ||
items: | ||
type: string | ||
type: array | ||
rootDevices: | ||
description: PCI address of SR-IoV PF. | ||
items: | ||
type: string | ||
type: array | ||
vendor: | ||
description: The vendor hex code of SR-IoV device. Allowed value | ||
"8086", "15b3". | ||
type: string | ||
type: object | ||
nodeSelector: | ||
additionalProperties: | ||
type: string | ||
description: NodeSelector selects the nodes to be configured | ||
type: object | ||
numVfs: | ||
description: Number of VFs for each PF | ||
minimum: 0 | ||
type: integer | ||
priority: | ||
description: Priority of the policy, higher priority policies can | ||
override lower ones. | ||
maximum: 99 | ||
minimum: 0 | ||
type: integer | ||
resourceName: | ||
description: SRIOV Network device plugin endpoint resource name | ||
type: string | ||
required: | ||
- nicSelector | ||
- nodeSelector | ||
- numVfs | ||
- resourceName | ||
type: object | ||
status: | ||
description: SriovNetworkNodePolicyStatus defines the observed state of | ||
SriovNetworkNodePolicy | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
Oops, something went wrong.