Difference between revisions of "K8s Create Ubuntu Utility Container"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with "You can easily create a utility container with the following commands ``` kubectl run ubuntu --image=ubuntu -- sleep 3600 ``` ``` echo test > test.txt kubectl cp test.txt ub...")
 
Line 3: Line 3:
 
```
 
```
 
kubectl run ubuntu --image=ubuntu -- sleep 3600
 
kubectl run ubuntu --image=ubuntu -- sleep 3600
 +
or
 +
kubectl run ubuntu --image=ubuntu -- bash -c "while true; do sleep 3600; done"
 
```
 
```
  

Revision as of 18:40, 12 October 2021

You can easily create a utility container with the following commands

kubectl run ubuntu --image=ubuntu -- sleep 3600
or
kubectl run ubuntu --image=ubuntu -- bash -c "while true; do sleep 3600; done"
echo test > test.txt
kubectl cp test.txt ubuntu:/
kubectl exec -it ubuntu -- bash
cat test.txt
apt update
apt install pgloader postgresql-client

To remove

kubectl delete pod ubuntu