Complete the code to specify the CNI plugin in a Kubernetes pod network configuration.
cniVersion: "0.3.1" name: my-network plugins: - type: [1]
The bridge plugin is a common CNI plugin used to create a network bridge for pods.
Complete the code to assign IP addresses dynamically using the CNI IPAM plugin.
{
"cniVersion": "0.3.1",
"name": "my-network",
"plugins": [
{
"type": "bridge",
"ipam": {
"type": [1]
}
}
]
}The host-local IPAM plugin assigns IP addresses dynamically from a local range.
Fix the error in the CNI configuration by completing the missing field for the bridge name.
{
"cniVersion": "0.3.1",
"name": "my-network",
"plugins": [
{
"type": "bridge",
"bridge": [1],
"ipam": {
"type": "host-local"
}
}
]
}The bridge field requires the bridge name as a string, so it must be quoted like "cni0".
Fill both blanks to configure a CNI plugin with a bridge name and subnet for IPAM.
{
"cniVersion": "0.3.1",
"name": "my-network",
"plugins": [
{
"type": "bridge",
"bridge": [1],
"ipam": {
"type": "host-local",
"subnet": [2]
}
}
]
}The bridge name should be a string like "br0", and the subnet must be a valid CIDR string like "192.168.1.0/24".
Fill all three blanks to create a CNI config with bridge type, IPAM subnet, and gateway.
{
"cniVersion": "0.3.1",
"name": "custom-net",
"plugins": [
{
"type": [1],
"bridge": [2],
"ipam": {
"type": "host-local",
"subnet": [3],
"gateway": "192.168.100.1"
}
}
]
}The plugin type is "bridge", the bridge name is "br-custom", and the subnet is "192.168.100.0/24". All must be strings in JSON.