Useful Commands
Below follows a set of commands that are commonly used when working with Mappia installations.
Kubectl General Commands
Here is a series of commands that are useful to manage your cluster. Be sure to check Kubectl's cheat sheet for more commands
Command | Description |
---|---|
kubectl config get-contexts | List all contexts you have configured |
kubectl config current-contexts | Display the name of the current context that is being used by kubectl |
kubectl config use-context <context-name> | Switch between different configured contexts |
kubectl get pods | List pods running |
kubectl get services | List services running |
kubectl get deployments | List services running |
kubectl get nodes | List services running |
kubectl describe <resource> <resource-name> | Describe resource details like usage, state, events and status. |
kubectl delete pod <pod-name> | Delete a specific pod |
kubectl logs -f <pod-name> | Stream logs from a pod |
kubectl delete pods --field-selector status.phase=Failed | Delete all pods that are in an error state |
Useful Mappia Commands
These commands are Mappia-specific. They rely on features we've built just for Mappia.
TIP
For many of these commands, if you have changed your chart's release name from mappia
to my-project-name
, the associated command needs to be changed to match, i.e. deploy/mappia-manager
becomes deploy/my-project-name-manager
.
Command | Description |
---|---|
kubectl exec -it deploy/mappia-manager -- sh | Shell into manager pod |
kubectl exec -it deploy/mappia -- sh | Shell into magento pod. |
kubectl exec deploy/mappia -- php-fpm -tt 2>&1 -i | grep <php_ini_setting> | Fetch php ini setting from a FPM pod |
kubectl exec deploy/mappia-manager -- php -i | grep <php_ini_setting> | Fetch php ini setting from a CLI pod |