Skip to content

container using not root user can not bind 80 and 443 port #2516

@miaoshixuan

Description

@miaoshixuan

Description
/kind bug

I used containerd as the remote runtime for my kubernetes cluster.

when I run a pod with the config.

      containers:
        - name: nginx-ingress-controller
          image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.17.1
          args:
            - /nginx-ingress-controller
            - --default-backend-service=$(POD_NAMESPACE)/default-http-backend
            - --configmap=$(POD_NAMESPACE)/nginx-configuration
            - --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
            - --udp-services-configmap=$(POD_NAMESPACE)/udp-services
            - --publish-service=$(POD_NAMESPACE)/ingress-nginx
            - --annotations-prefix=nginx.ingress.kubernetes.io
            - --http-port=80
            - --https-port=443
          securityContext:
            capabilities:
                drop:
                - ALL
                add:
                - NET_BIND_SERVICE
            runAsUser: 33

It will work when I change port to other ports (like: 8080,8443) or change user to root.

Steps to reproduce the issue:
1.
2.
3.

Describe the results you received:
It returned CrashLoopBackOff with the log 'Port 80 is already in use'

Describe the results you expected:
bind 80 and 443 port succeed

Output of containerd --version:

containerd github.com/containerd/containerd v1.1.2 468a545b9edcd5932818eb9de8e72413e616e86e

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions