1

I am facing below issue while running sudo command

sudo: The "no new privileges" flag is set, which prevents sudo from running as root.
sudo: If sudo is running in a container, you may need to adjust the container configuration to disable the flag

this is my yaml file i have used

- image: "{{ .Values.xyz.image.repository }}:{{ .Values.xyz.image.tag }}"
        imagePullPolicy: {{ .Values.xyz.image.pullPolicy }}
        name: test
        securityContext:
          allowPrivilegeEscalation: true
           privileged: true
          capabilities:
            drop: ["ALL"]
          runAsNonRoot: true
          runAsUser: 2000
          runAsGroup: 2000  # Replace with the appropriate group ID
          seccompProfile:
            type: RuntimeDefault

I want to run the sudo command inside the container

Gerald Schneider
  • 26,582
  • 8
  • 65
  • 97

0 Answers0