Welcome to the Linux Foundation Forum!

Excercise A.3 33 review6.yaml: error: unable to upgrade connection: container not found ("webguy")

Options
  1. After finding the errors, log into the container and find the proper id of the nginx user.

I try:

guettli@p15:~/.kube$ k exec -it securityreview -- sh
error: unable to upgrade connection: container not found ("webguy")

How to log into the container?

Comments

  • dellasantar
    dellasantar Posts: 1
    edited April 2022
    Options

    I don't know how to log into an unstarted container, but since the error for me was at startup regarding the mkdir of folders due to lack of permissions (as seen from kubectl logs) I harnessed the yaml as follows to pre-provide the temp folders and the nginx container now goes in Running.

    apiVersion: v1
    kind: Pod
    metadata:
      name: securityreview
    spec:
      securityContext:
        runAsUser: 2100
      volumes:
        - name: nginx-dir
          emptyDir: {}
        - name: nginx-empty
          emptyDir: {}
        - name: nginx-run
          emptyDir: {}
      containers:
        - name: webguy
          image: nginx
          volumeMounts:
            - mountPath: /etc/nginx/conf.d/
              name: nginx-dir
            - mountPath: /var/cache/nginx/client_temp
              name: nginx-empty
            - mountPath: /var/run/
              name: nginx-run
          securityContext:
            runAsUser: 3000
            allowPrivilegeEscalation: false
    
  • alihasanahmedk
    Options

    @chrispokorni can you please answer this question.

  • alihasanahmedk
    alihasanahmedk Posts: 34
    edited June 2022
    Options

    @guettli did you find any solution to this problem.

Categories

Upcoming Training