calico-node-daemonset.yaml 5.6 KB

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