Skip to content

Instantly share code, notes, and snippets.

@s1061123
Created December 23, 2019 09:05
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/cff5a1ad24a71b9fe2fdbaa599f5edbd to your computer and use it in GitHub Desktop.
Save s1061123/cff5a1ad24a71b9fe2fdbaa599f5edbd to your computer and use it in GitHub Desktop.
multus centos pod with gateway change
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: centos-gateway-def
spec:
config: '{
"cniVersion": "0.3.1",
"plugins": [
{
"type": "macvlan",
"capabilities": { "ips": true },
"master": "eth1",
"mode": "bridge",
"ipam": {
"type": "static",
"routes": [
{
"dst": "0.0.0.0/0",
"gw": "10.1.1.1"
}
]
}
} ]
}'
---
apiVersion: v1
kind: Pod
metadata:
name: centos-gateway
annotations:
k8s.v1.cni.cncf.io/networks: '[
{ "name": "centos-gateway-def",
"ips": [ "10.1.1.103/24" ],
"gateway": [ "10.1.1.1" ]
}
]'
spec:
containers:
- name: centos-gateway
image: docker.io/centos/tools:latest
command:
- /sbin/init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment