3

When trying to run gcr.io/google_containers/defaultbackend as non root, the pod goes to crashLoopBackOff state when I see the below error in logs

standard_init_linux.go:211: exec user process caused "permission denied"

---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    run: ingress-default-backend
  name: ingress-default-backend
  namespace: ingress-haproxy
spec:
  replicas: 1
  selector:
    matchLabels:
      run: ingress-default-backend
  template:
    metadata:
      labels:
        run: ingress-default-backend
    spec:
      containers:
        - name: ingress-default-backend
          image: gcr.io/google_containers/defaultbackend:1.0
          ports:
          - containerPort: 8080
          securityContext:
            runAsGroup: 1000
            runAsNonRoot: true
            runAsUser: 1000

OS: Ubuntu 18.04.1 LTS

Note: This issue persist only with ubuntu 18.04.1

2 Answers2

3

Looks like the issue is caused by lack of executable permissions to the user that You are trying to run this containers as in Your deployment.

You can try to modify the image dockerfile and add few lines that would allow the right user to execute commands like in this github issue.

There is also lots of useful information about this in this StackOverflow post.

Hope it Helps.

Piotr Malec
  • 3,429
  • 11
  • 16
-2

try notes these,the privilege is error,becasue securityContext enter image description here

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 08 '22 at 20:42