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

1/16/2020

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

-- Arundathi G Vardhan
kubernetes
kubernetes-ingress
ubuntu-18.04

1 Answer

1/17/2020

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
Source: StackOverflow