Difference between revisions of "Kubectl attach"

From wikieduonline
Jump to navigation Jump to search
(11 intermediate revisions by 3 users not shown)
Line 2: Line 2:
  
 
   [[Unable to use a TTY]] - container your-container [[did not allocate one]]
 
   [[Unable to use a TTY]] - container your-container [[did not allocate one]]
 +
 +
kubectl attach myalpinedataaccess -i
 +
If you don't see a command prompt, try pressing enter.
 +
Error from server (BadRequest): pod myalpinedataaccess [[does not have a host assigned]]
 +
 +
Solution: maybe pod is in pending state, [[kubectl get events]]
 +
3m29s                Warning  FailedScheduling    Pod/myalpinedataaccess                0/1 nodes are available: persistentvolumeclaim "pvc-a501d138-69e4-4dda-81fb-0fbf8cf2d234" not found. preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling..
 +
 +
 +
kubectl attach my-pod -i
 +
https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources
 +
 +
[[kubectl attach ubuntu -c ubuntu -i -t]]
 +
 +
  
 
  spec:
 
  spec:
Line 7: Line 22:
 
     - name: your-name
 
     - name: your-name
 
       image: your-name:latest
 
       image: your-name:latest
       tty: true
+
       [[tty:]] true
 
       [[stdin:]] true
 
       [[stdin:]] true
  
 
+
== Related ==
 +
[[kubectl exec]]
 +
[[kubectl debug]]
  
 
== See also ==
 
== See also ==
* {{kubectl}}
+
* {{K8s tr}}
  
 
[[Category: Kubectl]]
 
[[Category: Kubectl]]

Revision as of 13:45, 8 February 2024

 Unable to use a TTY - container your-container did not allocate one
kubectl attach myalpinedataaccess -i
If you don't see a command prompt, try pressing enter.
Error from server (BadRequest): pod myalpinedataaccess does not have a host assigned

Solution: maybe pod is in pending state, kubectl get events 
3m29s                Warning   FailedScheduling     Pod/myalpinedataaccess                0/1 nodes are available: persistentvolumeclaim "pvc-a501d138-69e4-4dda-81fb-0fbf8cf2d234" not found. preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling..


kubectl attach my-pod -i
https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources
kubectl attach ubuntu -c ubuntu -i -t


spec:
    containers:
    - name: your-name
      image: your-name:latest
      tty: true
      stdin: true

Related

kubectl exec
kubectl debug

See also

Advertising: