Skip to content

Multus

Notice

Not comlete yet....

ipvlan example

Example based on my lab build with hetzner-ocp4

Configure additional network

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

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

2020-12-06 2020-04-15 Contributors: Robert Bohne