mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-02 00:19:10 +00:00
Merge pull request #223 from pliurh/doc
Add doc for specifying pod default cluster network
This commit is contained in:
commit
cef999f394
@ -245,3 +245,28 @@ pod/samplepod created
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
samplepod 1/1 Running 0 31s
|
||||
```
|
||||
|
||||
### Specify default cluster network in Pod annotations
|
||||
|
||||
Users may also specify the default network for any given pod (via annotation), for cases where there are multiple cluster networks available within a Kubernetes cluster.
|
||||
|
||||
Example use cases may include:
|
||||
|
||||
1. During a migration from one default network to another (e.g. from Flannel to Calico), it may be practical if both network solutions are able to operate in parallel. Users can then control which network a pod should attach to during the transition period.
|
||||
2. Some users may deploy multiple cluster networks for the sake of their security considerations, and may desire to specify the default network for individual pods.
|
||||
|
||||
Follow these steps to specify the default network on a pod-by-pod basis:
|
||||
|
||||
1. First, you need to define all your cluster networks as network-attachment-definition objects.
|
||||
|
||||
2. Next, you can specify the network you want in pods with the `v1.multus-cni.io/default-network` annotation. Pods which do not specify this annotation will keep using the CNI as defined in the Multus config file.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: pod-example
|
||||
annotations:
|
||||
v1.multus-cni.io/default-network: calico-conf
|
||||
...
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user