You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.0 KiB

contiv network support (#1914) * Add Contiv support Contiv is a network plugin for Kubernetes and Docker. It supports vlan/vxlan/BGP/Cisco ACI technologies. It support firewall policies, multiple networks and bridging pods onto physical networks. * Update contiv version to 1.1.4 Update contiv version to 1.1.4 and added SVC_SUBNET in contiv-config. * Load openvswitch module to workaround on CentOS7.4 * Set contiv cni version to 0.1.0 Correct contiv CNI version to 0.1.0. * Use kube_apiserver_endpoint for K8S_API_SERVER Use kube_apiserver_endpoint as K8S_API_SERVER to make contiv talks to a available endpoint no matter if there's a loadbalancer or not. * Make contiv use its own etcd Before this commit, contiv is using a etcd proxy mode to k8s etcd, this work fine when the etcd hosts are co-located with contiv etcd proxy, however the k8s peering certs are only in etcd group, as a result the etcd-proxy is not able to peering with the k8s etcd on etcd group, plus the netplugin is always trying to find the etcd endpoint on localhost, this will cause problem for all netplugins not runnign on etcd group nodes. This commit make contiv uses its own etcd, separate from k8s one. on kube-master nodes (where net-master runs), it will run as leader mode and on all rest nodes it will run as proxy mode. * Use cp instead of rsync to copy cni binaries Since rsync has been removed from hyperkube, this commit changes it to use cp instead. * Make contiv-etcd able to run on master nodes * Add rbac_enabled flag for contiv pods * Add contiv into CNI network plugin lists * migrate contiv test to tests/files Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> * Add required rules for contiv netplugin * Better handling json return of fwdMode * Make contiv etcd port configurable * Use default var instead of templating * roles/download/defaults/main.yml: use contiv 1.1.7 Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
7 years ago
contiv network support (#1914) * Add Contiv support Contiv is a network plugin for Kubernetes and Docker. It supports vlan/vxlan/BGP/Cisco ACI technologies. It support firewall policies, multiple networks and bridging pods onto physical networks. * Update contiv version to 1.1.4 Update contiv version to 1.1.4 and added SVC_SUBNET in contiv-config. * Load openvswitch module to workaround on CentOS7.4 * Set contiv cni version to 0.1.0 Correct contiv CNI version to 0.1.0. * Use kube_apiserver_endpoint for K8S_API_SERVER Use kube_apiserver_endpoint as K8S_API_SERVER to make contiv talks to a available endpoint no matter if there's a loadbalancer or not. * Make contiv use its own etcd Before this commit, contiv is using a etcd proxy mode to k8s etcd, this work fine when the etcd hosts are co-located with contiv etcd proxy, however the k8s peering certs are only in etcd group, as a result the etcd-proxy is not able to peering with the k8s etcd on etcd group, plus the netplugin is always trying to find the etcd endpoint on localhost, this will cause problem for all netplugins not runnign on etcd group nodes. This commit make contiv uses its own etcd, separate from k8s one. on kube-master nodes (where net-master runs), it will run as leader mode and on all rest nodes it will run as proxy mode. * Use cp instead of rsync to copy cni binaries Since rsync has been removed from hyperkube, this commit changes it to use cp instead. * Make contiv-etcd able to run on master nodes * Add rbac_enabled flag for contiv pods * Add contiv into CNI network plugin lists * migrate contiv test to tests/files Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> * Add required rules for contiv netplugin * Better handling json return of fwdMode * Make contiv etcd port configurable * Use default var instead of templating * roles/download/defaults/main.yml: use contiv 1.1.7 Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
7 years ago
  1. # This manifest installs contiv-netplugin container, as well
  2. # as the Contiv CNI plugins and network config on
  3. # each master and worker node in a Kubernetes cluster.
  4. kind: DaemonSet
  5. apiVersion: extensions/v1beta1
  6. metadata:
  7. name: contiv-netplugin
  8. namespace: kube-system
  9. labels:
  10. k8s-app: contiv-netplugin
  11. spec:
  12. selector:
  13. matchLabels:
  14. k8s-app: contiv-netplugin
  15. updateStrategy:
  16. type: RollingUpdate
  17. template:
  18. metadata:
  19. labels:
  20. k8s-app: contiv-netplugin
  21. annotations:
  22. scheduler.alpha.kubernetes.io/critical-pod: ''
  23. spec:
  24. hostNetwork: true
  25. hostPID: true
  26. tolerations:
  27. - key: node-role.kubernetes.io/master
  28. effect: NoSchedule
  29. {% if rbac_enabled %}
  30. serviceAccountName: contiv-netplugin
  31. {% endif %}
  32. containers:
  33. # Runs netplugin container on each Kubernetes node. This
  34. # container programs network policy and routes on each
  35. # host.
  36. - name: contiv-netplugin
  37. image: {{ contiv_image_repo }}:{{ contiv_image_tag }}
  38. args:
  39. - -pkubernetes
  40. - -x
  41. env:
  42. - name: VLAN_IF
  43. value: {{ contiv_vlan_interface }}
  44. - name: VTEP_IP
  45. valueFrom:
  46. fieldRef:
  47. fieldPath: status.podIP
  48. - name: CONTIV_ETCD
  49. valueFrom:
  50. configMapKeyRef:
  51. name: contiv-config
  52. key: cluster_store
  53. - name: CONTIV_CNI_CONFIG
  54. valueFrom:
  55. configMapKeyRef:
  56. name: contiv-config
  57. key: cni_config
  58. - name: CONTIV_CONFIG
  59. valueFrom:
  60. configMapKeyRef:
  61. name: contiv-config
  62. key: config
  63. securityContext:
  64. privileged: true
  65. volumeMounts:
  66. - mountPath: /etc/openvswitch
  67. name: etc-openvswitch
  68. readOnly: false
  69. - mountPath: /lib/modules
  70. name: lib-modules
  71. readOnly: false
  72. - mountPath: /var/run
  73. name: var-run
  74. readOnly: false
  75. - mountPath: /var/contiv
  76. name: var-contiv
  77. readOnly: false
  78. - mountPath: /opt/cni/bin
  79. name: cni-bin-dir
  80. readOnly: false
  81. - mountPath: /etc/cni/net.d/
  82. name: etc-cni-dir
  83. readOnly: false
  84. volumes:
  85. # Used by contiv-netplugin
  86. - name: etc-openvswitch
  87. hostPath:
  88. path: /etc/openvswitch
  89. - name: lib-modules
  90. hostPath:
  91. path: /lib/modules
  92. - name: var-run
  93. hostPath:
  94. path: /var/run
  95. - name: var-contiv
  96. hostPath:
  97. path: /var/contiv
  98. # Used to install CNI.
  99. - name: cni-bin-dir
  100. hostPath:
  101. path: /opt/cni/bin
  102. - name: etc-cni-dir
  103. hostPath:
  104. path: /etc/cni/net.d/