Skip to content
Snippets Groups Projects
Commit 6ec45b10 authored by Kevin Lefevre's avatar Kevin Lefevre Committed by Matthew Mosesohn
Browse files

Update network-plugins to use portmap plugin (#1763)

Portmap allow to use hostPort with CNI plugins. Should fix #1675
parent d9879d80
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,8 @@
- name: Calico | Write Calico cni config
template:
src: "cni-calico.conf.j2"
dest: "/etc/cni/net.d/10-calico.conf"
src: "cni-calico.conflist.j2"
dest: "/etc/cni/net.d/10-calico.conflist"
owner: kube
- name: Calico | Create calico certs directory
......
{
"name": "calico-k8s-network",
{% if cloud_provider is defined %}
"nodename": "{{ calico_kubelet_name.stdout }}",
{% else %}
"nodename": "{{ ansible_hostname }}",
{% endif %}
"type": "calico",
"etcd_endpoints": "{{ etcd_access_addresses }}",
"etcd_cert_file": "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}.pem",
"etcd_key_file": "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}-key.pem",
"etcd_ca_cert_file": "{{ etcd_cert_dir }}/ca.pem",
"log_level": "info",
"ipam": {
"type": "calico-ipam"
},
{% if enable_network_policy %}
"policy": {
"type": "k8s"
},
{% endif %}
{% if calico_mtu is defined and calico_mtu is number %}
"mtu": {{ calico_mtu }},
{% endif %}
"kubernetes": {
"kubeconfig": "{{ kube_config_dir }}/node-kubeconfig.yaml"
}
}
{
"name": "cni0",
"cniVersion":"0.3.1",
"plugins":[
{
{% if cloud_provider is defined %}
"nodename": "{{ calico_kubelet_name.stdout }}",
{% else %}
"nodename": "{{ ansible_hostname }}",
{% endif %}
"type": "calico",
"etcd_endpoints": "{{ etcd_access_addresses }}",
"etcd_cert_file": "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}.pem",
"etcd_key_file": "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}-key.pem",
"etcd_ca_cert_file": "{{ etcd_cert_dir }}/ca.pem",
"log_level": "info",
"ipam": {
"type": "calico-ipam"
},
{% if enable_network_policy %}
"policy": {
"type": "k8s"
},
{% endif %}
{% if calico_mtu is defined and calico_mtu is number %}
"mtu": {{ calico_mtu }},
{% endif %}
"kubernetes": {
"kubeconfig": "{{ kube_config_dir }}/node-kubeconfig.yaml"
}
},
{
"type":"portmap",
"capabilities":{
"portMappings":true
}
}
]
}
---
- name: Canal | Write Canal cni config
template:
src: "cni-canal.conf.j2"
dest: "/etc/cni/net.d/10-canal.conf"
src: "cni-canal.conflist.j2"
dest: "/etc/cni/net.d/10-canal.conflist"
owner: kube
- name: Canal | Create canal certs directory
......
{
"name": "canal-k8s-network",
"type": "flannel",
"delegate": {
"type": "calico",
"etcd_endpoints": "{{ etcd_access_addresses }}",
"log_level": "info",
"policy": {
"type": "k8s"
},
"kubernetes": {
"kubeconfig": "{{ kube_config_dir }}/node-kubeconfig.yaml"
}
}
}
{
"name": "cni0",
"cniVersion":"0.3.1",
"plugins":[
{
"type": "flannel",
"delegate": {
"type": "calico",
"etcd_endpoints": "{{ etcd_access_addresses }}",
"log_level": "info",
"policy": {
"type": "k8s"
},
"kubernetes": {
"kubeconfig": "{{ kube_config_dir }}/node-kubeconfig.yaml"
}
}
},
{
"type":"portmap",
"capabilities":{
"portMappings":true
}
}
]
}
......@@ -10,7 +10,7 @@ metadata:
data:
cni-conf.json: |
{
"name":"cbr0",
"name":"cni0",
"cniVersion":"0.3.1",
"plugins":[
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment