Ran
|
Files
677
|
Run time
48s
|
Badge
Embed ▾
README BADGES
|
push
travis-ci-com
cilium: improve host-port generated service names The service-name and namespace annotation does not have to be unique and are mainly used by hubble [0]. However, lets improve the Cilium internal naming scheme a bit into <pod-name>/host-port/<exposed-host-port>, so the result looks as: # ./cilium/cilium service list -o json [...] "flags": { "name": "my-nginx-78cd9b665d-xmwp8/host-port/8080", "namespace": "default", "trafficPolicy": "Cluster", "type": "HostPort" }, [...] In any case, we can also _guarantee_ that we are never going to clash with a regular service name since in k8s a service cannot be named this way: # kubectl expose deployment my-nginx --type=NodePort --port=30000 --name="my-nginx-78cd9b665d-xmwp8/host-port/8080" The Service "my-nginx-78cd9b665d-xmwp8/host-port/8080" is invalid: metadata.name: Invalid value: "my-nginx-78cd9b665d-xmwp8/host-port/8080": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?') The fact that we reuse our main BPF service handling internally is an implementation detail - HostPort services are not accessible through DNS this way anyway. [0] https://github.com/cilium/cilium/commit/a2c49a59d Closes: #11324 Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
31984 of 84511 relevant lines covered (37.85%)
1432.31 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|