Skip to content

Instantly share code, notes, and snippets.

@s1061123
Created December 23, 2019 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s1061123/9daa10ac6435b076f5dfa37fece3edd8 to your computer and use it in GitHub Desktop.
Save s1061123/9daa10ac6435b076f5dfa37fece3edd8 to your computer and use it in GitHub Desktop.
multus centos pod with runtimeConfig example
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: centos-runtimeconfig-def
spec:
config: '{
"cniVersion": "0.3.1",
"plugins": [
{
"type": "macvlan",
"capabilities": { "ips": true },
"master": "eth1",
"mode": "bridge",
"ipam": {
"type": "static"
}
}, {
"capabilities": { "mac": true },
"type": "tuning"
} ]
}'
---
apiVersion: v1
kind: Pod
metadata:
name: centos-runtimeconfig
annotations:
k8s.v1.cni.cncf.io/networks: '[
{ "name": "centos-runtimeconfig-def",
"ips": [ "10.1.1.104/24" ],
"mac": "c2:b0:57:49:47:f1" }
]'
spec:
containers:
- name: centos-runtimeconfig
image: docker.io/centos/tools:latest
command:
- /sbin/init
securityContext:
privileged: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment