cancel
Showing results for 
Search instead for 
Did you mean: 
Richard4
Mission Specialist
Mission Specialist
  • 426 Views

Ex280 Multus Secondary Network

In the guided excerises, is there any documentation to remember the syntax for writing a NetworkAttachmentDefinition resource file? Or will I have to memorize it? Is JSON a requirment when writing this file? I could not figure out a way to write it 100% in YAML. 

apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
  name: custom

spec:
  config: |-
      {
        "cniVersion": "0.3.1",
        "name": "custom",
        "type": "host-device",
        "device": "ens4",
        "ipam": {
          "type": "static",
          "addresses": [{"address": "192.168.51.10/24"}]}}

Labels (1)
1 Reply
Chetan_Tiwary_
Moderator
Moderator
  • 399 Views

Hello @Richard4 !

As per the official documentation at : https://docs.openshift.com/container-platform/4.12/networking/multiple_networks/configuring-addition... 

Chetan_Tiwary__0-1692039901534.png

NAD config is a JSON-formatted CNI configuration

Chetan_Tiwary__1-1692039936298.png

For a host device configuration example , it is pretty straight forward and simple :

Chetan_Tiwary__2-1692040159282.png

and for static IPAM : 

 "ipam": {
          "type": "static",
          "addresses": [{"address": "192.168.51.10/24"}]}}

0 Kudos
Join the discussion
You must log in to join this conversation.