Skip to content

Commit

Permalink
Add portmap plugin to CNI conf
Browse files Browse the repository at this point in the history
The portmap plugin is needed for hostPorts to work

Closes: #887
  • Loading branch information
osoriano committed Nov 25, 2017
1 parent 83c984f commit 014b2d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 16 additions & 6 deletions Documentation/kube-flannel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,21 @@ data:
cni-conf.json: |
{
"name": "cbr0",
"type": "flannel",
"delegate": {
"hairpinMode": true,
"isDefaultGateway": true
}
"plugins": [
{
"type": "flannel",
"delegate": {
"hairpinMode": true,
"isDefaultGateway": true
}
},
{
"type": "portmap",
"capabilities": {
"portMappings": true
}
}
]
}
net-conf.json: |
{
Expand Down Expand Up @@ -100,7 +110,7 @@ spec:
args:
- -f
- /etc/kube-flannel/cni-conf.json
- /etc/cni/net.d/10-flannel.conf
- /etc/cni/net.d/10-flannel.conflist
volumeMounts:
- name: cni
mountPath: /etc/cni/net.d
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Though not required, it's recommended that flannel uses the Kubernetes API as it

Flannel can be added to any existing Kubernetes cluster though it's simplest to add `flannel` before any pods using the pod network have been started.

For Kubernetes v1.6+
For Kubernetes v1.7+
`kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml`

See [Kubernetes](Documentation/kubernetes.md) for more details.
Expand Down

0 comments on commit 014b2d5

Please sign in to comment.