Revert "Upgrade cilium"

This reverts commit 77cbf6fb9e.
This commit is contained in:
Serge Logvinov
2022-08-18 14:47:25 +03:00
parent 8e675e8eae
commit d8bed567a9

View File

@@ -49,10 +49,10 @@ data:
# "cilium-metrics-config" ConfigMap # "cilium-metrics-config" ConfigMap
# 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.
prometheus-serve-addr: ":9962" prometheus-serve-addr: ":9090"
# Port to expose Envoy metrics (e.g. "9964"). Envoy metrics listener will be disabled if this # Port to expose Envoy metrics (e.g. "9095"). Envoy metrics listener will be disabled if this
# field is not set. # field is not set.
proxy-prometheus-port: "9964" proxy-prometheus-port: "9095"
# Enable IPv4 addressing. If enabled, all endpoints are allocated an IPv4 # Enable IPv4 addressing. If enabled, all endpoints are allocated an IPv4
# address. # address.
@@ -119,7 +119,7 @@ data:
cluster-name: default cluster-name: default
# Unique ID of the cluster. Must be unique across all conneted clusters and # Unique ID of the cluster. Must be unique across all conneted clusters and
# in the range of 1 and 255. Only relevant when building a mesh of clusters. # in the range of 1 and 255. Only relevant when building a mesh of clusters.
cluster-id: "0" cluster-id: ""
# Encapsulation mode for communication between nodes # Encapsulation mode for communication between nodes
# Possible values: # Possible values:
@@ -139,6 +139,7 @@ data:
install-no-conntrack-iptables-rules: "false" install-no-conntrack-iptables-rules: "false"
auto-direct-node-routes: "false" auto-direct-node-routes: "false"
enable-bandwidth-manager: "false"
enable-local-redirect-policy: "true" enable-local-redirect-policy: "true"
enable-host-firewall: "true" enable-host-firewall: "true"
# List of devices used to attach bpf_host.o (implements BPF NodePort, # List of devices used to attach bpf_host.o (implements BPF NodePort,
@@ -147,12 +148,11 @@ data:
kube-proxy-replacement: "strict" kube-proxy-replacement: "strict"
kube-proxy-replacement-healthz-bind-address: "" kube-proxy-replacement-healthz-bind-address: ""
bpf-lb-sock: "false" enable-host-reachable-services: "true"
host-reachable-services-protos:
enable-health-check-nodeport: "true" enable-health-check-nodeport: "true"
node-port-bind-protection: "true" node-port-bind-protection: "true"
enable-auto-protect-node-port-range: "true" enable-auto-protect-node-port-range: "true"
enable-svc-source-range-check: "true" enable-session-affinity: "true"
enable-l2-neigh-discovery: "true" enable-l2-neigh-discovery: "true"
arping-refresh-period: "30s" arping-refresh-period: "30s"
k8s-require-ipv4-pod-cidr: "true" k8s-require-ipv4-pod-cidr: "true"
@@ -161,31 +161,16 @@ data:
enable-health-checking: "true" enable-health-checking: "true"
enable-well-known-identities: "false" enable-well-known-identities: "false"
enable-remote-node-identity: "true" enable-remote-node-identity: "true"
synchronize-k8s-nodes: "true"
operator-api-serve-addr: "127.0.0.1:9234" operator-api-serve-addr: "127.0.0.1:9234"
ipam: "kubernetes" ipam: "kubernetes"
disable-cnp-status-updates: "true" disable-cnp-status-updates: "true"
enable-vtep: "false"
vtep-endpoint: ""
vtep-cidr: ""
vtep-mask: ""
vtep-mac: ""
enable-k8s-endpoint-slice: "true" enable-k8s-endpoint-slice: "true"
enable-bgp-control-plane: "false"
procfs: "/host/proc"
bpf-root: "/sys/fs/bpf"
cgroup-root: "/sys/fs/cgroup" cgroup-root: "/sys/fs/cgroup"
enable-k8s-terminating-endpoint: "true" enable-k8s-terminating-endpoint: "true"
annotate-k8s-node: "true"
remove-cilium-node-taints: "true" remove-cilium-node-taints: "true"
set-cilium-is-up-condition: "true" set-cilium-is-up-condition: "true"
unmanaged-pod-watcher-interval: "15" unmanaged-pod-watcher-interval: "15"
tofqdns-dns-reject-response-code: "refused"
tofqdns-enable-dns-compression: "true"
tofqdns-endpoint-max-ip-per-hostname: "50"
tofqdns-idle-connection-grace-period: "0s"
tofqdns-max-deferred-connection-deletes: "10000"
tofqdns-min-ttl: "3600"
tofqdns-proxy-response-max-delay: "100ms"
agent-not-ready-taint-key: "node.cilium.io/agent-not-ready" agent-not-ready-taint-key: "node.cilium.io/agent-not-ready"
--- ---
# Source: cilium/templates/cilium-agent/clusterrole.yaml # Source: cilium/templates/cilium-agent/clusterrole.yaml
@@ -222,13 +207,24 @@ rules:
- get - get
- list - list
- watch - watch
- apiGroups:
- ""
resources:
- nodes/status
verbs:
# To annotate the k8s node with Cilium's metadata
- patch
- apiGroups: - apiGroups:
- apiextensions.k8s.io - apiextensions.k8s.io
resources: resources:
- customresourcedefinitions - customresourcedefinitions
verbs: verbs:
# Deprecated for removal in v1.10
- create
- list - list
- watch - watch
- update
# This is used when validating policies in preflight. This will need to stay # 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 # until we figure out how to avoid "get" inside the preflight, and then
# should be removed ideally. # should be removed ideally.
@@ -236,61 +232,21 @@ rules:
- apiGroups: - apiGroups:
- cilium.io - cilium.io
resources: resources:
- ciliumbgploadbalancerippools
- ciliumbgppeeringpolicies
- ciliumclusterwideenvoyconfigs
- ciliumclusterwidenetworkpolicies
- ciliumegressgatewaypolicies
- ciliumegressnatpolicies
- ciliumendpoints
- ciliumendpointslices
- ciliumenvoyconfigs
- ciliumidentities
- ciliumlocalredirectpolicies
- ciliumnetworkpolicies - ciliumnetworkpolicies
- ciliumnodes - ciliumnetworkpolicies/status
verbs: - ciliumclusterwidenetworkpolicies
- list - ciliumclusterwidenetworkpolicies/status
- watch
- apiGroups:
- cilium.io
resources:
- ciliumidentities
- ciliumendpoints - ciliumendpoints
- ciliumnodes - ciliumendpoints/status
verbs:
- create
- apiGroups:
- cilium.io
# To synchronize garbage collection of such resources
resources:
- ciliumidentities
verbs:
- update
- apiGroups:
- cilium.io
resources:
- ciliumendpoints
verbs:
- delete
- get
- apiGroups:
- cilium.io
resources:
- ciliumnodes - ciliumnodes
- ciliumnodes/status - ciliumnodes/status
- ciliumidentities
- ciliumlocalredirectpolicies
- ciliumlocalredirectpolicies/status
- ciliumegressnatpolicies
- ciliumendpointslices
verbs: verbs:
- get - '*'
- update
- apiGroups:
- cilium.io
resources:
- ciliumnetworkpolicies/status
- ciliumclusterwidenetworkpolicies/status
- ciliumendpoints/status
- ciliumendpoints
verbs:
- patch
--- ---
# Source: cilium/templates/cilium-operator/clusterrole.yaml # Source: cilium/templates/cilium-operator/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
@@ -336,25 +292,26 @@ rules:
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
# to perform LB IP allocation for BGP - services
- services/status
verbs:
- update
- apiGroups:
- ""
resources:
# to check apiserver connectivity
- namespaces
verbs: verbs:
- get - get
- list - list
- watch - watch
- apiGroups:
- ""
resources:
# to perform LB IP allocation for BGP
- services/status
verbs:
- update
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
# 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
- namespaces
verbs: verbs:
- get - get
- list - list
@@ -363,73 +320,26 @@ rules:
- cilium.io - cilium.io
resources: resources:
- ciliumnetworkpolicies - ciliumnetworkpolicies
- ciliumclusterwidenetworkpolicies
verbs:
# Create auto-generated CNPs and CCNPs from Policies that have 'toGroups'
- create
- update
- deletecollection
# To update the status of the CNPs and CCNPs
- patch
- get
- list
- watch
- apiGroups:
- cilium.io
resources:
- ciliumnetworkpolicies/status - ciliumnetworkpolicies/status
- ciliumnetworkpolicies/finalizers
- ciliumclusterwidenetworkpolicies
- ciliumclusterwidenetworkpolicies/status - ciliumclusterwidenetworkpolicies/status
verbs: - ciliumclusterwidenetworkpolicies/finalizers
# Update the auto-generated CNPs and CCNPs status.
- patch
- update
- apiGroups:
- cilium.io
resources:
- ciliumendpoints - ciliumendpoints
- ciliumidentities - ciliumendpoints/status
verbs: - ciliumendpoints/finalizers
# To perform garbage collection of such resources
- delete
- list
- watch
- apiGroups:
- cilium.io
resources:
- ciliumidentities
verbs:
# To synchronize garbage collection of such resources
- update
- apiGroups:
- cilium.io
resources:
- ciliumnodes - ciliumnodes
verbs:
- create
- update
- get
- list
- watch
# To perform CiliumNode garbage collector
- delete
- apiGroups:
- cilium.io
resources:
- ciliumnodes/status - ciliumnodes/status
verbs: - ciliumnodes/finalizers
- update - ciliumidentities
- apiGroups:
- cilium.io
resources:
- ciliumendpointslices - ciliumendpointslices
- ciliumenvoyconfigs - ciliumidentities/status
- ciliumidentities/finalizers
- ciliumlocalredirectpolicies
- ciliumlocalredirectpolicies/status
- ciliumlocalredirectpolicies/finalizers
verbs: verbs:
- create - '*'
- update
- get
- list
- watch
- delete
- apiGroups: - apiGroups:
- apiextensions.k8s.io - apiextensions.k8s.io
resources: resources:
@@ -438,28 +348,8 @@ rules:
- create - create
- get - get
- list - list
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- update - update
resourceNames: - watch
- 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
# 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
@@ -511,7 +401,7 @@ metadata:
namespace: kube-system namespace: kube-system
annotations: annotations:
prometheus.io/scrape: "true" prometheus.io/scrape: "true"
prometheus.io/port: "9964" prometheus.io/port: "9095"
labels: labels:
k8s-app: cilium k8s-app: cilium
spec: spec:
@@ -521,7 +411,7 @@ spec:
k8s-app: cilium k8s-app: cilium
ports: ports:
- name: envoy-metrics - name: envoy-metrics
port: 9964 port: 9095
protocol: TCP protocol: TCP
targetPort: envoy-metrics targetPort: envoy-metrics
--- ---
@@ -544,21 +434,37 @@ spec:
template: template:
metadata: metadata:
annotations: annotations:
prometheus.io/port: "9962" prometheus.io/port: "9090"
prometheus.io/scrape: "true" prometheus.io/scrape: "true"
# Set app AppArmor's profile to "unconfined". The value of this annotation
# can be modified as long users know which profiles they have available
# in AppArmor.
container.apparmor.security.beta.kubernetes.io/cilium-agent: "unconfined"
container.apparmor.security.beta.kubernetes.io/clean-cilium-state: "unconfined"
container.apparmor.security.beta.kubernetes.io/mount-cgroup: "unconfined"
container.apparmor.security.beta.kubernetes.io/apply-sysctl-overwrites: "unconfined"
labels: labels:
k8s-app: cilium k8s-app: cilium
spec: spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
- matchExpressions:
- key: beta.kubernetes.io/os
operator: In
values:
- linux
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values:
- cilium
topologyKey: kubernetes.io/hostname
containers: containers:
- name: cilium-agent - name: cilium-agent
image: "quay.io/cilium/cilium:v1.12.1@sha256:ea2db1ee21b88127b5c18a96ad155c25485d0815a667ef77c2b7c7f31cab601b" image: "quay.io/cilium/cilium:v1.11.7@sha256:66a6f72a49e55e21278d07a99ff2cffa7565ed07f2578d54b5a92c1a492a6597"
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: command:
- cilium-agent - cilium-agent
@@ -638,7 +544,6 @@ spec:
- "/cni-install.sh" - "/cni-install.sh"
- "--enable-debug=false" - "--enable-debug=false"
- "--cni-exclusive=true" - "--cni-exclusive=true"
- "--log-file=/var/run/cilium/cilium-cni.log"
preStop: preStop:
exec: exec:
command: command:
@@ -651,72 +556,20 @@ spec:
cpu: 100m cpu: 100m
memory: 128Mi memory: 128Mi
ports: ports:
- name: peer-service
containerPort: 4244
hostPort: 4244
protocol: TCP
- name: prometheus - name: prometheus
containerPort: 9962 containerPort: 9090
hostPort: 9962 hostPort: 9090
protocol: TCP protocol: TCP
- name: envoy-metrics - name: envoy-metrics
containerPort: 9964 containerPort: 9095
hostPort: 9964 hostPort: 9095
protocol: TCP protocol: TCP
securityContext: securityContext:
seLinuxOptions: privileged: true
level: 's0'
# Running with spc_t since we have removed the privileged mode.
# Users can change it to a different type as long as they have the
# type available on the system.
type: 'spc_t'
capabilities:
add:
# Use to set socket permission
- CHOWN
# Used to terminate envoy child process
- KILL
# Used since cilium modifies routing tables, etc...
- NET_ADMIN
# Used since cilium creates raw sockets, etc...
- NET_RAW
# Used since cilium monitor uses mmap
- IPC_LOCK
# Used in iptables. Consider removing once we are iptables-free
- SYS_MODULE
# We need it for now but might not need it for >= 5.11 specially
# for the 'SYS_RESOURCE'.
# In >= 5.8 there's already BPF and PERMON capabilities
- SYS_ADMIN
# Could be an alternative for the SYS_ADMIN for the RLIMIT_NPROC
- SYS_RESOURCE
# Both PERFMON and BPF requires kernel 5.8, container runtime
# cri-o >= v1.22.0 or containerd >= v1.5.0.
# If available, SYS_ADMIN can be removed.
#- PERFMON
#- BPF
- DAC_OVERRIDE
- FOWNER
- SETGID
- SETUID
drop:
- ALL
volumeMounts: volumeMounts:
# Unprivileged containers need to mount /proc/sys/net from the host
# to have write access
- mountPath: /host/proc/sys/net
name: host-proc-sys-net
# Unprivileged containers need to mount /proc/sys/kernel from the host
# to have write access
- mountPath: /host/proc/sys/kernel
name: host-proc-sys-kernel
- name: bpf-maps - name: bpf-maps
mountPath: /sys/fs/bpf mountPath: /sys/fs/bpf
# Unprivileged containers can't set mount propagation to bidirectional mountPropagation: Bidirectional
# in this case we will mount the bpf fs from an init container that
# is privileged and set the mount propagation from host to container
# in Cilium.
mountPropagation: HostToContainer
# Check for duplicate mounts before mounting # Check for duplicate mounts before mounting
- name: cilium-cgroup - name: cilium-cgroup
mountPath: /sys/fs/cgroup mountPath: /sys/fs/cgroup
@@ -738,27 +591,35 @@ spec:
readOnly: true readOnly: true
- name: xtables-lock - name: xtables-lock
mountPath: /run/xtables.lock mountPath: /run/xtables.lock
hostNetwork: true
initContainers: initContainers:
# Mount the bpf fs if it is not mounted. We will perform this task - name: apply-sysctl-overwrites
# from a privileged container because the mount propagation bidirectional image: "quay.io/cilium/cilium:v1.11.7@sha256:66a6f72a49e55e21278d07a99ff2cffa7565ed07f2578d54b5a92c1a492a6597"
# only works from privileged containers.
- name: mount-bpf-fs
image: "quay.io/cilium/cilium:v1.12.1@sha256:ea2db1ee21b88127b5c18a96ad155c25485d0815a667ef77c2b7c7f31cab601b"
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
args: env:
- 'mount | grep "/sys/fs/bpf type bpf" || mount -t bpf bpf /sys/fs/bpf' - name: BIN_PATH
value: /opt/cni/bin
command: command:
- /bin/bash - sh
- -c - -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: securityContext:
privileged: true privileged: true
volumeMounts:
- name: bpf-maps
mountPath: /sys/fs/bpf
mountPropagation: Bidirectional
- name: clean-cilium-state - name: clean-cilium-state
image: "quay.io/cilium/cilium:v1.12.1@sha256:ea2db1ee21b88127b5c18a96ad155c25485d0815a667ef77c2b7c7f31cab601b" image: "quay.io/cilium/cilium:v1.11.7@sha256:66a6f72a49e55e21278d07a99ff2cffa7565ed07f2578d54b5a92c1a492a6597"
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: command:
- /init-container.sh - /init-container.sh
@@ -780,35 +641,7 @@ spec:
- name: KUBERNETES_SERVICE_PORT - name: KUBERNETES_SERVICE_PORT
value: "6443" value: "6443"
securityContext: securityContext:
seLinuxOptions: privileged: true
level: 's0'
# Running with spc_t since we have removed the privileged mode.
# Users can change it to a different type as long as they have the
# type available on the system.
type: 'spc_t'
capabilities:
# Most of the capabilities here are the same ones used in the
# cilium-agent's container because this container can be used to
# uninstall all Cilium resources, and therefore it is likely that
# will need the same capabilities.
add:
# Used since cilium modifies routing tables, etc...
- NET_ADMIN
# Used in iptables. Consider removing once we are iptables-free
- SYS_MODULE
# We need it for now but might not need it for >= 5.11 specially
# for the 'SYS_RESOURCE'.
# In >= 5.8 there's already BPF and PERMON capabilities
- SYS_ADMIN
# Could be an alternative for the SYS_ADMIN for the RLIMIT_NPROC
- SYS_RESOURCE
# Both PERFMON and BPF requires kernel 5.8, container runtime
# cri-o >= v1.22.0 or containerd >= v1.5.0.
# If available, SYS_ADMIN can be removed.
#- PERFMON
#- BPF
drop:
- ALL
volumeMounts: volumeMounts:
- name: bpf-maps - name: bpf-maps
mountPath: /sys/fs/bpf mountPath: /sys/fs/bpf
@@ -821,22 +654,12 @@ spec:
resources: resources:
requests: requests:
cpu: 100m cpu: 100m
memory: 100Mi # wait-for-kube-proxy memory: 100Mi
restartPolicy: Always restartPolicy: Always
priorityClassName: system-node-critical priorityClassName: system-node-critical
serviceAccount: "cilium" serviceAccount: "cilium"
serviceAccountName: "cilium" serviceAccountName: "cilium"
terminationGracePeriodSeconds: 1 terminationGracePeriodSeconds: 1
hostNetwork: true
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
k8s-app: cilium
topologyKey: kubernetes.io/hostname
nodeSelector:
kubernetes.io/os: linux
tolerations: tolerations:
- operator: Exists - operator: Exists
volumes: volumes:
@@ -850,6 +673,10 @@ spec:
hostPath: hostPath:
path: /sys/fs/bpf path: /sys/fs/bpf
type: DirectoryOrCreate type: DirectoryOrCreate
- name: hostproc
hostPath:
path: /proc
type: Directory
# To keep state between restarts / upgrades for cgroup2 filesystem # To keep state between restarts / upgrades for cgroup2 filesystem
- name: cilium-cgroup - name: cilium-cgroup
hostPath: hostPath:
@@ -885,14 +712,6 @@ spec:
- name: cilium-config-path - name: cilium-config-path
configMap: configMap:
name: cilium-config name: cilium-config
- name: host-proc-sys-net
hostPath:
path: /proc/sys/net
type: Directory
- name: host-proc-sys-kernel
hostPath:
path: /proc/sys/kernel
type: Directory
--- ---
# Source: cilium/templates/cilium-operator/deployment.yaml # Source: cilium/templates/cilium-operator/deployment.yaml
apiVersion: apps/v1 apiVersion: apps/v1
@@ -923,9 +742,21 @@ spec:
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:
- name: cilium-operator - name: cilium-operator
image: quay.io/cilium/operator-generic:v1.12.1@sha256:93d5aaeda37d59e6c4325ff05030d7b48fabde6576478e3fdbfb9bb4a68ec4a1 image: quay.io/cilium/operator-generic:v1.11.7@sha256:0f8ed5d815873d20848a360df3f2ebbd4116481ff817d3f295557801e0b45900
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: command:
- cilium-operator-generic - cilium-operator-generic
@@ -971,17 +802,6 @@ spec:
priorityClassName: system-cluster-critical priorityClassName: system-cluster-critical
serviceAccount: "cilium-operator" serviceAccount: "cilium-operator"
serviceAccountName: "cilium-operator" serviceAccountName: "cilium-operator"
# 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:
matchLabels:
io.cilium/app: operator
topologyKey: kubernetes.io/hostname
nodeSelector:
kubernetes.io/os: linux
tolerations: tolerations:
- operator: Exists - operator: Exists
volumes: volumes: