nuage-node-config-daemonset.j2 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. # This ConfigMap is used to configure Nuage VSP configuration
  2. kind: ConfigMap
  3. apiVersion: v1
  4. metadata:
  5. name: nuage-config
  6. namespace: kube-system
  7. data:
  8. # This will generate the required Nuage vsp-openshift.yaml
  9. # config on each slave node
  10. plugin_yaml_config: |
  11. clientCert: {{ nuage_node_config_dsets_mount_dir }}/vsp-openshift/client.crt
  12. # The key to the certificate in clientCert above
  13. clientKey: {{ nuage_node_config_dsets_mount_dir }}/vsp-openshift/client.key
  14. # The certificate authority's certificate for the local kubelet. Usually the
  15. # same as the CA cert used to create the client Cert/Key pair.
  16. CACert: {{ nuage_node_config_dsets_mount_dir }}/vsp-openshift/ca.crt
  17. # Name of the enterprise in which pods will reside
  18. enterpriseName: {{ enterprise }}
  19. # Name of the domain in which pods will reside
  20. domainName: {{ domain }}
  21. # Name of the VSD user in admin group
  22. vsdUser: {{ vsd_user }}
  23. # IP address and port number of master API server
  24. masterApiServer: {{ api_server_url }}
  25. # REST server URL
  26. nuageMonRestServer: https://{{ openshift_master_cluster_hostname }}:{{ nuage_mon_rest_server_port }}
  27. # Bridge name for the docker bridge
  28. dockerBridgeName: docker0
  29. # Certificate for connecting to the openshift monitor REST api
  30. nuageMonClientCert: {{ nuage_node_config_dsets_mount_dir }}/vsp-openshift/nuageMonClient.crt
  31. # Key to the certificate in restClientCert
  32. nuageMonClientKey: {{ nuage_node_config_dsets_mount_dir }}/vsp-openshift/nuageMonClient.key
  33. # CA certificate for verifying the master's rest server
  34. nuageMonServerCA: {{ nuage_node_config_dsets_mount_dir }}/vsp-openshift/nuageMonCA.crt
  35. # This will generate the required Nuage CNI yaml configuration
  36. cni_yaml_config: |
  37. vrsendpoint: "/var/run/openvswitch/db.sock"
  38. vrsbridge: "alubr0"
  39. monitorinterval: 60
  40. cniversion: 0.2.0
  41. loglevel: "info"
  42. portresolvetimer: 60
  43. logfilesize: 1
  44. logfilemaxage: 2
  45. vrsconnectionchecktimer: 180
  46. mtu: {{ nuage_vport_mtu }}
  47. staleentrytimeout: 600
  48. nuagesiteid: {{ nuage_site_id | default(-1) }}
  49. platform: {{ nuage_personality | default('vrs') }}
  50. ---
  51. # This manifest installs Nuage CNI plugins and network config on
  52. # each worker node in Openshift cluster
  53. kind: DaemonSet
  54. apiVersion: extensions/v1beta1
  55. metadata:
  56. name: nuage-cni-ds
  57. namespace: kube-system
  58. labels:
  59. k8s-app: nuage-cni-ds
  60. spec:
  61. selector:
  62. matchLabels:
  63. k8s-app: nuage-cni-ds
  64. updateStrategy:
  65. type: RollingUpdate
  66. template:
  67. metadata:
  68. labels:
  69. k8s-app: nuage-cni-ds
  70. spec:
  71. hostNetwork: true
  72. containers:
  73. # This container installs Nuage CNI binaries
  74. # and CNI network config file on each node.
  75. - name: install-nuage-cni
  76. image: {{ nuage_cni_image_name }}:{{ nuage_cni_container_image_version }}
  77. command: ["/install-cni.sh"]
  78. args: ["nuage-cni-openshift", "{{ slave_host_type }}"]
  79. securityContext:
  80. privileged: true
  81. env:
  82. # Nuage vsp-openshift.yaml config to install on each slave node.
  83. - name: NUAGE_VSP_CONFIG
  84. valueFrom:
  85. configMapKeyRef:
  86. name: nuage-config
  87. key: plugin_yaml_config
  88. # Nuage nuage-cni.yaml config to install on each slave node.
  89. - name: NUAGE_CNI_YAML_CONFIG
  90. valueFrom:
  91. configMapKeyRef:
  92. name: nuage-config
  93. key: cni_yaml_config
  94. # Nuage cluster network CIDR for iptables configuration
  95. - name: NUAGE_CLUSTER_NW_CIDR
  96. value: "{{ openshift_cluster_network_cidr }}"
  97. volumeMounts:
  98. - mountPath: /host/opt/cni/bin
  99. name: cni-bin-dir
  100. - mountPath: /host/etc/cni/net.d
  101. name: cni-net-dir
  102. - mountPath: /etc/default
  103. name: cni-yaml-dir
  104. - mountPath: /var/run
  105. name: var-run-dir
  106. - mountPath: /var/log
  107. name: cni-log-dir
  108. - mountPath: {{ nuage_node_config_dsets_mount_dir }}
  109. name: var-usr-share-dir
  110. - mountPath: /usr/share/
  111. name: usr-share-dir
  112. volumes:
  113. - name: cni-bin-dir
  114. hostPath:
  115. path: {{ nuage_cni_bin_dsets_mount_dir }}
  116. - name: cni-net-dir
  117. hostPath:
  118. path: {{ nuage_cni_netconf_dsets_mount_dir }}
  119. - name: cni-yaml-dir
  120. hostPath:
  121. path: /etc/default
  122. - name: var-run-dir
  123. hostPath:
  124. path: /var/run
  125. - name: cni-log-dir
  126. hostPath:
  127. path: /var/log
  128. - name: var-usr-share-dir
  129. hostPath:
  130. path: {{ nuage_node_config_dsets_mount_dir }}
  131. - name: usr-share-dir
  132. hostPath:
  133. path: /usr/share/
  134. ---
  135. # This manifest installs Nuage VRS on
  136. # each worker node in an Openshift cluster.
  137. kind: DaemonSet
  138. apiVersion: extensions/v1beta1
  139. metadata:
  140. name: nuage-vrs-ds
  141. namespace: kube-system
  142. labels:
  143. k8s-app: nuage-vrs-ds
  144. spec:
  145. selector:
  146. matchLabels:
  147. k8s-app: nuage-vrs-ds
  148. updateStrategy:
  149. type: RollingUpdate
  150. template:
  151. metadata:
  152. labels:
  153. k8s-app: nuage-vrs-ds
  154. spec:
  155. hostNetwork: true
  156. containers:
  157. # This container installs Nuage VRS running as a
  158. # container on each worker node
  159. - name: install-nuage-vrs
  160. image: {{ nuage_vrs_image_name }}:{{ nuage_vrs_container_image_version }}
  161. securityContext:
  162. privileged: true
  163. env:
  164. # Configure parameters for VRS openvswitch file
  165. - name: NUAGE_ACTIVE_CONTROLLER
  166. value: "{{ nuage_vsc_active_ip }}"
  167. - name: NUAGE_STANDBY_CONTROLLER
  168. value: "{{ nuage_vsc_standby_ip }}"
  169. - name: NUAGE_PLATFORM
  170. value: '"kvm, k8s"'
  171. - name: NUAGE_K8S_SERVICE_IPV4_SUBNET
  172. value: '{{ svc_ipv4_subnet }}\/{{ svc_ipv4_subnet_mask }}'
  173. - name: NUAGE_NETWORK_UPLINK_INTF
  174. value: "{{ nw_uplink_intf }}"
  175. - name: NUAGE_BRIDGE_MTU
  176. value: "{{ vrs_bridge_mtu_config }}"
  177. {% if nuage_bgp_config == 'enable' %}
  178. - name: ENABLE_BGP
  179. value: "yes"
  180. {% endif %}
  181. volumeMounts:
  182. - mountPath: /var/run
  183. name: vrs-run-dir
  184. - mountPath: /var/log
  185. name: vrs-log-dir
  186. - mountPath: {{ nuage_vrs_mount_dir }}
  187. name: vrs-mnt-dir
  188. - mountPath: /sys/module
  189. name: sys-mod-dir
  190. readOnly: true
  191. - mountPath: /lib/modules
  192. name: lib-mod-dir
  193. readOnly: true
  194. volumes:
  195. - name: vrs-run-dir
  196. hostPath:
  197. path: /var/run
  198. - name: vrs-log-dir
  199. hostPath:
  200. path: /var/log
  201. - name: vrs-mnt-dir
  202. hostPath:
  203. path: {{ nuage_vrs_mount_dir }}
  204. - name: sys-mod-dir
  205. hostPath:
  206. path: /sys/module
  207. - name: lib-mod-dir
  208. hostPath:
  209. path: /lib/modules