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.

1056 lines
30 KiB

  1. ---
  2. # Source: cilium/templates/cilium-agent/serviceaccount.yaml
  3. apiVersion: v1
  4. kind: ServiceAccount
  5. metadata:
  6. name: "cilium"
  7. namespace: kube-system
  8. ---
  9. # Source: cilium/templates/cilium-operator/serviceaccount.yaml
  10. apiVersion: v1
  11. kind: ServiceAccount
  12. metadata:
  13. name: "cilium-operator"
  14. namespace: kube-system
  15. ---
  16. # Source: cilium/templates/cilium-configmap.yaml
  17. apiVersion: v1
  18. kind: ConfigMap
  19. metadata:
  20. name: cilium-config
  21. namespace: kube-system
  22. data:
  23. # Identity allocation mode selects how identities are shared between cilium
  24. # nodes by setting how they are stored. The options are "crd" or "kvstore".
  25. # - "crd" stores identities in kubernetes as CRDs (custom resource definition).
  26. # These can be queried with:
  27. # kubectl get ciliumid
  28. # - "kvstore" stores identities in an etcd kvstore, that is
  29. # configured below. Cilium versions before 1.6 supported only the kvstore
  30. # backend. Upgrades from these older cilium versions should continue using
  31. # the kvstore by commenting out the identity-allocation-mode below, or
  32. # setting it to "kvstore".
  33. identity-allocation-mode: crd
  34. identity-heartbeat-timeout: "30m0s"
  35. identity-gc-interval: "15m0s"
  36. cilium-endpoint-gc-interval: "5m0s"
  37. nodes-gc-interval: "5m0s"
  38. skip-cnp-status-startup-clean: "false"
  39. # Disable the usage of CiliumEndpoint CRD
  40. disable-endpoint-crd: "false"
  41. # If you want to run cilium in debug mode change this value to true
  42. debug: "false"
  43. debug-verbose: ""
  44. # The agent can be put into the following three policy enforcement modes
  45. # default, always and never.
  46. # https://docs.cilium.io/en/latest/security/policy/intro/#policy-enforcement-modes
  47. enable-policy: "default"
  48. # Enable IPv4 addressing. If enabled, all endpoints are allocated an IPv4
  49. # address.
  50. enable-ipv4: "true"
  51. # Enable IPv6 addressing. If enabled, all endpoints are allocated an IPv6
  52. # address.
  53. enable-ipv6: "false"
  54. # Users who wish to specify their own custom CNI configuration file must set
  55. # custom-cni-conf to "true", otherwise Cilium may overwrite the configuration.
  56. custom-cni-conf: "false"
  57. enable-bpf-clock-probe: "true"
  58. # If you want cilium monitor to aggregate tracing for packets, set this level
  59. # to "low", "medium", or "maximum". The higher the level, the less packets
  60. # that will be seen in monitor output.
  61. monitor-aggregation: medium
  62. # The monitor aggregation interval governs the typical time between monitor
  63. # notification events for each allowed connection.
  64. #
  65. # Only effective when monitor aggregation is set to "medium" or higher.
  66. monitor-aggregation-interval: "5s"
  67. # The monitor aggregation flags determine which TCP flags which, upon the
  68. # first observation, cause monitor notifications to be generated.
  69. #
  70. # Only effective when monitor aggregation is set to "medium" or higher.
  71. monitor-aggregation-flags: all
  72. # Specifies the ratio (0.0-1.0] of total system memory to use for dynamic
  73. # sizing of the TCP CT, non-TCP CT, NAT and policy BPF maps.
  74. bpf-map-dynamic-size-ratio: "0.0025"
  75. # bpf-policy-map-max specifies the maximum number of entries in endpoint
  76. # policy map (per endpoint)
  77. bpf-policy-map-max: "16384"
  78. # bpf-lb-map-max specifies the maximum number of entries in bpf lb service,
  79. # backend and affinity maps.
  80. bpf-lb-map-max: "65536"
  81. bpf-lb-external-clusterip: "false"
  82. # Pre-allocation of map entries allows per-packet latency to be reduced, at
  83. # the expense of up-front memory allocation for the entries in the maps. The
  84. # default value below will minimize memory usage in the default installation;
  85. # users who are sensitive to latency may consider setting this to "true".
  86. #
  87. # This option was introduced in Cilium 1.4. Cilium 1.3 and earlier ignore
  88. # this option and behave as though it is set to "true".
  89. #
  90. # If this value is modified, then during the next Cilium startup the restore
  91. # of existing endpoints and tracking of ongoing connections may be disrupted.
  92. # As a result, reply packets may be dropped and the load-balancing decisions
  93. # for established connections may change.
  94. #
  95. # If this option is set to "false" during an upgrade from 1.3 or earlier to
  96. # 1.4 or later, then it may cause one-time disruptions during the upgrade.
  97. preallocate-bpf-maps: "false"
  98. # Regular expression matching compatible Istio sidecar istio-proxy
  99. # container image names
  100. sidecar-istio-proxy-image: "cilium/istio_proxy"
  101. # Name of the cluster. Only relevant when building a mesh of clusters.
  102. cluster-name: default
  103. # Unique ID of the cluster. Must be unique across all conneted clusters and
  104. # in the range of 1 and 255. Only relevant when building a mesh of clusters.
  105. cluster-id: "0"
  106. # Encapsulation mode for communication between nodes
  107. # Possible values:
  108. # - disabled
  109. # - vxlan (default)
  110. # - geneve
  111. tunnel: "vxlan"
  112. # Enables L7 proxy for L7 policy enforcement and visibility
  113. enable-l7-proxy: "true"
  114. enable-ipv4-masquerade: "true"
  115. enable-ipv6-big-tcp: "false"
  116. enable-ipv6-masquerade: "true"
  117. enable-xt-socket-fallback: "true"
  118. install-iptables-rules: "true"
  119. install-no-conntrack-iptables-rules: "false"
  120. auto-direct-node-routes: "false"
  121. enable-local-redirect-policy: "false"
  122. kube-proxy-replacement: "disabled"
  123. bpf-lb-sock: "false"
  124. enable-health-check-nodeport: "true"
  125. node-port-bind-protection: "true"
  126. enable-auto-protect-node-port-range: "true"
  127. enable-svc-source-range-check: "true"
  128. enable-l2-neigh-discovery: "true"
  129. arping-refresh-period: "30s"
  130. enable-endpoint-health-checking: "true"
  131. enable-health-checking: "true"
  132. enable-well-known-identities: "false"
  133. enable-remote-node-identity: "true"
  134. synchronize-k8s-nodes: "true"
  135. operator-api-serve-addr: "127.0.0.1:9234"
  136. ipam: "cluster-pool"
  137. cluster-pool-ipv4-cidr: "{{ kube_pods_subnet }}"
  138. cluster-pool-ipv4-mask-size: "24"
  139. disable-cnp-status-updates: "true"
  140. enable-vtep: "false"
  141. vtep-endpoint: ""
  142. vtep-cidr: ""
  143. vtep-mask: ""
  144. vtep-mac: ""
  145. enable-bgp-control-plane: "false"
  146. procfs: "/host/proc"
  147. bpf-root: "/sys/fs/bpf"
  148. cgroup-root: "/run/cilium/cgroupv2"
  149. enable-k8s-terminating-endpoint: "true"
  150. enable-sctp: "false"
  151. remove-cilium-node-taints: "true"
  152. set-cilium-is-up-condition: "true"
  153. unmanaged-pod-watcher-interval: "15"
  154. tofqdns-dns-reject-response-code: "refused"
  155. tofqdns-enable-dns-compression: "true"
  156. tofqdns-endpoint-max-ip-per-hostname: "50"
  157. tofqdns-idle-connection-grace-period: "0s"
  158. tofqdns-max-deferred-connection-deletes: "10000"
  159. tofqdns-min-ttl: "3600"
  160. tofqdns-proxy-response-max-delay: "100ms"
  161. agent-not-ready-taint-key: "node.cilium.io/agent-not-ready"
  162. ---
  163. # Source: cilium/templates/cilium-agent/clusterrole.yaml
  164. apiVersion: rbac.authorization.k8s.io/v1
  165. kind: ClusterRole
  166. metadata:
  167. name: cilium
  168. labels:
  169. app.kubernetes.io/part-of: cilium
  170. rules:
  171. - apiGroups:
  172. - networking.k8s.io
  173. resources:
  174. - networkpolicies
  175. verbs:
  176. - get
  177. - list
  178. - watch
  179. - apiGroups:
  180. - discovery.k8s.io
  181. resources:
  182. - endpointslices
  183. verbs:
  184. - get
  185. - list
  186. - watch
  187. - apiGroups:
  188. - ""
  189. resources:
  190. - namespaces
  191. - services
  192. - pods
  193. - endpoints
  194. - nodes
  195. verbs:
  196. - get
  197. - list
  198. - watch
  199. - apiGroups:
  200. - apiextensions.k8s.io
  201. resources:
  202. - customresourcedefinitions
  203. verbs:
  204. - list
  205. - watch
  206. # This is used when validating policies in preflight. This will need to stay
  207. # until we figure out how to avoid "get" inside the preflight, and then
  208. # should be removed ideally.
  209. - get
  210. - apiGroups:
  211. - cilium.io
  212. resources:
  213. - ciliumloadbalancerippools
  214. - ciliumbgppeeringpolicies
  215. - ciliumclusterwideenvoyconfigs
  216. - ciliumclusterwidenetworkpolicies
  217. - ciliumegressgatewaypolicies
  218. - ciliumendpoints
  219. - ciliumendpointslices
  220. - ciliumenvoyconfigs
  221. - ciliumidentities
  222. - ciliumlocalredirectpolicies
  223. - ciliumnetworkpolicies
  224. - ciliumnodes
  225. - ciliumnodeconfigs
  226. verbs:
  227. - list
  228. - watch
  229. - apiGroups:
  230. - cilium.io
  231. resources:
  232. - ciliumidentities
  233. - ciliumendpoints
  234. - ciliumnodes
  235. verbs:
  236. - create
  237. - apiGroups:
  238. - cilium.io
  239. # To synchronize garbage collection of such resources
  240. resources:
  241. - ciliumidentities
  242. verbs:
  243. - update
  244. - apiGroups:
  245. - cilium.io
  246. resources:
  247. - ciliumendpoints
  248. verbs:
  249. - delete
  250. - get
  251. - apiGroups:
  252. - cilium.io
  253. resources:
  254. - ciliumnodes
  255. - ciliumnodes/status
  256. verbs:
  257. - get
  258. - update
  259. - apiGroups:
  260. - cilium.io
  261. resources:
  262. - ciliumnetworkpolicies/status
  263. - ciliumclusterwidenetworkpolicies/status
  264. - ciliumendpoints/status
  265. - ciliumendpoints
  266. verbs:
  267. - patch
  268. ---
  269. # Source: cilium/templates/cilium-operator/clusterrole.yaml
  270. apiVersion: rbac.authorization.k8s.io/v1
  271. kind: ClusterRole
  272. metadata:
  273. name: cilium-operator
  274. labels:
  275. app.kubernetes.io/part-of: cilium
  276. rules:
  277. - apiGroups:
  278. - ""
  279. resources:
  280. - pods
  281. verbs:
  282. - get
  283. - list
  284. - watch
  285. # to automatically delete [core|kube]dns pods so that are starting to being
  286. # managed by Cilium
  287. - delete
  288. - apiGroups:
  289. - ""
  290. resources:
  291. - nodes
  292. verbs:
  293. - list
  294. - watch
  295. - apiGroups:
  296. - ""
  297. resources:
  298. # To remove node taints
  299. - nodes
  300. # To set NetworkUnavailable false on startup
  301. - nodes/status
  302. verbs:
  303. - patch
  304. - apiGroups:
  305. - discovery.k8s.io
  306. resources:
  307. - endpointslices
  308. verbs:
  309. - get
  310. - list
  311. - watch
  312. - apiGroups:
  313. - ""
  314. resources:
  315. # to perform LB IP allocation for BGP
  316. - services/status
  317. verbs:
  318. - update
  319. - patch
  320. - apiGroups:
  321. - ""
  322. resources:
  323. # to check apiserver connectivity
  324. - namespaces
  325. verbs:
  326. - get
  327. - list
  328. - watch
  329. - apiGroups:
  330. - ""
  331. resources:
  332. # to perform the translation of a CNP that contains `ToGroup` to its endpoints
  333. - services
  334. - endpoints
  335. verbs:
  336. - get
  337. - list
  338. - watch
  339. - apiGroups:
  340. - cilium.io
  341. resources:
  342. - ciliumnetworkpolicies
  343. - ciliumclusterwidenetworkpolicies
  344. verbs:
  345. # Create auto-generated CNPs and CCNPs from Policies that have 'toGroups'
  346. - create
  347. - update
  348. - deletecollection
  349. # To update the status of the CNPs and CCNPs
  350. - patch
  351. - get
  352. - list
  353. - watch
  354. - apiGroups:
  355. - cilium.io
  356. resources:
  357. - ciliumnetworkpolicies/status
  358. - ciliumclusterwidenetworkpolicies/status
  359. verbs:
  360. # Update the auto-generated CNPs and CCNPs status.
  361. - patch
  362. - update
  363. - apiGroups:
  364. - cilium.io
  365. resources:
  366. - ciliumendpoints
  367. - ciliumidentities
  368. verbs:
  369. # To perform garbage collection of such resources
  370. - delete
  371. - list
  372. - watch
  373. - apiGroups:
  374. - cilium.io
  375. resources:
  376. - ciliumidentities
  377. verbs:
  378. # To synchronize garbage collection of such resources
  379. - update
  380. - apiGroups:
  381. - cilium.io
  382. resources:
  383. - ciliumnodes
  384. verbs:
  385. - create
  386. - update
  387. - get
  388. - list
  389. - watch
  390. # To perform CiliumNode garbage collector
  391. - delete
  392. - apiGroups:
  393. - cilium.io
  394. resources:
  395. - ciliumnodes/status
  396. verbs:
  397. - update
  398. - apiGroups:
  399. - cilium.io
  400. resources:
  401. - ciliumendpointslices
  402. - ciliumenvoyconfigs
  403. verbs:
  404. - create
  405. - update
  406. - get
  407. - list
  408. - watch
  409. - delete
  410. - patch
  411. - apiGroups:
  412. - apiextensions.k8s.io
  413. resources:
  414. - customresourcedefinitions
  415. verbs:
  416. - create
  417. - get
  418. - list
  419. - watch
  420. - apiGroups:
  421. - apiextensions.k8s.io
  422. resources:
  423. - customresourcedefinitions
  424. verbs:
  425. - update
  426. resourceNames:
  427. - ciliumloadbalancerippools.cilium.io
  428. - ciliumbgppeeringpolicies.cilium.io
  429. - ciliumclusterwideenvoyconfigs.cilium.io
  430. - ciliumclusterwidenetworkpolicies.cilium.io
  431. - ciliumegressgatewaypolicies.cilium.io
  432. - ciliumendpoints.cilium.io
  433. - ciliumendpointslices.cilium.io
  434. - ciliumenvoyconfigs.cilium.io
  435. - ciliumexternalworkloads.cilium.io
  436. - ciliumidentities.cilium.io
  437. - ciliumlocalredirectpolicies.cilium.io
  438. - ciliumnetworkpolicies.cilium.io
  439. - ciliumnodes.cilium.io
  440. - ciliumnodeconfigs.cilium.io
  441. - apiGroups:
  442. - cilium.io
  443. resources:
  444. - ciliumloadbalancerippools
  445. verbs:
  446. - get
  447. - list
  448. - watch
  449. - apiGroups:
  450. - cilium.io
  451. resources:
  452. - ciliumloadbalancerippools/status
  453. verbs:
  454. - patch
  455. # For cilium-operator running in HA mode.
  456. #
  457. # Cilium operator running in HA mode requires the use of ResourceLock for Leader Election
  458. # between multiple running instances.
  459. # The preferred way of doing this is to use LeasesResourceLock as edits to Leases are less
  460. # common and fewer objects in the cluster watch "all Leases".
  461. - apiGroups:
  462. - coordination.k8s.io
  463. resources:
  464. - leases
  465. verbs:
  466. - create
  467. - get
  468. - update
  469. ---
  470. # Source: cilium/templates/cilium-agent/clusterrolebinding.yaml
  471. apiVersion: rbac.authorization.k8s.io/v1
  472. kind: ClusterRoleBinding
  473. metadata:
  474. name: cilium
  475. labels:
  476. app.kubernetes.io/part-of: cilium
  477. roleRef:
  478. apiGroup: rbac.authorization.k8s.io
  479. kind: ClusterRole
  480. name: cilium
  481. subjects:
  482. - kind: ServiceAccount
  483. name: "cilium"
  484. namespace: kube-system
  485. ---
  486. # Source: cilium/templates/cilium-operator/clusterrolebinding.yaml
  487. apiVersion: rbac.authorization.k8s.io/v1
  488. kind: ClusterRoleBinding
  489. metadata:
  490. name: cilium-operator
  491. labels:
  492. app.kubernetes.io/part-of: cilium
  493. roleRef:
  494. apiGroup: rbac.authorization.k8s.io
  495. kind: ClusterRole
  496. name: cilium-operator
  497. subjects:
  498. - kind: ServiceAccount
  499. name: "cilium-operator"
  500. namespace: kube-system
  501. ---
  502. # Source: cilium/templates/cilium-agent/role.yaml
  503. apiVersion: rbac.authorization.k8s.io/v1
  504. kind: Role
  505. metadata:
  506. name: cilium-config-agent
  507. namespace: kube-system
  508. labels:
  509. app.kubernetes.io/part-of: cilium
  510. rules:
  511. - apiGroups:
  512. - ""
  513. resources:
  514. - configmaps
  515. verbs:
  516. - get
  517. - list
  518. - watch
  519. ---
  520. # Source: cilium/templates/cilium-agent/rolebinding.yaml
  521. apiVersion: rbac.authorization.k8s.io/v1
  522. kind: RoleBinding
  523. metadata:
  524. name: cilium-config-agent
  525. namespace: kube-system
  526. labels:
  527. app.kubernetes.io/part-of: cilium
  528. roleRef:
  529. apiGroup: rbac.authorization.k8s.io
  530. kind: Role
  531. name: cilium-config-agent
  532. subjects:
  533. - kind: ServiceAccount
  534. name: "cilium"
  535. namespace: kube-system
  536. ---
  537. # Source: cilium/templates/cilium-agent/daemonset.yaml
  538. apiVersion: apps/v1
  539. kind: DaemonSet
  540. metadata:
  541. name: cilium
  542. namespace: kube-system
  543. labels:
  544. k8s-app: cilium
  545. app.kubernetes.io/part-of: cilium
  546. app.kubernetes.io/name: cilium-agent
  547. spec:
  548. selector:
  549. matchLabels:
  550. k8s-app: cilium
  551. updateStrategy:
  552. rollingUpdate:
  553. maxUnavailable: 2
  554. type: RollingUpdate
  555. template:
  556. metadata:
  557. annotations:
  558. # Set app AppArmor's profile to "unconfined". The value of this annotation
  559. # can be modified as long users know which profiles they have available
  560. # in AppArmor.
  561. container.apparmor.security.beta.kubernetes.io/cilium-agent: "unconfined"
  562. container.apparmor.security.beta.kubernetes.io/clean-cilium-state: "unconfined"
  563. container.apparmor.security.beta.kubernetes.io/mount-cgroup: "unconfined"
  564. container.apparmor.security.beta.kubernetes.io/apply-sysctl-overwrites: "unconfined"
  565. labels:
  566. k8s-app: cilium
  567. app.kubernetes.io/name: cilium-agent
  568. app.kubernetes.io/part-of: cilium
  569. spec:
  570. containers:
  571. - name: cilium-agent
  572. image: "quay.io/cilium/cilium:v1.13.0@sha256:6544a3441b086a2e09005d3e21d1a4afb216fae19c5a60b35793c8a9438f8f68"
  573. imagePullPolicy: IfNotPresent
  574. command:
  575. - cilium-agent
  576. args:
  577. - --config-dir=/tmp/cilium/config-map
  578. startupProbe:
  579. httpGet:
  580. host: "127.0.0.1"
  581. path: /healthz
  582. port: 9879
  583. scheme: HTTP
  584. httpHeaders:
  585. - name: "brief"
  586. value: "true"
  587. failureThreshold: 105
  588. periodSeconds: 2
  589. successThreshold: 1
  590. livenessProbe:
  591. httpGet:
  592. host: "127.0.0.1"
  593. path: /healthz
  594. port: 9879
  595. scheme: HTTP
  596. httpHeaders:
  597. - name: "brief"
  598. value: "true"
  599. periodSeconds: 30
  600. successThreshold: 1
  601. failureThreshold: 10
  602. timeoutSeconds: 5
  603. readinessProbe:
  604. httpGet:
  605. host: "127.0.0.1"
  606. path: /healthz
  607. port: 9879
  608. scheme: HTTP
  609. httpHeaders:
  610. - name: "brief"
  611. value: "true"
  612. periodSeconds: 30
  613. successThreshold: 1
  614. failureThreshold: 3
  615. timeoutSeconds: 5
  616. env:
  617. - name: K8S_NODE_NAME
  618. valueFrom:
  619. fieldRef:
  620. apiVersion: v1
  621. fieldPath: spec.nodeName
  622. - name: CILIUM_K8S_NAMESPACE
  623. valueFrom:
  624. fieldRef:
  625. apiVersion: v1
  626. fieldPath: metadata.namespace
  627. - name: CILIUM_CLUSTERMESH_CONFIG
  628. value: /var/lib/cilium/clustermesh/
  629. - name: CILIUM_CNI_CHAINING_MODE
  630. valueFrom:
  631. configMapKeyRef:
  632. name: cilium-config
  633. key: cni-chaining-mode
  634. optional: true
  635. - name: CILIUM_CUSTOM_CNI_CONF
  636. valueFrom:
  637. configMapKeyRef:
  638. name: cilium-config
  639. key: custom-cni-conf
  640. optional: true
  641. lifecycle:
  642. postStart:
  643. exec:
  644. command:
  645. - "/cni-install.sh"
  646. - "--enable-debug=false"
  647. - "--cni-exclusive=true"
  648. - "--log-file=/var/run/cilium/cilium-cni.log"
  649. preStop:
  650. exec:
  651. command:
  652. - /cni-uninstall.sh
  653. securityContext:
  654. seLinuxOptions:
  655. level: s0
  656. type: spc_t
  657. capabilities:
  658. add:
  659. - CHOWN
  660. - KILL
  661. - NET_ADMIN
  662. - NET_RAW
  663. - IPC_LOCK
  664. - SYS_MODULE
  665. - SYS_ADMIN
  666. - SYS_RESOURCE
  667. - DAC_OVERRIDE
  668. - FOWNER
  669. - SETGID
  670. - SETUID
  671. drop:
  672. - ALL
  673. terminationMessagePolicy: FallbackToLogsOnError
  674. volumeMounts:
  675. # Unprivileged containers need to mount /proc/sys/net from the host
  676. # to have write access
  677. - mountPath: /host/proc/sys/net
  678. name: host-proc-sys-net
  679. # Unprivileged containers need to mount /proc/sys/kernel from the host
  680. # to have write access
  681. - mountPath: /host/proc/sys/kernel
  682. name: host-proc-sys-kernel
  683. - name: bpf-maps
  684. mountPath: /sys/fs/bpf
  685. # Unprivileged containers can't set mount propagation to bidirectional
  686. # in this case we will mount the bpf fs from an init container that
  687. # is privileged and set the mount propagation from host to container
  688. # in Cilium.
  689. mountPropagation: HostToContainer
  690. - name: cilium-run
  691. mountPath: /var/run/cilium
  692. - name: cni-path
  693. mountPath: /host/opt/cni/bin
  694. - name: etc-cni-netd
  695. mountPath: /host/etc/cni/net.d
  696. - name: clustermesh-secrets
  697. mountPath: /var/lib/cilium/clustermesh
  698. readOnly: true
  699. # Needed to be able to load kernel modules
  700. - name: lib-modules
  701. mountPath: /lib/modules
  702. readOnly: true
  703. - name: xtables-lock
  704. mountPath: /run/xtables.lock
  705. - name: tmp
  706. mountPath: /tmp
  707. initContainers:
  708. - name: config
  709. image: "quay.io/cilium/cilium:v1.13.0@sha256:6544a3441b086a2e09005d3e21d1a4afb216fae19c5a60b35793c8a9438f8f68"
  710. imagePullPolicy: IfNotPresent
  711. command:
  712. - cilium
  713. - build-config
  714. env:
  715. - name: K8S_NODE_NAME
  716. valueFrom:
  717. fieldRef:
  718. apiVersion: v1
  719. fieldPath: spec.nodeName
  720. - name: CILIUM_K8S_NAMESPACE
  721. valueFrom:
  722. fieldRef:
  723. apiVersion: v1
  724. fieldPath: metadata.namespace
  725. volumeMounts:
  726. - name: tmp
  727. mountPath: /tmp
  728. terminationMessagePolicy: FallbackToLogsOnError
  729. # Required to mount cgroup2 filesystem on the underlying Kubernetes node.
  730. # We use nsenter command with host's cgroup and mount namespaces enabled.
  731. - name: mount-cgroup
  732. image: "quay.io/cilium/cilium:v1.13.0@sha256:6544a3441b086a2e09005d3e21d1a4afb216fae19c5a60b35793c8a9438f8f68"
  733. imagePullPolicy: IfNotPresent
  734. env:
  735. - name: CGROUP_ROOT
  736. value: /run/cilium/cgroupv2
  737. - name: BIN_PATH
  738. value: /opt/cni/bin
  739. command:
  740. - sh
  741. - -ec
  742. # The statically linked Go program binary is invoked to avoid any
  743. # dependency on utilities like sh and mount that can be missing on certain
  744. # distros installed on the underlying host. Copy the binary to the
  745. # same directory where we install cilium cni plugin so that exec permissions
  746. # are available.
  747. - |
  748. cp /usr/bin/cilium-mount /hostbin/cilium-mount;
  749. nsenter --cgroup=/hostproc/1/ns/cgroup --mount=/hostproc/1/ns/mnt "${BIN_PATH}/cilium-mount" $CGROUP_ROOT;
  750. rm /hostbin/cilium-mount
  751. volumeMounts:
  752. - name: hostproc
  753. mountPath: /hostproc
  754. - name: cni-path
  755. mountPath: /hostbin
  756. terminationMessagePolicy: FallbackToLogsOnError
  757. securityContext:
  758. seLinuxOptions:
  759. level: s0
  760. type: spc_t
  761. capabilities:
  762. add:
  763. - SYS_ADMIN
  764. - SYS_CHROOT
  765. - SYS_PTRACE
  766. drop:
  767. - ALL
  768. - name: apply-sysctl-overwrites
  769. image: "quay.io/cilium/cilium:v1.13.0@sha256:6544a3441b086a2e09005d3e21d1a4afb216fae19c5a60b35793c8a9438f8f68"
  770. imagePullPolicy: IfNotPresent
  771. env:
  772. - name: BIN_PATH
  773. value: /opt/cni/bin
  774. command:
  775. - sh
  776. - -ec
  777. # The statically linked Go program binary is invoked to avoid any
  778. # dependency on utilities like sh that can be missing on certain
  779. # distros installed on the underlying host. Copy the binary to the
  780. # same directory where we install cilium cni plugin so that exec permissions
  781. # are available.
  782. - |
  783. cp /usr/bin/cilium-sysctlfix /hostbin/cilium-sysctlfix;
  784. nsenter --mount=/hostproc/1/ns/mnt "${BIN_PATH}/cilium-sysctlfix";
  785. rm /hostbin/cilium-sysctlfix
  786. volumeMounts:
  787. - name: hostproc
  788. mountPath: /hostproc
  789. - name: cni-path
  790. mountPath: /hostbin
  791. terminationMessagePolicy: FallbackToLogsOnError
  792. securityContext:
  793. seLinuxOptions:
  794. level: s0
  795. type: spc_t
  796. capabilities:
  797. add:
  798. - SYS_ADMIN
  799. - SYS_CHROOT
  800. - SYS_PTRACE
  801. drop:
  802. - ALL
  803. # Mount the bpf fs if it is not mounted. We will perform this task
  804. # from a privileged container because the mount propagation bidirectional
  805. # only works from privileged containers.
  806. - name: mount-bpf-fs
  807. image: "quay.io/cilium/cilium:v1.13.0@sha256:6544a3441b086a2e09005d3e21d1a4afb216fae19c5a60b35793c8a9438f8f68"
  808. imagePullPolicy: IfNotPresent
  809. args:
  810. - 'mount | grep "/sys/fs/bpf type bpf" || mount -t bpf bpf /sys/fs/bpf'
  811. command:
  812. - /bin/bash
  813. - -c
  814. - --
  815. terminationMessagePolicy: FallbackToLogsOnError
  816. securityContext:
  817. privileged: true
  818. volumeMounts:
  819. - name: bpf-maps
  820. mountPath: /sys/fs/bpf
  821. mountPropagation: Bidirectional
  822. - name: clean-cilium-state
  823. image: "quay.io/cilium/cilium:v1.13.0@sha256:6544a3441b086a2e09005d3e21d1a4afb216fae19c5a60b35793c8a9438f8f68"
  824. imagePullPolicy: IfNotPresent
  825. command:
  826. - /init-container.sh
  827. env:
  828. - name: CILIUM_ALL_STATE
  829. valueFrom:
  830. configMapKeyRef:
  831. name: cilium-config
  832. key: clean-cilium-state
  833. optional: true
  834. - name: CILIUM_BPF_STATE
  835. valueFrom:
  836. configMapKeyRef:
  837. name: cilium-config
  838. key: clean-cilium-bpf-state
  839. optional: true
  840. terminationMessagePolicy: FallbackToLogsOnError
  841. securityContext:
  842. seLinuxOptions:
  843. level: s0
  844. type: spc_t
  845. capabilities:
  846. add:
  847. - NET_ADMIN
  848. - SYS_MODULE
  849. - SYS_ADMIN
  850. - SYS_RESOURCE
  851. drop:
  852. - ALL
  853. volumeMounts:
  854. - name: bpf-maps
  855. mountPath: /sys/fs/bpf
  856. # Required to mount cgroup filesystem from the host to cilium agent pod
  857. - name: cilium-cgroup
  858. mountPath: /run/cilium/cgroupv2
  859. mountPropagation: HostToContainer
  860. - name: cilium-run
  861. mountPath: /var/run/cilium
  862. resources:
  863. requests:
  864. cpu: 100m
  865. memory: 100Mi # wait-for-kube-proxy
  866. restartPolicy: Always
  867. priorityClassName: system-node-critical
  868. serviceAccount: "cilium"
  869. serviceAccountName: "cilium"
  870. terminationGracePeriodSeconds: 1
  871. hostNetwork: true
  872. affinity:
  873. podAntiAffinity:
  874. requiredDuringSchedulingIgnoredDuringExecution:
  875. - labelSelector:
  876. matchLabels:
  877. k8s-app: cilium
  878. topologyKey: kubernetes.io/hostname
  879. nodeSelector:
  880. kubernetes.io/os: linux
  881. tolerations:
  882. - operator: Exists
  883. volumes:
  884. # For sharing configuration between the "config" initContainer and the agent
  885. - name: tmp
  886. emptyDir: {}
  887. # To keep state between restarts / upgrades
  888. - name: cilium-run
  889. hostPath:
  890. path: /var/run/cilium
  891. type: DirectoryOrCreate
  892. # To keep state between restarts / upgrades for bpf maps
  893. - name: bpf-maps
  894. hostPath:
  895. path: /sys/fs/bpf
  896. type: DirectoryOrCreate
  897. # To mount cgroup2 filesystem on the host
  898. - name: hostproc
  899. hostPath:
  900. path: /proc
  901. type: Directory
  902. # To keep state between restarts / upgrades for cgroup2 filesystem
  903. - name: cilium-cgroup
  904. hostPath:
  905. path: /run/cilium/cgroupv2
  906. type: DirectoryOrCreate
  907. # To install cilium cni plugin in the host
  908. - name: cni-path
  909. hostPath:
  910. path: /opt/cni/bin
  911. type: DirectoryOrCreate
  912. # To install cilium cni configuration in the host
  913. - name: etc-cni-netd
  914. hostPath:
  915. path: /etc/cni/net.d
  916. type: DirectoryOrCreate
  917. # To be able to load kernel modules
  918. - name: lib-modules
  919. hostPath:
  920. path: /lib/modules
  921. # To access iptables concurrently with other processes (e.g. kube-proxy)
  922. - name: xtables-lock
  923. hostPath:
  924. path: /run/xtables.lock
  925. type: FileOrCreate
  926. # To read the clustermesh configuration
  927. - name: clustermesh-secrets
  928. secret:
  929. secretName: cilium-clustermesh
  930. # note: the leading zero means this number is in octal representation: do not remove it
  931. defaultMode: 0400
  932. optional: true
  933. - name: host-proc-sys-net
  934. hostPath:
  935. path: /proc/sys/net
  936. type: Directory
  937. - name: host-proc-sys-kernel
  938. hostPath:
  939. path: /proc/sys/kernel
  940. type: Directory
  941. ---
  942. # Source: cilium/templates/cilium-operator/deployment.yaml
  943. apiVersion: apps/v1
  944. kind: Deployment
  945. metadata:
  946. name: cilium-operator
  947. namespace: kube-system
  948. labels:
  949. io.cilium/app: operator
  950. name: cilium-operator
  951. app.kubernetes.io/part-of: cilium
  952. app.kubernetes.io/name: cilium-operator
  953. spec:
  954. # See docs on ServerCapabilities.LeasesResourceLock in file pkg/k8s/version/version.go
  955. # for more details.
  956. replicas: 2
  957. selector:
  958. matchLabels:
  959. io.cilium/app: operator
  960. name: cilium-operator
  961. strategy:
  962. rollingUpdate:
  963. maxSurge: 1
  964. maxUnavailable: 1
  965. type: RollingUpdate
  966. template:
  967. metadata:
  968. annotations:
  969. labels:
  970. io.cilium/app: operator
  971. name: cilium-operator
  972. app.kubernetes.io/part-of: cilium
  973. app.kubernetes.io/name: cilium-operator
  974. spec:
  975. containers:
  976. - name: cilium-operator
  977. image: "quay.io/cilium/operator-generic:v1.13.0@sha256:4b58d5b33e53378355f6e8ceb525ccf938b7b6f5384b35373f1f46787467ebf5"
  978. imagePullPolicy: IfNotPresent
  979. command:
  980. - cilium-operator-generic
  981. args:
  982. - --config-dir=/tmp/cilium/config-map
  983. - --debug=$(CILIUM_DEBUG)
  984. env:
  985. - name: K8S_NODE_NAME
  986. valueFrom:
  987. fieldRef:
  988. apiVersion: v1
  989. fieldPath: spec.nodeName
  990. - name: CILIUM_K8S_NAMESPACE
  991. valueFrom:
  992. fieldRef:
  993. apiVersion: v1
  994. fieldPath: metadata.namespace
  995. - name: CILIUM_DEBUG
  996. valueFrom:
  997. configMapKeyRef:
  998. key: debug
  999. name: cilium-config
  1000. optional: true
  1001. livenessProbe:
  1002. httpGet:
  1003. host: "127.0.0.1"
  1004. path: /healthz
  1005. port: 9234
  1006. scheme: HTTP
  1007. initialDelaySeconds: 60
  1008. periodSeconds: 10
  1009. timeoutSeconds: 3
  1010. volumeMounts:
  1011. - name: cilium-config-path
  1012. mountPath: /tmp/cilium/config-map
  1013. readOnly: true
  1014. terminationMessagePolicy: FallbackToLogsOnError
  1015. hostNetwork: true
  1016. restartPolicy: Always
  1017. priorityClassName: system-cluster-critical
  1018. serviceAccount: "cilium-operator"
  1019. serviceAccountName: "cilium-operator"
  1020. # In HA mode, cilium-operator pods must not be scheduled on the same
  1021. # node as they will clash with each other.
  1022. affinity:
  1023. podAntiAffinity:
  1024. requiredDuringSchedulingIgnoredDuringExecution:
  1025. - labelSelector:
  1026. matchLabels:
  1027. io.cilium/app: operator
  1028. topologyKey: kubernetes.io/hostname
  1029. nodeSelector:
  1030. kubernetes.io/os: linux
  1031. tolerations:
  1032. - operator: Exists
  1033. volumes:
  1034. # To read the configuration from the config map
  1035. - name: cilium-config-path
  1036. configMap:
  1037. name: cilium-config
  1038. ---
  1039. # Source: cilium/templates/cilium-secrets-namespace.yaml
  1040. # Only create the namespace if it's different from Ingress secret namespace or Ingress is not enabled.