Cilium 1.12 Upgrade (#9225)

* Drop support for Cilium < 1.10

Signed-off-by: necatican <necaticanyildirim@gmail.com>

* Synchronize Cilium templates for 1.11.7

Signed-off-by: necatican <contact@necatican.com>

* Set Cilium v1.12.1 as the default version

Signed-off-by: necatican <contact@necatican.com>

Signed-off-by: necatican <necaticanyildirim@gmail.com>
Signed-off-by: necatican <contact@necatican.com>
This commit is contained in:
Necatican Yıldırım 2022-09-19 12:14:31 +03:00 committed by GitHub
parent 680293e79c
commit 7da3dbcb39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 291 additions and 374 deletions

View file

@ -144,7 +144,7 @@ Note: Upstart/SysV init based OS types are not supported.
- [cni-plugins](https://github.com/containernetworking/plugins) v1.1.1 - [cni-plugins](https://github.com/containernetworking/plugins) v1.1.1
- [calico](https://github.com/projectcalico/calico) v3.23.3 - [calico](https://github.com/projectcalico/calico) v3.23.3
- [canal](https://github.com/projectcalico/canal) (given calico/flannel versions) - [canal](https://github.com/projectcalico/canal) (given calico/flannel versions)
- [cilium](https://github.com/cilium/cilium) v1.11.7 - [cilium](https://github.com/cilium/cilium) v1.12.1
- [flannel](https://github.com/flannel-io/flannel) v0.18.1 - [flannel](https://github.com/flannel-io/flannel) v0.18.1
- [kube-ovn](https://github.com/alauda/kube-ovn) v1.9.7 - [kube-ovn](https://github.com/alauda/kube-ovn) v1.9.7
- [kube-router](https://github.com/cloudnativelabs/kube-router) v1.5.1 - [kube-router](https://github.com/cloudnativelabs/kube-router) v1.5.1

View file

@ -56,7 +56,7 @@ cilium_operator_extra_volume_mounts:
## Choose Cilium version ## Choose Cilium version
```yml ```yml
cilium_version: v1.11.3 cilium_version: v1.12.1
``` ```
## Add variable to config ## Add variable to config

View file

@ -1,5 +1,5 @@
--- ---
# cilium_version: "v1.11.7" # cilium_version: "v1.12.1"
# Log-level # Log-level
# cilium_debug: false # cilium_debug: false
@ -118,6 +118,7 @@
# https://docs.cilium.io/en/stable/concepts/networking/masquerading/ # https://docs.cilium.io/en/stable/concepts/networking/masquerading/
# By default, all packets from a pod destined to an IP address outside of the cilium_native_routing_cidr range are masqueraded # By default, all packets from a pod destined to an IP address outside of the cilium_native_routing_cidr range are masqueraded
# cilium_ip_masq_agent_enable: false # cilium_ip_masq_agent_enable: false
### A packet sent from a pod to a destination which belongs to any CIDR from the nonMasqueradeCIDRs is not going to be masqueraded ### A packet sent from a pod to a destination which belongs to any CIDR from the nonMasqueradeCIDRs is not going to be masqueraded
# cilium_non_masquerade_cidrs: # cilium_non_masquerade_cidrs:
# - 10.0.0.0/8 # - 10.0.0.0/8

View file

@ -115,7 +115,7 @@ flannel_cni_version: "v1.1.0"
cni_version: "v1.1.1" cni_version: "v1.1.1"
weave_version: 2.8.1 weave_version: 2.8.1
pod_infra_version: "3.6" pod_infra_version: "3.6"
cilium_version: "v1.11.7" cilium_version: "v1.12.1"
kube_ovn_version: "v1.9.7" kube_ovn_version: "v1.9.7"
kube_ovn_dpdk_version: "19.11-{{ kube_ovn_version }}" kube_ovn_dpdk_version: "19.11-{{ kube_ovn_version }}"
kube_router_version: "v1.5.1" kube_router_version: "v1.5.1"

View file

@ -1,4 +1,5 @@
--- ---
cilium_min_version_required: "1.10"
# Log-level # Log-level
cilium_debug: false cilium_debug: false
@ -106,6 +107,7 @@ cilium_wireguard_userspace_fallback: false
# https://docs.cilium.io/en/stable/concepts/networking/masquerading/ # https://docs.cilium.io/en/stable/concepts/networking/masquerading/
# By default, all packets from a pod destined to an IP address outside of the cilium_native_routing_cidr range are masqueraded # By default, all packets from a pod destined to an IP address outside of the cilium_native_routing_cidr range are masqueraded
cilium_ip_masq_agent_enable: false cilium_ip_masq_agent_enable: false
### A packet sent from a pod to a destination which belongs to any CIDR from the nonMasqueradeCIDRs is not going to be masqueraded ### A packet sent from a pod to a destination which belongs to any CIDR from the nonMasqueradeCIDRs is not going to be masqueraded
cilium_non_masquerade_cidrs: cilium_non_masquerade_cidrs:
- 10.0.0.0/8 - 10.0.0.0/8
@ -201,7 +203,7 @@ cilium_cgroup_host_root: "/run/cilium/cgroupv2"
# Specifies the ratio (0.0-1.0) of total system memory to use for dynamic # Specifies the ratio (0.0-1.0) of total system memory to use for dynamic
# sizing of the TCP CT, non-TCP CT, NAT and policy BPF maps. # sizing of the TCP CT, non-TCP CT, NAT and policy BPF maps.
cilium_bpf_map_dynamic_size_ratio: "{%- if cilium_version | regex_replace('v') is version('1.8', '>=') -%}0.0025{%- else -%}0.0{%- endif -%}" cilium_bpf_map_dynamic_size_ratio: "0.0025"
# -- Enables masquerading of IPv4 traffic leaving the node from endpoints. # -- Enables masquerading of IPv4 traffic leaving the node from endpoints.
# Available for Cilium v1.10 and up # Available for Cilium v1.10 and up
@ -240,3 +242,8 @@ cilium_disable_cnp_status_updates: true
# Configure how long to wait for the Cilium DaemonSet to be ready again # Configure how long to wait for the Cilium DaemonSet to be ready again
cilium_rolling_restart_wait_retries_count: 30 cilium_rolling_restart_wait_retries_count: 30
cilium_rolling_restart_wait_retries_delay_seconds: 10 cilium_rolling_restart_wait_retries_delay_seconds: 10
# Cilium changed the default metrics exporter ports in 1.12
cilium_agent_scrape_port: "{{ cilium_version | regex_replace('v') is version('1.12', '>=') | ternary('9962', '9090') }}"
cilium_operator_scrape_port: "{{ cilium_version | regex_replace('v') is version('1.12', '>=') | ternary('9963', '6942') }}"
cilium_hubble_scrape_port: "{{ cilium_version | regex_replace('v') is version('1.12', '>=') | ternary('9965', '9091') }}"

View file

@ -48,13 +48,10 @@
msg: "cilium_encryption_type must be either 'ipsec' or 'wireguard'" msg: "cilium_encryption_type must be either 'ipsec' or 'wireguard'"
when: cilium_encryption_enabled when: cilium_encryption_enabled
- name: Stop if `cilium_encryption_type` is set to "wireguard" and cilium_version is < v1.10.0 - name: Stop if cilium_version is < v1.10.0
assert: assert:
that: cilium_version | regex_replace('v') is version('1.10', '>') that: cilium_version | regex_replace('v') is version(cilium_min_version_required, '>=')
msg: "cilium_encryption_type is set to 'wireguard' but cilium_version is < v1.10.0" msg: "cilium_version is too low. Minimum version {{ cilium_min_version_required }}"
when:
- cilium_encryption_enabled
- cilium_encryption_type == "wireguard"
# TODO: Clean this task up when we drop backward compatibility support for `cilium_ipsec_enabled` # TODO: Clean this task up when we drop backward compatibility support for `cilium_ipsec_enabled`
- name: Set `cilium_encryption_type` to "ipsec" and if `cilium_ipsec_enabled` is true - name: Set `cilium_encryption_type` to "ipsec" and if `cilium_ipsec_enabled` is true

View file

@ -39,7 +39,14 @@ rules:
- get - get
- list - list
- watch - watch
{% if cilium_version | regex_replace('v') is version('1.10', '>=') %} - apiGroups:
- ""
resources:
- services
verbs:
- get
- list
- watch
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
@ -47,22 +54,14 @@ rules:
- services/status - services/status
verbs: verbs:
- update - update
{% endif %}
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
# to automatically read from k8s and import the node's pod CIDR to cilium's
# etcd so all nodes know how to reach another pod running in in a different
# node.
- nodes
# to perform the translation of a CNP that contains `ToGroup` to its endpoints # to perform the translation of a CNP that contains `ToGroup` to its endpoints
- services - services
- endpoints - endpoints
# to check apiserver connectivity # to check apiserver connectivity
- namespaces - namespaces
{% if cilium_version | regex_replace('v') is version('1.7', '<') %}
- componentstatuses
{% endif %}
verbs: verbs:
- get - get
- list - list
@ -72,26 +71,22 @@ rules:
resources: resources:
- ciliumnetworkpolicies - ciliumnetworkpolicies
- ciliumnetworkpolicies/status - ciliumnetworkpolicies/status
- ciliumnetworkpolicies/finalizers
- ciliumclusterwidenetworkpolicies - ciliumclusterwidenetworkpolicies
- ciliumclusterwidenetworkpolicies/status - ciliumclusterwidenetworkpolicies/status
- ciliumclusterwidenetworkpolicies/finalizers
- ciliumendpoints - ciliumendpoints
- ciliumendpoints/status - ciliumendpoints/status
{% if cilium_version | regex_replace('v') is version('1.6', '>=') %} - ciliumendpoints/finalizers
- ciliumnodes - ciliumnodes
- ciliumnodes/status - ciliumnodes/status
- ciliumnodes/finalizers
- ciliumidentities - ciliumidentities
- ciliumidentities/status - ciliumidentities/status
{% endif %}
{% if cilium_version | regex_replace('v') is version('1.9', '>=') %}
- ciliumnetworkpolicies/finalizers
- ciliumclusterwidenetworkpolicies/finalizers
- ciliumendpoints/finalizers
- ciliumnodes/finalizers
- ciliumidentities/finalizers - ciliumidentities/finalizers
- ciliumlocalredirectpolicies - ciliumlocalredirectpolicies
- ciliumlocalredirectpolicies/status - ciliumlocalredirectpolicies/status
- ciliumlocalredirectpolicies/finalizers - ciliumlocalredirectpolicies/finalizers
{% endif %}
{% if cilium_version | regex_replace('v') is version('1.11', '>=') %} {% if cilium_version | regex_replace('v') is version('1.11', '>=') %}
- ciliumendpointslices - ciliumendpointslices
{% endif %} {% endif %}
@ -101,12 +96,7 @@ rules:
- ciliumenvoyconfigs - ciliumenvoyconfigs
{% endif %} {% endif %}
verbs: verbs:
- get - '*'
- list
- watch
- create
- update
- delete
- apiGroups: - apiGroups:
- apiextensions.k8s.io - apiextensions.k8s.io
resources: resources:
@ -117,16 +107,12 @@ rules:
- list - list
- update - update
- watch - watch
{% if cilium_version | regex_replace('v') is version('1.8', '>=') %}
# For cilium-operator running in HA mode. # For cilium-operator running in HA mode.
# #
# Cilium operator running in HA mode requires the use of ResourceLock for Leader Election # Cilium operator running in HA mode requires the use of ResourceLock for Leader Election
# between mulitple running instances. # between multiple running instances.
# The preferred way of doing this is to use LeasesResourceLock as edits to Leases are less # The preferred way of doing this is to use LeasesResourceLock as edits to Leases are less
# common and fewer objects in the cluster watch "all Leases". # common and fewer objects in the cluster watch "all Leases".
# The support for leases was introduced in coordination.k8s.io/v1 during Kubernetes 1.14 release.
# In Cilium we currently don't support HA mode for K8s version < 1.14. This condition make sure
# that we only authorize access to leases resources in supported K8s versions.
- apiGroups: - apiGroups:
- coordination.k8s.io - coordination.k8s.io
resources: resources:
@ -135,4 +121,26 @@ rules:
- create - create
- get - get
- update - update
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- update
resourceNames:
- ciliumbgploadbalancerippools.cilium.io
- ciliumbgppeeringpolicies.cilium.io
- ciliumclusterwideenvoyconfigs.cilium.io
- ciliumclusterwidenetworkpolicies.cilium.io
- ciliumegressgatewaypolicies.cilium.io
- ciliumegressnatpolicies.cilium.io
- ciliumendpoints.cilium.io
- ciliumendpointslices.cilium.io
- ciliumenvoyconfigs.cilium.io
- ciliumexternalworkloads.cilium.io
- ciliumidentities.cilium.io
- ciliumlocalredirectpolicies.cilium.io
- ciliumnetworkpolicies.cilium.io
- ciliumnodes.cilium.io
{% endif %} {% endif %}

View file

@ -2,11 +2,11 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: cilium-operator
namespace: kube-system
labels: labels:
io.cilium/app: operator io.cilium/app: operator
name: cilium-operator name: cilium-operator
name: cilium-operator
namespace: kube-system
spec: spec:
replicas: {{ cilium_operator_replicas }} replicas: {{ cilium_operator_replicas }}
selector: selector:
@ -22,29 +22,22 @@ spec:
metadata: metadata:
{% if cilium_enable_prometheus %} {% if cilium_enable_prometheus %}
annotations: annotations:
prometheus.io/port: "6942" prometheus.io/port: "{{ cilium_operator_scrape_port }}"
prometheus.io/scrape: "true" prometheus.io/scrape: "true"
{% endif %} {% endif %}
labels: labels:
io.cilium/app: operator io.cilium/app: operator
name: cilium-operator name: cilium-operator
spec: spec:
# In HA mode, cilium-operator pods must not be scheduled on the same
# node as they will clash with each other.
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: io.cilium/app
operator: In
values:
- operator
topologyKey: "kubernetes.io/hostname"
containers: containers:
- args: - name: cilium-operator
- --debug=$(CILIUM_DEBUG) image: "{{ cilium_operator_image_repo }}:{{ cilium_operator_image_tag }}"
imagePullPolicy: {{ k8s_image_pull_policy }}
command:
- cilium-operator
args:
- --config-dir=/tmp/cilium/config-map - --config-dir=/tmp/cilium/config-map
- --debug=$(CILIUM_DEBUG)
{% if cilium_operator_custom_args is string %} {% if cilium_operator_custom_args is string %}
- {{ cilium_operator_custom_args }} - {{ cilium_operator_custom_args }}
{% else %} {% else %}
@ -52,14 +45,7 @@ spec:
- {{ flag }} - {{ flag }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
command:
- cilium-operator
env: env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: K8S_NODE_NAME - name: K8S_NODE_NAME
valueFrom: valueFrom:
fieldRef: fieldRef:
@ -76,45 +62,23 @@ spec:
key: debug key: debug
name: cilium-config name: cilium-config
optional: true optional: true
# We are already mounting the whole ConfigMap as a directory.
# https://github.com/cilium/cilium/pull/10347
{% if cilium_version | regex_replace('v') is version('1.8', '<') %}
- name: CILIUM_CLUSTER_NAME
valueFrom:
configMapKeyRef:
key: cluster-name
name: cilium-config
optional: true
- name: CILIUM_CLUSTER_ID
valueFrom:
configMapKeyRef:
key: cluster-id
name: cilium-config
optional: true
- name: CILIUM_DISABLE_ENDPOINT_CRD
valueFrom:
configMapKeyRef:
key: disable-endpoint-crd
name: cilium-config
optional: true
{% endif %}
- name: AWS_ACCESS_KEY_ID - name: AWS_ACCESS_KEY_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
key: AWS_ACCESS_KEY_ID
name: cilium-aws name: cilium-aws
key: AWS_ACCESS_KEY_ID
optional: true optional: true
- name: AWS_SECRET_ACCESS_KEY - name: AWS_SECRET_ACCESS_KEY
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
key: AWS_SECRET_ACCESS_KEY
name: cilium-aws name: cilium-aws
key: AWS_SECRET_ACCESS_KEY
optional: true optional: true
- name: AWS_DEFAULT_REGION - name: AWS_DEFAULT_REGION
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
key: AWS_DEFAULT_REGION
name: cilium-aws name: cilium-aws
key: AWS_DEFAULT_REGION
optional: true optional: true
{% if cilium_kube_proxy_replacement == 'strict' %} {% if cilium_kube_proxy_replacement == 'strict' %}
- name: KUBERNETES_SERVICE_HOST - name: KUBERNETES_SERVICE_HOST
@ -122,14 +86,16 @@ spec:
- name: KUBERNETES_SERVICE_PORT - name: KUBERNETES_SERVICE_PORT
value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}" value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}"
{% endif %} {% endif %}
image: "{{ cilium_operator_image_repo }}:{{ cilium_operator_image_tag }}"
imagePullPolicy: {{ k8s_image_pull_policy }}
name: cilium-operator
{% if cilium_enable_prometheus %} {% if cilium_enable_prometheus %}
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
ports: ports:
- containerPort: 6942 - name: prometheus
hostPort: 6942 containerPort: {{ cilium_operator_scrape_port }}
name: prometheus hostPort: {{ cilium_operator_scrape_port }}
protocol: TCP protocol: TCP
{% endif %} {% endif %}
livenessProbe: livenessProbe:
@ -146,46 +112,55 @@ spec:
periodSeconds: 10 periodSeconds: 10
timeoutSeconds: 3 timeoutSeconds: 3
volumeMounts: volumeMounts:
{% if cilium_identity_allocation_mode == "kvstore" %} - name: cilium-config-path
- mountPath: /var/lib/etcd-config mountPath: /tmp/cilium/config-map
name: etcd-config-path
readOnly: true readOnly: true
- mountPath: "{{cilium_cert_dir}}" {% if cilium_identity_allocation_mode == "kvstore" %}
name: etcd-secrets - name: etcd-config-path
mountPath: /var/lib/etcd-config
readOnly: true
- name: etcd-secrets
mountPath: "{{cilium_cert_dir}}"
readOnly: true readOnly: true
{% endif %} {% endif %}
- mountPath: /tmp/cilium/config-map
name: cilium-config-path
readOnly: true
{% for volume_mount in cilium_operator_extra_volume_mounts %} {% for volume_mount in cilium_operator_extra_volume_mounts %}
- {{ volume_mount | to_nice_yaml(indent=2) | indent(14) }} - {{ volume_mount | to_nice_yaml(indent=2) | indent(14) }}
{% endfor %} {% endfor %}
dnsPolicy: ClusterFirst hostNetwork: true
priorityClassName: system-node-critical dnsPolicy: ClusterFirstWithHostNet
restartPolicy: Always restartPolicy: Always
priorityClassName: system-node-critical
serviceAccount: cilium-operator serviceAccount: cilium-operator
serviceAccountName: cilium-operator serviceAccountName: cilium-operator
hostNetwork: true # In HA mode, cilium-operator pods must not be scheduled on the same
# node as they will clash with each other.
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
io.cilium/app: operator
tolerations: tolerations:
- operator: Exists - operator: Exists
volumes: volumes:
- name: cilium-config-path
configMap:
name: cilium-config
{% if cilium_identity_allocation_mode == "kvstore" %} {% if cilium_identity_allocation_mode == "kvstore" %}
# To read the etcd config stored in config maps # To read the etcd config stored in config maps
- configMap: - name: etcd-config-path
configMap:
name: cilium-config
defaultMode: 420 defaultMode: 420
items: items:
- key: etcd-config - key: etcd-config
path: etcd.config path: etcd.config
name: cilium-config
name: etcd-config-path
# To read the k8s etcd secrets in case the user might want to use TLS # To read the k8s etcd secrets in case the user might want to use TLS
- name: etcd-secrets - name: etcd-secrets
hostPath: hostPath:
path: "{{cilium_cert_dir}}" path: "{{cilium_cert_dir}}"
{% endif %} {% endif %}
- configMap:
name: cilium-config
name: cilium-config-path
{% for volume in cilium_operator_extra_volumes %} {% for volume in cilium_operator_extra_volumes %}
- {{ volume | to_nice_yaml(indent=2) | indent(10) }} - {{ volume | to_nice_yaml(indent=2) | indent(10) }}
{% endfor %} {% endfor %}

View file

@ -41,8 +41,8 @@ data:
# NOTE that this will open the port on ALL nodes where Cilium pods are # NOTE that this will open the port on ALL nodes where Cilium pods are
# scheduled. # scheduled.
{% if cilium_enable_prometheus %} {% if cilium_enable_prometheus %}
prometheus-serve-addr: ":9090" prometheus-serve-addr: ":{{ cilium_agent_scrape_port }}"
operator-prometheus-serve-addr: ":6942" operator-prometheus-serve-addr: ":{{ cilium_operator_scrape_port }}"
enable-metrics: "true" enable-metrics: "true"
{% endif %} {% endif %}
@ -127,31 +127,6 @@ data:
cluster-id: "{{ cilium_cluster_id }}" cluster-id: "{{ cilium_cluster_id }}"
{% endif %} {% endif %}
# `tofqdns-enable-poller` is deprecated in 1.8, removed in 1.9
# https://github.com/cilium/cilium/issues/8604
{% if cilium_version | regex_replace('v') is version('1.9', '<') %}
# DNS Polling periodically issues a DNS lookup for each `matchName` from
# cilium-agent. The result is used to regenerate endpoint policy.
# DNS lookups are repeated with an interval of 5 seconds, and are made for
# A(IPv4) and AAAA(IPv6) addresses. Should a lookup fail, the most recent IP
# data is used instead. An IP change will trigger a regeneration of the Cilium
# policy for each endpoint and increment the per cilium-agent policy
# repository revision.
#
# This option is disabled by default starting from version 1.4.x in favor
# of a more powerful DNS proxy-based implementation, see [0] for details.
# Enable this option if you want to use FQDN policies but do not want to use
# the DNS proxy.
#
# To ease upgrade, users may opt to set this option to "true".
# Otherwise please refer to the Upgrade Guide [1] which explains how to
# prepare policy rules for upgrade.
#
# [0] http://docs.cilium.io/en/stable/policy/language/#dns-based
# [1] http://docs.cilium.io/en/stable/install/upgrade/#changes-that-may-require-action
tofqdns-enable-poller: "{{cilium_tofqdns_enable_poller}}"
{% endif %}
# `wait-bpf-mount` is removed after v1.10.4 # `wait-bpf-mount` is removed after v1.10.4
# https://github.com/cilium/cilium/commit/d2217045cb3726a7f823174e086913b69b8090da # https://github.com/cilium/cilium/commit/d2217045cb3726a7f823174e086913b69b8090da
{% if cilium_version | regex_replace('v') is version('1.10.4', '<') %} {% if cilium_version | regex_replace('v') is version('1.10.4', '<') %}
@ -159,14 +134,6 @@ data:
wait-bpf-mount: "false" wait-bpf-mount: "false"
{% endif %} {% endif %}
# `enable-legacy-services` is deprecated in 1.6, removed in 1.9
# https://github.com/cilium/cilium/pull/10255
{% if cilium_version | regex_replace('v') is version('1.9', '<') %}
# Enable legacy services (prior v1.5) to prevent from terminating existing
# connections with services when upgrading Cilium from < v1.5 to v1.5.
enable-legacy-services: "{{cilium_enable_legacy_services}}"
{% endif %}
kube-proxy-replacement: "{{ cilium_kube_proxy_replacement }}" kube-proxy-replacement: "{{ cilium_kube_proxy_replacement }}"
# `native-routing-cidr` is deprecated in 1.10, removed in 1.12. # `native-routing-cidr` is deprecated in 1.10, removed in 1.12.
@ -191,7 +158,7 @@ data:
{% if cilium_enable_hubble %} {% if cilium_enable_hubble %}
enable-hubble: "true" enable-hubble: "true"
{% if cilium_enable_hubble_metrics %} {% if cilium_enable_hubble_metrics %}
hubble-metrics-server: ":9091" hubble-metrics-server: ":{{ cilium_hubble_scrape_port }}"
hubble-metrics: hubble-metrics:
{% for hubble_metrics_cycle in cilium_hubble_metrics %} {% for hubble_metrics_cycle in cilium_hubble_metrics %}
{{ hubble_metrics_cycle }} {{ hubble_metrics_cycle }}
@ -228,9 +195,7 @@ data:
{% endif %} {% endif %}
# IPAM settings # IPAM settings
{% if cilium_version | regex_replace('v') is version('1.9', '>=') %}
ipam: "{{ cilium_ipam_mode }}" ipam: "{{ cilium_ipam_mode }}"
{% endif %}
agent-health-port: "{{ cilium_agent_health_port }}" agent-health-port: "{{ cilium_agent_health_port }}"
@ -240,10 +205,8 @@ data:
bpf-map-dynamic-size-ratio: "{{ cilium_bpf_map_dynamic_size_ratio }}" bpf-map-dynamic-size-ratio: "{{ cilium_bpf_map_dynamic_size_ratio }}"
{% if cilium_version | regex_replace('v') is version('1.10', '>=') %}
enable-ipv4-masquerade: "{{ cilium_enable_ipv4_masquerade }}" enable-ipv4-masquerade: "{{ cilium_enable_ipv4_masquerade }}"
enable-ipv6-masquerade: "{{ cilium_enable_ipv6_masquerade }}" enable-ipv6-masquerade: "{{ cilium_enable_ipv6_masquerade }}"
{% endif %}
enable-bpf-masquerade: "{{ cilium_enable_bpf_masquerade }}" enable-bpf-masquerade: "{{ cilium_enable_bpf_masquerade }}"
@ -258,7 +221,6 @@ data:
enable-bpf-clock-probe: "{{ cilium_enable_bpf_clock_probe }}" enable-bpf-clock-probe: "{{ cilium_enable_bpf_clock_probe }}"
disable-cnp-status-updates: "{{ cilium_disable_cnp_status_updates }}" disable-cnp-status-updates: "{{ cilium_disable_cnp_status_updates }}"
{% if cilium_ip_masq_agent_enable %} {% if cilium_ip_masq_agent_enable %}
--- ---
apiVersion: v1 apiVersion: v1

View file

@ -7,9 +7,6 @@ rules:
- apiGroups: - apiGroups:
- networking.k8s.io - networking.k8s.io
resources: resources:
{% if cilium_version | regex_replace('v') is version('1.7', '<') %}
- ingresses
{% endif %}
- networkpolicies - networkpolicies
verbs: verbs:
- get - get
@ -28,34 +25,25 @@ rules:
resources: resources:
- namespaces - namespaces
- services - services
- nodes - pods
- endpoints - endpoints
{% if cilium_version | regex_replace('v') is version('1.7', '<') %} - nodes
- componentstatuses
{% endif %}
verbs: verbs:
- get - get
- list - list
- watch - watch
{% if cilium_version | regex_replace('v') is version('1.7', '<') %} {% if cilium_version | regex_replace('v') is version('1.12', '<') %}
- apiGroups:
- extensions
resources:
- ingresses
verbs:
- create
- get
- list
- watch
{% endif %}
{% if cilium_version | regex_replace('v') is version('1.7', '>') %}
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- pods
- pods/finalizers - pods/finalizers
verbs: verbs:
- get
- list
- watch
- update - update
{% endif %} - delete
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
@ -66,6 +54,7 @@ rules:
- list - list
- watch - watch
- update - update
{% endif %}
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
@ -78,47 +67,45 @@ rules:
resources: resources:
- customresourcedefinitions - customresourcedefinitions
verbs: verbs:
# Deprecated for removal in v1.10
- create - create
- get
- list - list
- watch - watch
- update - update
# This is used when validating policies in preflight. This will need to stay
# until we figure out how to avoid "get" inside the preflight, and then
# should be removed ideally.
- get
- apiGroups: - apiGroups:
- cilium.io - cilium.io
resources: resources:
- ciliumnetworkpolicies - ciliumnetworkpolicies
- ciliumnetworkpolicies/status - ciliumnetworkpolicies/status
{% if cilium_version | regex_replace('v') is version('1.7', '>=') %}
- ciliumclusterwidenetworkpolicies - ciliumclusterwidenetworkpolicies
- ciliumclusterwidenetworkpolicies/status - ciliumclusterwidenetworkpolicies/status
{% endif %}
- ciliumendpoints - ciliumendpoints
- ciliumendpoints/status - ciliumendpoints/status
{% if cilium_version | regex_replace('v') is version('1.6', '>=') %}
- ciliumnodes - ciliumnodes
- ciliumnodes/status - ciliumnodes/status
- ciliumidentities - ciliumidentities
- ciliumidentities/status
{% endif %}
{% if cilium_version | regex_replace('v') is version('1.9', '>=') %}
- ciliumnetworkpolicies/finalizers
- ciliumclusterwidenetworkpolicies/finalizers
- ciliumendpoints/finalizers
- ciliumnodes/finalizers
- ciliumidentities/finalizers
- ciliumlocalredirectpolicies - ciliumlocalredirectpolicies
- ciliumlocalredirectpolicies/status - ciliumlocalredirectpolicies/status
- ciliumlocalredirectpolicies/finalizers
{% endif %}
{% if cilium_version | regex_replace('v') is version('1.10', '>=') %}
- ciliumegressnatpolicies - ciliumegressnatpolicies
{% endif %}
{% if cilium_version | regex_replace('v') is version('1.11', '>=') %} {% if cilium_version | regex_replace('v') is version('1.11', '>=') %}
- ciliumendpointslices - ciliumendpointslices
{% endif %} {% endif %}
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %} {% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
- ciliumbgploadbalancerippools - ciliumbgploadbalancerippools
- ciliumbgppeeringpolicies - ciliumbgppeeringpolicies
{% endif %}
{% if cilium_version | regex_replace('v') is version('1.11.5', '<') %}
- ciliumnetworkpolicies/finalizers
- ciliumclusterwidenetworkpolicies/finalizers
- ciliumendpoints/finalizers
- ciliumnodes/finalizers
- ciliumidentities/finalizers
- ciliumlocalredirectpolicies/finalizers
{% endif %} {% endif %}
verbs: verbs:
- '*' - '*'
@ -128,6 +115,7 @@ rules:
resources: resources:
- ciliumclusterwideenvoyconfigs - ciliumclusterwideenvoyconfigs
- ciliumenvoyconfigs - ciliumenvoyconfigs
- ciliumegressgatewaypolicies
verbs: verbs:
- list - list
- watch - watch

View file

@ -11,8 +11,3 @@ subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: cilium name: cilium
namespace: kube-system namespace: kube-system
{% if cilium_version | regex_replace('v') is version('1.9', '<') %}
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:nodes
{% endif %}

View file

@ -2,37 +2,37 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
labels:
k8s-app: cilium
name: cilium name: cilium
namespace: kube-system namespace: kube-system
labels:
k8s-app: cilium
spec: spec:
selector: selector:
matchLabels: matchLabels:
k8s-app: cilium k8s-app: cilium
updateStrategy:
rollingUpdate:
# Specifies the maximum number of Pods that can be unavailable during the update process.
maxUnavailable: 2
type: RollingUpdate
template: template:
metadata: metadata:
annotations: annotations:
{% if cilium_enable_prometheus %} {% if cilium_enable_prometheus %}
prometheus.io/port: "9090" prometheus.io/port: "{{ cilium_agent_scrape_port }}"
prometheus.io/scrape: "true" prometheus.io/scrape: "true"
{% endif %} {% endif %}
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated","operator":"Equal","value":"master","effect":"NoSchedule"}]' scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated","operator":"Equal","value":"master","effect":"NoSchedule"}]'
labels: labels:
k8s-app: cilium k8s-app: cilium
spec: spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values:
- cilium
topologyKey: kubernetes.io/hostname
containers: containers:
- args: - name: cilium-agent
image: "{{cilium_image_repo}}:{{cilium_image_tag}}"
imagePullPolicy: {{ k8s_image_pull_policy }}
command:
- cilium-agent
args:
- --config-dir=/tmp/cilium/config-map - --config-dir=/tmp/cilium/config-map
{% if cilium_mtu != "" %} {% if cilium_mtu != "" %}
- --mtu={{ cilium_mtu }} - --mtu={{ cilium_mtu }}
@ -44,54 +44,6 @@ spec:
- {{ flag }} - {{ flag }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
command:
- cilium-agent
env:
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: CILIUM_K8S_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: CILIUM_CLUSTERMESH_CONFIG
value: /var/lib/cilium/clustermesh/
{% if cilium_kube_proxy_replacement == 'strict' %}
- name: KUBERNETES_SERVICE_HOST
value: "{{ kube_apiserver_global_endpoint | urlsplit('hostname') }}"
- name: KUBERNETES_SERVICE_PORT
value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}"
{% endif %}
{% for env_var in cilium_agent_extra_env_vars %}
- {{ env_var | to_nice_yaml(indent=2) | indent(10) }}
{% endfor %}
image: "{{cilium_image_repo}}:{{cilium_image_tag}}"
imagePullPolicy: {{ k8s_image_pull_policy }}
resources:
limits:
cpu: {{ cilium_cpu_limit }}
memory: {{ cilium_memory_limit }}
requests:
cpu: {{ cilium_cpu_requests }}
memory: {{ cilium_memory_requests }}
lifecycle:
postStart:
exec:
command:
- "/cni-install.sh"
{% if cilium_version | regex_replace('v') is version('1.10', '>=') %}
- "--cni-exclusive={{ cilium_cni_exclusive }}"
{% endif %}
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
- "--log-file={{ cilium_cni_log_file }}"
{% endif %}
preStop:
exec:
command:
- /cni-uninstall.sh
startupProbe: startupProbe:
httpGet: httpGet:
host: '127.0.0.1' host: '127.0.0.1'
@ -131,80 +83,109 @@ spec:
successThreshold: 1 successThreshold: 1
failureThreshold: 3 failureThreshold: 3
timeoutSeconds: 5 timeoutSeconds: 5
name: cilium-agent env:
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: CILIUM_K8S_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: CILIUM_CLUSTERMESH_CONFIG
value: /var/lib/cilium/clustermesh/
{% if cilium_kube_proxy_replacement == 'strict' %}
- name: KUBERNETES_SERVICE_HOST
value: "{{ kube_apiserver_global_endpoint | urlsplit('hostname') }}"
- name: KUBERNETES_SERVICE_PORT
value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}"
{% endif %}
{% for env_var in cilium_agent_extra_env_vars %}
- {{ env_var | to_nice_yaml(indent=2) | indent(10) }}
{% endfor %}
lifecycle:
postStart:
exec:
command:
- "/cni-install.sh"
- "--cni-exclusive={{ cilium_cni_exclusive | string | lower }}"
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
- "--enable-debug={{ cilium_debug | string | lower }}"
- "--log-file={{ cilium_cni_log_file }}"
{% endif %}
preStop:
exec:
command:
- /cni-uninstall.sh
resources:
limits:
cpu: {{ cilium_cpu_limit }}
memory: {{ cilium_memory_limit }}
requests:
cpu: {{ cilium_cpu_requests }}
memory: {{ cilium_memory_requests }}
{% if cilium_enable_prometheus or cilium_enable_hubble_metrics %} {% if cilium_enable_prometheus or cilium_enable_hubble_metrics %}
ports: ports:
{% endif %} {% endif %}
{% if cilium_enable_prometheus %} {% if cilium_enable_prometheus %}
- containerPort: 9090 - name: prometheus
hostPort: 9090 containerPort: {{ cilium_agent_scrape_port }}
name: prometheus hostPort: {{ cilium_agent_scrape_port }}
protocol: TCP protocol: TCP
{% endif %} {% endif %}
{% if cilium_enable_hubble_metrics %} {% if cilium_enable_hubble_metrics %}
- containerPort: 9091 - name: hubble-metrics
hostPort: 9091 containerPort: {{ cilium_hubble_scrape_port }}
name: hubble-metrics hostPort: {{ cilium_hubble_scrape_port }}
protocol: TCP protocol: TCP
{% endif %} {% endif %}
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:
- mountPath: /sys/fs/bpf - name: bpf-maps
name: bpf-maps mountPath: /sys/fs/bpf
mountPropagation: Bidirectional mountPropagation: Bidirectional
- mountPath: /var/run/cilium - name: cilium-run
name: cilium-run mountPath: /var/run/cilium
- mountPath: /host/opt/cni/bin - name: cni-path
name: cni-path mountPath: /host/opt/cni/bin
- mountPath: /host/etc/cni/net.d - name: etc-cni-netd
name: etc-cni-netd mountPath: /host/etc/cni/net.d
# pkg/workloads was depreca, removed in 1.7
# https://github.com/cilium/cilium/pull/9447
{% if cilium_version | regex_replace('v') is version('1.7', '<') %}
{% if container_manager == 'docker' %}
- mountPath: /var/run/docker.sock
name: docker-socket
readOnly: true
{% else %}
- name: "{{ container_manager }}-socket"
mountPath: {{ cri_socket }}
readOnly: true
{% endif %}
{% endif %}
{% if cilium_identity_allocation_mode == "kvstore" %} {% if cilium_identity_allocation_mode == "kvstore" %}
- mountPath: /var/lib/etcd-config - name: etcd-config-path
name: etcd-config-path mountPath: /var/lib/etcd-config
readOnly: true readOnly: true
- mountPath: "{{cilium_cert_dir}}" - name: etcd-secrets
name: etcd-secrets mountPath: "{{cilium_cert_dir}}"
readOnly: true readOnly: true
{% endif %} {% endif %}
- mountPath: /var/lib/cilium/clustermesh - name: clustermesh-secrets
name: clustermesh-secrets mountPath: /var/lib/cilium/clustermesh
readOnly: true readOnly: true
- mountPath: /tmp/cilium/config-map - name: cilium-config-path
name: cilium-config-path mountPath: /tmp/cilium/config-map
readOnly: true readOnly: true
{% if cilium_ip_masq_agent_enable %} {% if cilium_ip_masq_agent_enable %}\
- name: ip-masq-agent - name: ip-masq-agent
mountPath: /etc/config mountPath: /etc/config
readOnly: true readOnly: true
{% endif %} {% endif %}
# Needed to be able to load kernel modules # Needed to be able to load kernel modules
- mountPath: /lib/modules - name: lib-modules
name: lib-modules mountPath: /lib/modules
readOnly: true readOnly: true
- mountPath: /run/xtables.lock - name: xtables-lock
name: xtables-lock mountPath: /run/xtables.lock
{% if cilium_encryption_enabled and cilium_encryption_type == "ipsec" %} {% if cilium_encryption_enabled and cilium_encryption_type == "ipsec" %}
- mountPath: /etc/ipsec - name: cilium-ipsec-secrets
name: cilium-ipsec-secrets mountPath: /etc/ipsec
readOnly: true readOnly: true
{% endif %} {% endif %}
{% if cilium_hubble_install %} {% if cilium_hubble_install %}
- mountPath: /var/lib/cilium/tls/hubble - name: hubble-tls
name: hubble-tls mountPath: /var/lib/cilium/tls/hubble
readOnly: true readOnly: true
{% endif %} {% endif %}
{% for volume_mount in cilium_agent_extra_volume_mounts %} {% for volume_mount in cilium_agent_extra_volume_mounts %}
@ -245,22 +226,50 @@ spec:
securityContext: securityContext:
privileged: true privileged: true
{% endif %} {% endif %}
- command: {% if cilium_version | regex_replace('v') is version('1.11.7', '>=') %}
- name: apply-sysctl-overwrites
image: "{{cilium_image_repo}}:{{cilium_image_tag}}"
imagePullPolicy: {{ k8s_image_pull_policy }}
env:
- name: BIN_PATH
value: /opt/cni/bin
command:
- sh
- -ec
# The statically linked Go program binary is invoked to avoid any
# dependency on utilities like sh that can be missing on certain
# distros installed on the underlying host. Copy the binary to the
# same directory where we install cilium cni plugin so that exec permissions
# are available.
- |
cp /usr/bin/cilium-sysctlfix /hostbin/cilium-sysctlfix;
nsenter --mount=/hostproc/1/ns/mnt "${BIN_PATH}/cilium-sysctlfix";
rm /hostbin/cilium-sysctlfix
volumeMounts:
- name: hostproc
mountPath: /hostproc
- name: cni-path
mountPath: /hostbin
securityContext:
privileged: true
{% endif %}
- name: clean-cilium-state
image: "{{cilium_image_repo}}:{{cilium_image_tag}}"
imagePullPolicy: {{ k8s_image_pull_policy }}
command:
- /init-container.sh - /init-container.sh
env: env:
- name: CILIUM_ALL_STATE - name: CILIUM_ALL_STATE
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
key: clean-cilium-state
name: cilium-config name: cilium-config
key: clean-cilium-state
optional: true optional: true
# CLEAN_CILIUM_BPF_STATE is deprecated in 1.6. - name: CILIUM_BPF_STATE
# https://github.com/cilium/cilium/pull/7478
- name: "{{ cilium_version | regex_replace('v') is version('1.6', '<')| ternary('CLEAN_CILIUM_BPF_STATE','CILIUM_BPF_STATE') }}"
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
key: clean-cilium-bpf-state
name: cilium-config name: cilium-config
key: clean-cilium-bpf-state
optional: true optional: true
# Removed in 1.11 and up. # Removed in 1.11 and up.
# https://github.com/cilium/cilium/commit/f7a3f59fd74983c600bfce9cac364b76d20849d9 # https://github.com/cilium/cilium/commit/f7a3f59fd74983c600bfce9cac364b76d20849d9
@ -278,32 +287,25 @@ spec:
- name: KUBERNETES_SERVICE_PORT - name: KUBERNETES_SERVICE_PORT
value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}" value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}"
{% endif %} {% endif %}
{% if cilium_version | regex_replace('v') is version('1.9', '<') %}
image: "{{cilium_init_image_repo}}:{{cilium_init_image_tag}}"
{% else %}
image: "{{cilium_image_repo}}:{{cilium_image_tag}}"
{% endif %}
imagePullPolicy: {{ k8s_image_pull_policy }}
name: clean-cilium-state
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:
- mountPath: /sys/fs/bpf - name: bpf-maps
name: bpf-maps mountPath: /sys/fs/bpf
{% if cilium_version | regex_replace('v') is version('1.11', '>=') %} {% if cilium_version | regex_replace('v') is version('1.11', '>=') %}
# Required to mount cgroup filesystem from the host to cilium agent pod # Required to mount cgroup filesystem from the host to cilium agent pod
- name: cilium-cgroup - name: cilium-cgroup
mountPath: {{ cilium_cgroup_host_root }} mountPath: {{ cilium_cgroup_host_root }}
mountPropagation: HostToContainer mountPropagation: HostToContainer
{% endif %} {% endif %}
- mountPath: /var/run/cilium - name: cilium-run
name: cilium-run mountPath: /var/run/cilium
resources: resources:
requests: requests:
cpu: 100m cpu: 100m
memory: 100Mi memory: 100Mi
priorityClassName: system-node-critical
restartPolicy: Always restartPolicy: Always
priorityClassName: system-node-critical
serviceAccount: cilium serviceAccount: cilium
serviceAccountName: cilium serviceAccountName: cilium
terminationGracePeriodSeconds: 1 terminationGracePeriodSeconds: 1
@ -312,36 +314,26 @@ spec:
{% if cilium_identity_allocation_mode == "kvstore" %} {% if cilium_identity_allocation_mode == "kvstore" %}
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
{% endif %} {% endif %}
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
k8s-app: cilium
tolerations: tolerations:
- operator: Exists - operator: Exists
volumes: volumes:
# To keep state between restarts / upgrades # To keep state between restarts / upgrades
- hostPath: - name: cilium-run
hostPath:
path: /var/run/cilium path: /var/run/cilium
type: DirectoryOrCreate type: DirectoryOrCreate
name: cilium-run
# To keep state between restarts / upgrades for bpf maps # To keep state between restarts / upgrades for bpf maps
- hostPath: - name: bpf-maps
hostPath:
path: /sys/fs/bpf path: /sys/fs/bpf
type: DirectoryOrCreate type: DirectoryOrCreate
name: bpf-maps
# pkg/workloads was deprecated in 1.6, removed in 1.7
# https://github.com/cilium/cilium/pull/9447
{% if cilium_version | regex_replace('v') is version('1.7', '<') %}
{% if container_manager == 'docker' %}
# To read docker events from the node
- hostPath:
path: /var/run/docker.sock
type: Socket
name: docker-socket
{% else %}
# To read crio events from the node
- hostPath:
path: {{ cri_socket }}
type: Socket
name: {{ container_manager }}-socket
{% endif %}
{% endif %}
{% if cilium_version | regex_replace('v') is version('1.11', '>=') %} {% if cilium_version | regex_replace('v') is version('1.11', '>=') %}
# To mount cgroup2 filesystem on the host # To mount cgroup2 filesystem on the host
- name: hostproc - name: hostproc
@ -355,34 +347,34 @@ spec:
type: DirectoryOrCreate type: DirectoryOrCreate
{% endif %} {% endif %}
# To install cilium cni plugin in the host # To install cilium cni plugin in the host
- hostPath: - name: cni-path
hostPath:
path: /opt/cni/bin path: /opt/cni/bin
type: DirectoryOrCreate type: DirectoryOrCreate
name: cni-path
# To install cilium cni configuration in the host # To install cilium cni configuration in the host
- hostPath: - name: etc-cni-netd
hostPath:
path: /etc/cni/net.d path: /etc/cni/net.d
type: DirectoryOrCreate type: DirectoryOrCreate
name: etc-cni-netd
# To be able to load kernel modules # To be able to load kernel modules
- hostPath: - name: lib-modules
hostPath:
path: /lib/modules path: /lib/modules
name: lib-modules
# To access iptables concurrently with other processes (e.g. kube-proxy) # To access iptables concurrently with other processes (e.g. kube-proxy)
- hostPath: - name: xtables-lock
hostPath:
path: /run/xtables.lock path: /run/xtables.lock
type: FileOrCreate type: FileOrCreate
name: xtables-lock
{% if cilium_identity_allocation_mode == "kvstore" %} {% if cilium_identity_allocation_mode == "kvstore" %}
# To read the etcd config stored in config maps # To read the etcd config stored in config maps
- configMap: - name: etcd-config-path
configMap:
name: cilium-config
# note: the leading zero means this number is in octal representation: do not remove it # note: the leading zero means this number is in octal representation: do not remove it
defaultMode: 0400 defaultMode: 0400
items: items:
- key: etcd-config - key: etcd-config
path: etcd.config path: etcd.config
name: cilium-config
name: etcd-config-path
# To read the k8s etcd secrets in case the user might want to use TLS # To read the k8s etcd secrets in case the user might want to use TLS
- name: etcd-secrets - name: etcd-secrets
hostPath: hostPath:
@ -391,21 +383,22 @@ spec:
# To read the clustermesh configuration # To read the clustermesh configuration
- name: clustermesh-secrets - name: clustermesh-secrets
secret: secret:
secretName: cilium-clustermesh
# note: the leading zero means this number is in octal representation: do not remove it # note: the leading zero means this number is in octal representation: do not remove it
defaultMode: 0400 defaultMode: 0400
optional: true optional: true
secretName: cilium-clustermesh
# To read the configuration from the config map # To read the configuration from the config map
- configMap: - name: cilium-config-path
configMap:
name: cilium-config name: cilium-config
name: cilium-config-path
{% if cilium_ip_masq_agent_enable %} {% if cilium_ip_masq_agent_enable %}
- configMap: - name: ip-masq-agent
configMap:
name: ip-masq-agent name: ip-masq-agent
optional: true
items: items:
- key: config - key: config
path: ip-masq-agent path: ip-masq-agent
name: ip-masq-agent
{% endif %} {% endif %}
{% if cilium_encryption_enabled and cilium_encryption_type == "ipsec" %} {% if cilium_encryption_enabled and cilium_encryption_type == "ipsec" %}
- name: cilium-ipsec-secrets - name: cilium-ipsec-secrets
@ -420,21 +413,12 @@ spec:
sources: sources:
- secret: - secret:
name: hubble-server-certs name: hubble-server-certs
optional: true
items: items:
- key: ca.crt
path: client-ca.crt
- key: tls.crt - key: tls.crt
path: server.crt path: server.crt
- key: tls.key - key: tls.key
path: server.key path: server.key
optional: true
- configMap:
name: hubble-ca-cert
items:
- key: ca.crt
path: client-ca.crt
optional: true
{% endif %} {% endif %}
updateStrategy:
rollingUpdate:
# Specifies the maximum number of Pods that can be unavailable during the update process.
maxUnavailable: 2
type: RollingUpdate