Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
labelsfilter: add 'reserved:.*' to default label list
[ upstream commit 16e8f2f ] Fix #14100 Identity relevant labels is a label prefix list combined of two parts: 1. base part: 1.1. Read from a user specified (--label-prefix-file) json file if this file is provided. Default: `--label-prefix-file=""`. 1.2 If `--label-prefix-file=""`, read from a default hardcoded list (`func defaultLabelPrefixCfg()`). 2. additional part: read from user inputs (--labels), default `--labels=""` When `--label-prefix-file=""` (default) but `--labels=<custom-list>` provided, if `reserved:host` (or `reserved:.*`) is not included in the above `<custom-list>`, the `cilium_host` endpoint will lose its `reserved:host` label. When rolling back to the default configuration, that is, setting `--labels=""` and restarting the agent, cilium agent will raise errors like following: ``` level=warning msg="Regeneration of endpoint failed" .. error="Exposing new BPF failed: invalid LXC MAC: invalid MAC address " level=error msg="endpoint regeneration failed" .. error="Exposing new BPF failed: invalid LXC MAC: invalid MAC address " ``` And subsequently, all pods' traffic on this node will be interrupted. This is because the agent relies on this label to distinguish `cilium_host` endpoint from normal endpoints, and the former has no `lxcMAC`. We should never exclude reserved labels from default label list. Add reserved labels to the default label list could solve the problem. Appendix: Sample custom label file (--label-prefix-file) to overwrite the default base label list: ``` { "version": 1, "valid-prefixes": [ { "source": "k8s", "prefix": "io.kubernetes.pod.namespace" }, { "source": "k8s", "prefix": ":io.cilium.k8s.namespace.labels" }, { "source": "k8s", "prefix": "app.kubernetes.io" },{ "source": "k8s", "prefix": "k8s!:io.kubernetes" },{ "source": "k8s", "prefix": "!kubernetes.io" },{ "source": "k8s", "prefix": "!.*beta.kubernetes.io" },{ "source": "k8s", "prefix": "!k8s.io" },{ "source": "k8s", "prefix": "!pod-template-generation" },{ "source": "k8s", "prefix": "!pod-template-hash" },{ "source": "k8s", "prefix": "!controller-revision-hash" },{ "source": "k8s", "prefix": "!annotation.*" },{ "source": "k8s", "prefix": "!etcd_node" ] } ``` Signed-off-by: ArthurChiao <arthurchiao@hotmail.com> Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
- Loading branch information