<p>I failed to login inside a container with the below commands. What did I miss?</p>
<p>Thank you in advance</p>
<pre><code>
(base) debian@appdev:~$ aws eks list-clusters
{
    &quot;clusters&quot;: [
        &quot;default&quot;
    ]
}

(base) debian@appdev:~$ kubectl get pods
NAME                                          READY   STATUS    RESTARTS   AGE
apollo-admin                                  1/1     Running   0          36d
default-apollo-7bb67b66f9-hgbfg               1/1     Running   0          13d
default-apollo-getseq-568bdb78bd-h7l4v        1/1     Running   0          86d
default-blast-bb6469fb4-nz5bz                 1/1     Running   0          58d
default-orthovenn2-api-7cb577f5df-7xr6p       1/1     Running   0          34d
default-orthovenn2-mongodb-5fdd4467bd-mwfml   1/1     Running   0          34d
default-orthovenn2-website-5f8954c4f6-skljz   1/1     Running   0          34d
efs-app                                       1/1     Running   0          91d

(base) debian@appdev:~$ kubectl attach default-blast-bb6469fb4-nz5bz -i -t
Defaulting container name to blast.
Use 'kubectl describe pod/default-blast-bb6469fb4-nz5bz -n default' to see all of the containers in this pod.
Unable to use a TTY - container blast did not allocate one
If you don't see a command prompt, try pressing enter.
Error from server (Forbidden): pods &quot;default-blast-bb6469fb4-nz5bz&quot; is forbidden: User &quot;developer&quot; cannot create resource &quot;pods/attach&quot; in API group &quot;&quot; in the namespace &quot;default&quot;

(base) debian@appdev:~$ kubectl describe pod/default-blast-bb6469fb4-nz5bz -n default
Name:         default-blast-bb6469fb4-nz5bz
Namespace:    default
Priority:     0
Node:         ip-10-22-196-153.ap-southeast-2.compute.internal/10.22.196.153
Start Time:   Sun, 05 Sep 2021 23:45:30 +0000
Labels:       app.kubernetes.io/instance=default-blast
              app.kubernetes.io/managed-by=Helm
              app.kubernetes.io/name=default-blast
              app.kubernetes.io/version=1.0.14
              checksum/config-map=c3d498139d04a99ffc05ac85539b2b3960db609ede5b509e9bee949941389e8
              helm.sh/chart=blast-0.0.2
              pod-template-hash=bb6469fb4
Annotations:  kubernetes.io/psp: eks.privileged
Status:       Running
IP:           10.22.196.82
IPs:
  IP:           10.22.196.82
Controlled By:  ReplicaSet/default-blast-bb6469fb4
Containers:
  blast:
    Container ID:   docker://abc6745591a4a2e9bf74e907773cc8bae25356b0daad3b009a81854329e9ada8
    Image:          wurmlab/sequenceserver:2.0.0.rc8
    Image ID:       docker-pullable://wurmlab/sequenceserver@sha256:d9b46a927e35f261b7813899202dd8798c033c0a096dfb10c29d8968fb9b1107
    Port:           4567/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Sun, 05 Sep 2021 23:45:32 +0000
    Ready:          True
    Restart Count:  0
    Limits:
      cpu:     1
      memory:  2Gi
    Requests:
      cpu:     500m
      memory:  256Mi
    Environment Variables from:
      default-blast  ConfigMap  Optional: false
    Environment:
      HELM_RELEASE_NAME:  default-blast
    Mounts:
      /db from persistent-data (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-59xt8 (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  persistent-data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  default-blast-data
    ReadOnly:   false
  default-token-59xt8:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-59xt8
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:          &lt;none&gt;
</code></pre>

user977828
<p>When you're trying to attach the container <code>kubectl attach -it POD -c CONTAINER</code> the container must be configured with <code>tty: true</code> and <code>stdin: true</code>. By default both of those values are <code>false</code>
Refer <a href="https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#debugging" rel="nofollow noreferrer">API Reference</a>.</p>
<p><strong>Example Pod:</strong></p>
<pre><code>spec: 
     containers: 
     - name: web 
     image: web:latest 
     tty: true 
     stdin: true
</code></pre>
