Skip to content

Multus

Notice

Not comlete yet....

ipvlan example

Example based on my lab build with hetzner-ocp4

Configure additional network

1
oc edit networks.operator.openshift.io cluster

Add additionalNetworks:

1
2
3
4
5
6
7
  additionalNetworks:
  - name: extra-network-1
    namespace: cni-test
    simpleMacvlanConfig:
      ipamConfig:
        type: DHCP
    type: SimpleMacvlan

Check the network attachment definitions:

1
2
3
$ oc get network-attachment-definitions/extra-network-1 -n cni-test
NAME              AGE
extra-network-1   14h

Create a pod

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
oc create -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
  name: multus
  namespace: cni-test
  annotations:
    k8s.v1.cni.cncf.io/networks: extra-network-1
spec:
  containers:
    - name: rhel
      image: registry.access.redhat.com/rhel7/rhel-tools
      command: [ "/bin/sh", "-c", "while true ; do date; sleep 10; done;" ]
  restartPolicy: Never
EOF

Last update: April 15, 2020