In testing the Redis broker, we found that it attempts to expose port 80 on the container even when the spec.broker.port which controls the service port is set to a different port.
This may cause an issue in clusters where privileged ports (under 1024) are not bind-able with unprivileged users.
In our cluster the broker port enters a crash loop with the following error: unable to start HTTP server: error while opening the inbound connection: listen tcp :80: bind: permission denied
This issue was locally resolved by manually editing the security context of the pod and adding the following block to set port 80 as unprivileged:
securityContext:
sysctls:
- name: net.ipv4.ip_unprivileged_port_start
value: "80"
This is officially considered as a safe namespaced sysctl since 1.22.
This has also been raised to Kubernetes to set as a potential default- kubernetes/kubernetes#102612
Could the container port be changed to reflect the port selected in the CRD spec.broker.port so that we can control the exposed port on the pod?
If not possible, could this be added to the pod templates for all resources that attempt to bind privileged ports as for security reasons we may not want to generally enable this within our clusters?