Last active
July 12, 2022 16:45
-
-
Save janeczku/660ca5f436c1cde22619c7dde57796f2 to your computer and use it in GitHub Desktop.
Configure multicast-compatible macvlan interfaces with Multus
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: test | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: test | |
template: | |
metadata: | |
annotations: | |
k8s.v1.cni.cncf.io/networks: '[ | |
{ "name": "macvlan-test", | |
"ips": [ "10.1.1.101/24" ], | |
"mac": "c2:b0:57:49:47:f1", | |
"gateway": [ "10.1.1.1" ] | |
}]' | |
labels: | |
app: test | |
spec: | |
containers: | |
- name: test | |
command: ["/bin/sleep","3650d"] | |
image: ubuntu | |
securityContext: | |
capabilities: | |
add: ["NET_ADMIN", "SYS_TIME","NET_RAW"] |
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
apiVersion: "k8s.cni.cncf.io/v1" | |
kind: NetworkAttachmentDefinition | |
metadata: | |
name: macvlan-test | |
spec: | |
config: '{ | |
"cniVersion": "0.3.1", | |
"plugins": [ | |
{ | |
"type": "macvlan", | |
"capabilities": { "ips": true }, | |
"master": "eth0", | |
## mode (string, optional): one of “bridge”, “private”, “vepa”, “passthru” | |
"mode": "passthru", | |
"ipam": { | |
"type": "static", | |
"routes": [ | |
{ | |
"dst": "240.0.0.0/4" | |
} | |
] | |
} | |
}, { | |
"capabilities": { "mac": true }, | |
"type": "tuning" | |
} | |
] | |
}' | |
--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment