diff --git a/examples/clusterrole.yml b/examples/clusterrole.yml deleted file mode 100644 index afc34ac5..00000000 --- a/examples/clusterrole.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: multus-crd-overpowered -rules: - - apiGroups: ["k8s.cni.cncf.io"] - resources: - - '*' - verbs: - - '*' - - apiGroups: - - "" - resources: - - pods - - pods/status - verbs: - - get - - update diff --git a/examples/cni-configuration.conf b/examples/cni-configuration.conf deleted file mode 100644 index bd0301f3..00000000 --- a/examples/cni-configuration.conf +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "multus-cni-network", - "type": "multus", - "delegates": [ - { - "type": "flannel", - "delegate": { - "isDefaultGateway": true - } - } - ], - "kubeconfig": "/etc/kubernetes/kubelet.conf" -} diff --git a/examples/crd.yml b/examples/crd.yml deleted file mode 100644 index 1dac3ae7..00000000 --- a/examples/crd.yml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: network-attachment-definitions.k8s.cni.cncf.io -spec: - group: k8s.cni.cncf.io - version: v1 - scope: Namespaced - names: - plural: network-attachment-definitions - singular: network-attachment-definition - kind: NetworkAttachmentDefinition - shortNames: - - net-attach-def - validation: - openAPIV3Schema: - properties: - spec: - properties: - config: - type: string diff --git a/examples/flannel-conf.yml b/examples/flannel-conf.yml deleted file mode 100644 index 64b431e8..00000000 --- a/examples/flannel-conf.yml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition -metadata: - name: flannel-conf -spec: - config: '{ - "cniVersion": "0.3.0", - "type": "flannel", - "delegate": { - "isDefaultGateway": true - } - }' diff --git a/examples/macvlan-conf.yml b/examples/macvlan-conf.yml deleted file mode 100644 index e393dda0..00000000 --- a/examples/macvlan-conf.yml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition -metadata: - name: macvlan-conf -spec: - config: '{ - "cniVersion": "0.3.0", - "type": "macvlan", - "master": "eth0", - "mode": "bridge", - "ipam": { - "type": "host-local", - "subnet": "192.168.1.0/24", - "rangeStart": "192.168.1.200", - "rangeEnd": "192.168.1.216", - "routes": [ - { "dst": "0.0.0.0/0" } - ], - "gateway": "192.168.1.1" - } - }' diff --git a/examples/macvlan-pod.yml b/examples/macvlan-pod.yml new file mode 100644 index 00000000..46fba45e --- /dev/null +++ b/examples/macvlan-pod.yml @@ -0,0 +1,56 @@ +--- +# This net-attach-def defines macvlan-conf with +# + ips capabilities to specify ip in pod annotation and +# + mac capabilities to specify mac address in pod annotation +# default gateway is defined as well +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: macvlan-conf +spec: + config: '{ + "cniVersion": "0.3.1", + "plugins": [ + { + "type": "macvlan", + "capabilities": { "ips": true }, + "master": "eth0", + "mode": "bridge", + "ipam": { + "type": "static", + "routes": [ + { + "dst": "0.0.0.0/0", + "gw": "10.1.1.1" + } + ] + } + }, { + "capabilities": { "mac": true }, + "type": "tuning" + } + ] + }' +--- +# Define a pod with macvlan-conf, defined above, with ip address and mac, and +# "gateway" overrides default gateway to use macvlan-conf's one. +# without "gateway" in k8s.v1.cni.cncf.io/networks, default route will be cluster +# network interface, eth0, even tough macvlan-conf has default gateway config. +apiVersion: v1 +kind: Pod +metadata: + name: samplepod + annotations: + k8s.v1.cni.cncf.io/networks: '[ + { "name": "macvlan-conf", + "ips": [ "10.1.1.101/24" ], + "mac": "c2:b0:57:49:47:f1", + "gateway": [ "10.1.1.1" ] + }]' +spec: + containers: + - name: samplepod + command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"] + image: dougbtv/centos-network + ports: + - containerPort: 80 diff --git a/examples/multus-ptp-portmap.conf b/examples/multus-ptp-portmap.conf deleted file mode 100644 index d092c7c5..00000000 --- a/examples/multus-ptp-portmap.conf +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "multus-cni-network", - "type": "multus" - "capabilities": { - "portMappings": true - }, - "delegates": [ - { - "cniVersion": "0.3.1", - "name": "ptp-tuning-conflist", - "plugins": [ - { - "dns": { - "nameservers": [ - "172.16.1.1" - ] - }, - "ipMasq": true, - "ipam": { - "subnet": "172.16.0.0/24", - "type": "host-local" - }, - "mtu": 512, - "type": "ptp" - }, - { - "capabilities": { - "portMappings": true - }, - "externalSetMarkChain": "KUBE-MARK-MASQ", - "type": "portmap" - } - ] - } - ], -} diff --git a/examples/multus-with-flannel.yml b/examples/multus-with-flannel.yml deleted file mode 100644 index 9aae8895..00000000 --- a/examples/multus-with-flannel.yml +++ /dev/null @@ -1,163 +0,0 @@ -# ----------------------------------------------- -# - Example Configuration Deployment -# ----------------------------------------------- -# - Deploys a .conf file on each node -# - Configured for Multus + Flannel. -# - As well as assets for Flannel -# - Based on https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml -# ----------------------------------------------- ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: flannel -rules: - - apiGroups: - - "" - resources: - - pods - verbs: - - get - - apiGroups: - - "" - resources: - - nodes - verbs: - - list - - watch - - apiGroups: - - "" - resources: - - nodes/status - verbs: - - patch ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: flannel -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: flannel -subjects: -- kind: ServiceAccount - name: flannel - namespace: kube-system ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: flannel - namespace: kube-system ---- -kind: ConfigMap -apiVersion: v1 -metadata: - name: kube-multus-cfg - namespace: kube-system - labels: - tier: node - app: multus -data: - cni-conf.json: | - { - "name": "multus-cni-network", - "type": "multus", - "delegates": [ - { - "type": "flannel", - "delegate": { - "isDefaultGateway": true - } - } - ], - "kubeconfig": "/etc/kubernetes/kubelet.conf" - } - net-conf.json: | - { - "Network": "10.244.0.0/16", - "Backend": { - "Type": "vxlan" - } - } ---- -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: kube-multus-ds - namespace: kube-system - labels: - tier: node - app: multus -spec: - updateStrategy: - type: RollingUpdate - template: - metadata: - labels: - tier: node - app: multus - spec: - hostNetwork: true - nodeSelector: - beta.kubernetes.io/arch: amd64 - tolerations: - - operator: Exists - effect: NoSchedule - serviceAccountName: flannel - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.10.0-amd64 - command: - - cp - args: - - -f - - /etc/kube-flannel/cni-conf.json - - /etc/cni/net.d/10-multus-with-flannel.conf - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: multus-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel - image: quay.io/coreos/flannel:v0.10.0-amd64 - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --kube-subnet-mgr - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: true - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run - - name: multus-cfg - mountPath: /etc/kube-flannel/ - volumes: - - name: run - hostPath: - path: /run - - name: cni - hostPath: - path: /etc/cni/net.d - - name: multus-cfg - configMap: - name: kube-multus-cfg diff --git a/examples/net-resource-sample-pod.yaml b/examples/net-resource-sample-pod.yaml deleted file mode 100644 index 3f6eb068..00000000 --- a/examples/net-resource-sample-pod.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: testpod1 - labels: - env: test - annotations: - k8s.v1.cni.cncf.io/networks: sriov-net-a -spec: - containers: - - name: appcntr1 - image: centos/tools - imagePullPolicy: IfNotPresent - command: [ "/bin/bash", "-c", "--" ] - args: [ "while true; do sleep 300000; done;" ] - resources: - requests: - intel.com/sriov: '1' - limits: - intel.com/sriov: '1' - restartPolicy: "Never" diff --git a/examples/npwg-demo-1/01_crd.yml b/examples/npwg-demo-1/01_crd.yml deleted file mode 100644 index 7b74a5f0..00000000 --- a/examples/npwg-demo-1/01_crd.yml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - # name must match the spec fields below, and be in the form: . - name: network-attachment-definitions.k8s.cni.cncf.io -spec: - # group name to use for REST API: /apis// - group: k8s.cni.cncf.io - # version name to use for REST API: /apis// - version: v1 - # either Namespaced or Cluster - scope: Namespaced - names: - # plural name to be used in the URL: /apis/// - plural: network-attachment-definitions - # singular name to be used as an alias on the CLI and for display - singular: network-attachment-definition - # kind is normally the CamelCased singular type. Your resource manifests use this. - kind: NetworkAttachmentDefinition - # shortNames allow shorter string to match your resource on the CLI - shortNames: - - net-attach-def - validation: - openAPIV3Schema: - properties: - spec: - properties: - config: - type: string - diff --git a/examples/npwg-demo-1/02_clusterrole.yml b/examples/npwg-demo-1/02_clusterrole.yml deleted file mode 100644 index d374cca5..00000000 --- a/examples/npwg-demo-1/02_clusterrole.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: multus -rules: -- apiGroups: - - '*' - resources: - - '*' - verbs: - - '*' -- nonResourceURLs: - - '*' - verbs: - - '*' diff --git a/examples/npwg-demo-1/03_namespace1.yml b/examples/npwg-demo-1/03_namespace1.yml deleted file mode 100644 index aa3b0bc9..00000000 --- a/examples/npwg-demo-1/03_namespace1.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -apiVersion: v1 -kind: Namespace -metadata: - name: testns1 diff --git a/examples/npwg-demo-1/04_macvlan1.yml b/examples/npwg-demo-1/04_macvlan1.yml deleted file mode 100644 index 2150d9d9..00000000 --- a/examples/npwg-demo-1/04_macvlan1.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition -metadata: - name: macvlan-conf-1 -spec: - config: '{ - "cniVersion": "0.3.0", - "type": "macvlan", - "master": "eth1", - "mode": "bridge", - "ipam": { - "type": "static", - "addresses": [ - { "address": "10.1.1.101/24" } - ] - } - }' ---- -apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition -metadata: - name: macvlan-conf-2 -spec: - config: '{ - "cniVersion": "0.3.0", - "type": "macvlan", - "master": "eth1", - "mode": "bridge", - "ipam": { - "type": "static", - "addresses": [ - { "address": "10.1.1.102/24" } - ] - } - }' ---- -apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition -metadata: - name: macvlan-conf-3 -spec: - config: '{ - "cniVersion": "0.3.0", - "type": "macvlan", - "master": "eth1", - "mode": "bridge", - "ipam": { - "type": "static", - "addresses": [ - { "address": "10.1.1.103/24" } - ] - } - }' ---- -apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition -metadata: - name: macvlan-conf-4 -spec: - config: '{ - "cniVersion": "0.3.0", - "type": "macvlan", - "master": "eth1", - "mode": "bridge", - "ipam": { - "type": "static", - "addresses": [ - { "address": "10.1.1.104/24" } - ] - } - }' diff --git a/examples/npwg-demo-1/05_vlan1.yml b/examples/npwg-demo-1/05_vlan1.yml deleted file mode 100644 index 4a7db4fc..00000000 --- a/examples/npwg-demo-1/05_vlan1.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition -metadata: - name: vlan-conf-1-1 - namespace: testns1 -spec: - config: '{ - "cniVersion": "0.3.0", - "type": "vlan", - "master": "eth1", - "vlanid": 1, - "ipam": { - "type": "static", - "addresses": [ - { "address": "172.16.1.101/24" - } ] - } - }' diff --git a/examples/npwg-demo-1/06_flannel2.yml b/examples/npwg-demo-1/06_flannel2.yml deleted file mode 100644 index 95d04bce..00000000 --- a/examples/npwg-demo-1/06_flannel2.yml +++ /dev/null @@ -1,196 +0,0 @@ ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: flannel2 - namespace: kube-system -rules: - - apiGroups: - - "" - resources: - - pods - verbs: - - get - - apiGroups: - - "" - resources: - - nodes - verbs: - - list - - watch - - apiGroups: - - "" - resources: - - nodes/status - verbs: - - patch ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: flannel2 - namespace: kube-system -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: flannel2 -subjects: -- kind: ServiceAccount - name: flannel2 - namespace: kube-system ---- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: flannel2 - namespace: kube-system ---- -kind: ConfigMap -apiVersion: v1 -metadata: - name: kube-flannel2-cfg - namespace: kube-system - labels: - tier: node - app: flannel2 -data: - flannel2-conf.json: | - { - "type": "flannel", - "name": "flannel-2", - "subnetFile": "/run/flannel/flannel2.env", - "dataDir": "/var/lib/cni/flannel2", - "delegate": { - "bridge": "kbr1" - } - } - net-conf.json: | - { - "Network": "10.144.0.0/16", - "SubnetLen": 24, - "SubnetMin": "10.144.0.0", - "Backend": { - "Type": "vxlan" - } - } ---- -apiVersion: v1 -kind: Pod -metadata: - name: flannel-etcd - namespace: kube-system -spec: - containers: - - command: - - etcd - - --advertise-client-urls=http://10.1.1.1:12379 - - --listen-client-urls=http://0.0.0.0:12379 - - --listen-peer-urls=http://localhost:12380 - image: quay.io/coreos/etcd:latest - name: etcd - hostNetwork: true - nodeName: kube-master ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: flannel-etcdctl - namespace: kube-system -spec: - template: - spec: - containers: - - name: flannel-etcdctl - image: quay.io/coreos/etcd:latest - command: ["etcdctl"] - args: ["--endpoints=http://10.1.1.1:12379", "set", "/flannel2/network/config", '{ "Network": "10.5.0.0/16", "Backend": {"Type": "vxlan", "VNI": 2}}'] - hostNetwork: true - nodeName: kube-master - restartPolicy: Never ---- -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: kube-flannel2-ds - namespace: kube-system - labels: - tier: node - app: flannel2 -spec: - updateStrategy: - type: RollingUpdate - template: - metadata: - labels: - tier: node - app: flannel2 - spec: - hostNetwork: true - nodeSelector: - beta.kubernetes.io/arch: amd64 - tolerations: - - key: node-role.kubernetes.io/master - operator: Exists - effect: NoSchedule - serviceAccountName: flannel2 - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.10.0-amd64 - command: - - cp - args: - - -f - - /etc/kube-flannel/flannel2-conf.json - - /etc/cni/multus/net.d/10-flannel.conf - volumeMounts: - - name: cni - mountPath: /etc/cni/multus/net.d - - name: flannel2-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel2 - image: quay.io/coreos/flannel:v0.10.0-amd64 - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --etcd-endpoints=http://10.1.1.1:12379 - - -iface=eth1 - - -subnet-file=/run/flannel/flannel2.env - - -etcd-prefix=/flannel2/network - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: true - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run - volumes: - - name: run - hostPath: - path: /run - - name: cni - hostPath: - path: /etc/cni/multus/net.d - - name: flannel2-cfg - configMap: - name: kube-flannel2-cfg ---- -apiVersion: "kubernetes.cni.cncf.io/v1" -kind: Network -metadata: - name: flannel-2 diff --git a/examples/npwg-demo-1/07_ptp_tuning_conflist.yml b/examples/npwg-demo-1/07_ptp_tuning_conflist.yml deleted file mode 100644 index 13de5670..00000000 --- a/examples/npwg-demo-1/07_ptp_tuning_conflist.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition -metadata: - name: ptp-tuning-conflist -spec: - config: '{ - "cniVersion": "0.3.1", - "name": "ptp-tuning-conflist", - "plugins": [{ - "type": "ptp", - "ipMasq": true, - "mtu": 512, - "ipam": { - "type": "host-local", - "subnet": "172.16.0.0/24" - }, - "dns": { - "nameservers": ["172.16.1.1"] - } - }, - { - "name": "mytuning", - "type": "tuning", - "sysctl": { - "net.core.somaxconn": "500" - } - } - ] -}' diff --git a/examples/npwg-demo-1/11_pod_case1.yml b/examples/npwg-demo-1/11_pod_case1.yml deleted file mode 100644 index 52ed71ce..00000000 --- a/examples/npwg-demo-1/11_pod_case1.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: pod-case-01 - annotations: - k8s.v1.cni.cncf.io/networks: macvlan-conf-1 -spec: - containers: - - name: pod-case-01 - image: docker.io/centos/tools:latest - command: - - /sbin/init diff --git a/examples/npwg-demo-1/12_pod_case2.yml b/examples/npwg-demo-1/12_pod_case2.yml deleted file mode 100644 index 8923333c..00000000 --- a/examples/npwg-demo-1/12_pod_case2.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: pod-case-02 - annotations: - k8s.v1.cni.cncf.io/networks: '[ - { "name": "macvlan-conf-2" }, - { "name": "vlan-conf-1-1", - "namespace": "testns1", - "interface": "vlan1-1" } - ]' -spec: - containers: - - name: pod-case-02 - image: docker.io/centos/tools:latest - command: - - /sbin/init diff --git a/examples/npwg-demo-1/13_pod_case3.yml b/examples/npwg-demo-1/13_pod_case3.yml deleted file mode 100644 index c29c5a0c..00000000 --- a/examples/npwg-demo-1/13_pod_case3.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: pod-case-03 - annotations: - k8s.v1.cni.cncf.io/networks: '[ - { "name": "macvlan-conf-3" }, - { "name": "macvlan-conf-4" }, - { "name": "flannel-2" } - ]' -spec: - containers: - - name: pod-case-03 - image: docker.io/centos/tools:latest - command: - - /sbin/init diff --git a/examples/npwg-demo-1/14_pod_case4.yml b/examples/npwg-demo-1/14_pod_case4.yml deleted file mode 100644 index ee94fc76..00000000 --- a/examples/npwg-demo-1/14_pod_case4.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: pod-case-04 -spec: - containers: - - name: pod-case-04 - image: docker.io/centos/tools:latest - command: - - /sbin/init diff --git a/examples/npwg-demo-1/15_pod_case5.yml b/examples/npwg-demo-1/15_pod_case5.yml deleted file mode 100644 index b01a91da..00000000 --- a/examples/npwg-demo-1/15_pod_case5.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: pod-case-05 - annotations: - k8s.v1.cni.cncf.io/networks: '[ - { "name": "ptp-tuning-conflist" } - ]' -spec: - containers: - - name: pod-case-05 - image: docker.io/centos/tools:latest - command: - - /sbin/init diff --git a/examples/sample-pod.yml b/examples/sample-pod.yml deleted file mode 100644 index cfc090d2..00000000 --- a/examples/sample-pod.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: samplepod - annotations: - k8s.v1.cni.cncf.io/networks: macvlan-conf -spec: - containers: - - name: samplepod - command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"] - image: dougbtv/centos-network - ports: - - containerPort: 80 diff --git a/examples/sriov-net.yaml b/examples/sriov-net.yaml deleted file mode 100644 index 9b265d3e..00000000 --- a/examples/sriov-net.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition -metadata: - name: sriov-net-a - annotations: - k8s.v1.cni.cncf.io/resourceName: intel.com/sriov -spec: - config: '{ - "type": "sriov", - "vlan": 1000, - "ipam": { - "type": "host-local", - "subnet": "10.56.217.0/24", - "rangeStart": "10.56.217.171", - "rangeEnd": "10.56.217.181", - "routes": [{ - "dst": "0.0.0.0/0" - }], - "gateway": "10.56.217.1" - } -}' diff --git a/examples/sriov-pod.yml b/examples/sriov-pod.yml new file mode 100644 index 00000000..df2e397a --- /dev/null +++ b/examples/sriov-pod.yml @@ -0,0 +1,47 @@ +# This net-attach-def defines SR-IOV CNI config +# Please see https://github.com/intel/sriov-cni and https://github.com/intel/sriov-network-device-plugin +# for its detail. +--- +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: sriov-net-a + annotations: + k8s.v1.cni.cncf.io/resourceName: intel.com/sriov +spec: + config: '{ + "type": "sriov", + "vlan": 1000, + "ipam": { + "type": "host-local", + "subnet": "10.56.217.0/24", + "rangeStart": "10.56.217.171", + "rangeEnd": "10.56.217.181", + "routes": [{ + "dst": "0.0.0.0/0" + }], + "gateway": "10.56.217.1" + } +}' +--- +apiVersion: v1 +kind: Pod +metadata: + name: testpod1 + labels: + env: test + annotations: + k8s.v1.cni.cncf.io/networks: sriov-net-a +spec: + containers: + - name: appcntr1 + image: centos/tools + imagePullPolicy: IfNotPresent + command: [ "/bin/bash", "-c", "--" ] + args: [ "while true; do sleep 300000; done;" ] + resources: + requests: + intel.com/sriov: '1' + limits: + intel.com/sriov: '1' + restartPolicy: "Never"