kubectl command is used to manage Kubernetes Clusters. To install kubectl on Linux, run
1 2 |
wget https://raw.githubusercontent.com/serverok/server-setup/master/install/kubectl.sh bash kubectl.sh |
On Ubuntu, you can install from snap using
1 |
sudo snap install kubectl --classic |
or with apt
1 |
apt-get install kubectl |
To get help, run
1 |
kubectl help |
Check if Kubernetes environment is ready
1 |
kubectl version |
Run nginx container
1 |
kubectl run nginx --image=nginx:1.10.0 |
Connect to a pod
1 |
kubectl exec monolith --stdin --tty -c monolith /bin/sh |
Execute a command in pod
1 |
kubectl exec POD-ID-HERE -- COMMAND_HERE |
[…]