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.

102 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. serviceAccountName: contiv-netplugin
  30. containers:
  31. # Runs netplugin container on each Kubernetes node. This
  32. # container programs network policy and routes on each
  33. # host.
  34. - name: contiv-netplugin
  35. image: {{ contiv_image_repo }}:{{ contiv_image_tag }}
  36. args:
  37. - -pkubernetes
  38. - -x
  39. env:
  40. - name: VLAN_IF
  41. value: {{ contiv_vlan_interface }}
  42. - name: VTEP_IP
  43. valueFrom:
  44. fieldRef:
  45. fieldPath: status.podIP
  46. - name: CONTIV_ETCD
  47. valueFrom:
  48. configMapKeyRef:
  49. name: contiv-config
  50. key: cluster_store
  51. - name: CONTIV_CNI_CONFIG
  52. valueFrom:
  53. configMapKeyRef:
  54. name: contiv-config
  55. key: cni_config
  56. - name: CONTIV_CONFIG
  57. valueFrom:
  58. configMapKeyRef:
  59. name: contiv-config
  60. key: config
  61. securityContext:
  62. privileged: true
  63. volumeMounts:
  64. - mountPath: /etc/openvswitch
  65. name: etc-openvswitch
  66. readOnly: false
  67. - mountPath: /lib/modules
  68. name: lib-modules
  69. readOnly: false
  70. - mountPath: /var/run
  71. name: var-run
  72. readOnly: false
  73. - mountPath: /var/contiv
  74. name: var-contiv
  75. readOnly: false
  76. - mountPath: /opt/cni/bin
  77. name: cni-bin-dir
  78. readOnly: false
  79. - mountPath: /etc/cni/net.d/
  80. name: etc-cni-dir
  81. readOnly: false
  82. volumes:
  83. # Used by contiv-netplugin
  84. - name: etc-openvswitch
  85. hostPath:
  86. path: /etc/openvswitch
  87. - name: lib-modules
  88. hostPath:
  89. path: /lib/modules
  90. - name: var-run
  91. hostPath:
  92. path: /var/run
  93. - name: var-contiv
  94. hostPath:
  95. path: /var/contiv
  96. # Used to install CNI.
  97. - name: cni-bin-dir
  98. hostPath:
  99. path: /opt/cni/bin
  100. - name: etc-cni-dir
  101. hostPath:
  102. path: /etc/cni/net.d/