calico-node-daemonset.yaml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. kind: DaemonSet
  2. apiVersion: apps/v1
  3. metadata:
  4. name: calico-node
  5. namespace: kube-system
  6. labels:
  7. addonmanager.kubernetes.io/mode: Reconcile
  8. k8s-app: calico-node
  9. spec:
  10. selector:
  11. matchLabels:
  12. k8s-app: calico-node
  13. updateStrategy:
  14. type: RollingUpdate
  15. template:
  16. metadata:
  17. labels:
  18. k8s-app: calico-node
  19. spec:
  20. priorityClassName: system-node-critical
  21. nodeSelector:
  22. projectcalico.org/ds-ready: "true"
  23. hostNetwork: true
  24. serviceAccountName: calico
  25. # Minimize downtime during a rolling upgrade or deletion; tell Kubernetes to do a "force
  26. # deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
  27. terminationGracePeriodSeconds: 0
  28. initContainers:
  29. - name: install-cni
  30. image: gcr.io/projectcalico-org/cni:v3.8.4
  31. command: ["/install-cni.sh"]
  32. env:
  33. - name: CNI_CONF_NAME
  34. value: "10-calico.conflist"
  35. - name: CNI_NETWORK_CONFIG
  36. value: |-
  37. {
  38. "name": "k8s-pod-network",
  39. "cniVersion": "0.3.1",
  40. "plugins": [
  41. {
  42. "type": "calico",
  43. "log_level": "info",
  44. "datastore_type": "kubernetes",
  45. "nodename": "__KUBERNETES_NODE_NAME__",
  46. "ipam": {
  47. "type": "host-local",
  48. "subnet": "usePodCidr"
  49. },
  50. "policy": {
  51. "type": "k8s"
  52. },
  53. "kubernetes": {
  54. "kubeconfig": "__KUBECONFIG_FILEPATH__"
  55. }
  56. },
  57. {
  58. "type": "portmap",
  59. "capabilities": {"portMappings": true},
  60. "snat": true
  61. }
  62. ]
  63. }
  64. - name: KUBERNETES_NODE_NAME
  65. valueFrom:
  66. fieldRef:
  67. fieldPath: spec.nodeName
  68. # Prevents the container from sleeping forever.
  69. - name: SLEEP
  70. value: "false"
  71. volumeMounts:
  72. - mountPath: /host/opt/cni/bin
  73. name: cni-bin-dir
  74. - mountPath: /host/etc/cni/net.d
  75. name: cni-net-dir
  76. containers:
  77. # Runs calico/node container on each Kubernetes node. This
  78. # container programs network policy and routes on each
  79. # host.
  80. - name: calico-node
  81. image: gcr.io/projectcalico-org/node:v3.8.4
  82. env:
  83. - name: CALICO_MANAGE_CNI
  84. value: "true"
  85. - name: CALICO_DISABLE_FILE_LOGGING
  86. value: "true"
  87. - name: CALICO_NETWORKING_BACKEND
  88. value: "none"
  89. - name: DATASTORE_TYPE
  90. value: "kubernetes"
  91. - name: FELIX_DEFAULTENDPOINTTOHOSTACTION
  92. value: "ACCEPT"
  93. - name: FELIX_HEALTHENABLED
  94. value: "true"
  95. - name: FELIX_IPV6SUPPORT
  96. value: "false"
  97. - name: FELIX_LOGSEVERITYSYS
  98. value: "none"
  99. - name: FELIX_LOGSEVERITYSCREEN
  100. value: "info"
  101. - name: FELIX_PROMETHEUSMETRICSENABLED
  102. value: "true"
  103. - name: FELIX_REPORTINGINTERVALSECS
  104. value: "0"
  105. - name: FELIX_TYPHAK8SSERVICENAME
  106. value: "calico-typha"
  107. - name: USE_POD_CIDR
  108. value: "true"
  109. - name: IP
  110. value: ""
  111. - name: NO_DEFAULT_POOLS
  112. value: "true"
  113. - name: NODENAME
  114. valueFrom:
  115. fieldRef:
  116. fieldPath: spec.nodeName
  117. - name: WAIT_FOR_DATASTORE
  118. value: "true"
  119. securityContext:
  120. privileged: true
  121. livenessProbe:
  122. httpGet:
  123. path: /liveness
  124. port: 9099
  125. host: localhost
  126. periodSeconds: 10
  127. initialDelaySeconds: 10
  128. failureThreshold: 6
  129. readinessProbe:
  130. httpGet:
  131. path: /readiness
  132. port: 9099
  133. host: localhost
  134. periodSeconds: 10
  135. volumeMounts:
  136. - mountPath: /host/etc/cni/net.d
  137. name: cni-net-dir
  138. - mountPath: /lib/modules
  139. name: lib-modules
  140. readOnly: true
  141. - mountPath: /etc/calico
  142. name: etc-calico
  143. readOnly: true
  144. - mountPath: /var/run/calico
  145. name: var-run-calico
  146. readOnly: false
  147. - mountPath: /var/lib/calico
  148. name: var-lib-calico
  149. readOnly: false
  150. - mountPath: /run/xtables.lock
  151. name: xtables-lock
  152. readOnly: false
  153. volumes:
  154. # Used to ensure proper kmods are installed.
  155. - name: lib-modules
  156. hostPath:
  157. path: /lib/modules
  158. # Mount in the Felix config file from the host.
  159. - name: etc-calico
  160. hostPath:
  161. path: /etc/calico
  162. # Used to install CNI binaries.
  163. - name: cni-bin-dir
  164. hostPath:
  165. path: __CALICO_CNI_DIR__
  166. # Used to install CNI network config.
  167. - name: cni-net-dir
  168. hostPath:
  169. path: /etc/cni/net.d
  170. - name: var-run-calico
  171. hostPath:
  172. path: /var/run/calico
  173. - name: var-lib-calico
  174. hostPath:
  175. path: /var/lib/calico
  176. - name: xtables-lock
  177. hostPath:
  178. path: /run/xtables.lock
  179. type: FileOrCreate
  180. tolerations:
  181. # Make sure calico/node gets scheduled on all nodes.
  182. - effect: NoSchedule
  183. operator: Exists
  184. - effect: NoExecute
  185. operator: Exists
  186. - key: CriticalAddonsOnly
  187. operator: Exists