Cheat Sheet: Docker, OpenShift, Kubernetes - CLI

 

Cheat Sheet: Docker CLI

Docker CLI 

CommandDescription
curl localhostPings the application.
docker buildBuilds a Docker image from a specified Dockerfile.
docker build . -tBuilds the image and tags the image id.
docker CLIStarts the Docker Command Line Interface (CLI).
docker container rmRemoves a container.
docker imagesDisplays a list of all available Docker images.
docker psLists the containers.
docker ps -aLists the containers that ran and exited successfully.
docker pullPulls the latest image or repository from a registry.
docker pushPushes an image or a repository to a registry.
docker runRuns a command in a new container.
docker run -pRuns the container by publishing the ports.
docker stopStops one or more running containers.
docker stop $(docker ps -q)Stops all currently running containers.
docker tagCreates a tag for a target image that refers to a source image.
docker –versionDisplays the version of the Docker CLI.
exitCloses the terminal session.
export MY_NAMESPACEExports a namespace as an environment variable.
git cloneClones the git repository that contains the artifacts needed.
ibmcloud cr imagesLists images in the IBM Cloud Container Registry.
ibmcloud cr loginLogs your local Docker daemon into IBM Cloud Container Registry.
ibmcloud cr namespacesDisplays the namespaces available to the current user in the IBM Cloud Container Registry.
ibmcloud cr region-setEnsures that you are targeting the region appropriate to your cloud account.
ibmcloud targetProvides information about the account you're targeting.
ibmcloud versionDisplays the current version of the IBM Cloud CLI.
lsLists the files and directories in the current directory.

Understanding Kubernetes Architecture

CommandDescription
for …doRuns a sequence of commands multiple times as specified.
kubectl applyApplies a specified configuration to a resource.
kubectl config get-clustersDisplays all clusters defined in the kubeconfig.
kubectl config get-contextsDisplays the current context.
kubectl createCreates a new Kubernetes resource based on a given specification.
kubectl deleteDeletes resources.
kubectl describeProvides details of a resource or group of resources.
kubectl exposeExposes a resource to the internet as a Kubernetes service.
kubectl getDisplays resources.
kubectl get podsLists all the Pods.
kubectl get pods -o wideLists all the Pods with details.
kubectl get deploymentsDisplays all deployments created.
kubectl get servicesLists the services created.
kubectl proxyCreates a proxy server between a localhost and the Kubernetes API server.
kubectl runCreates and runs a particular image in a pod.
kubectl versionPrints the client and server version information.

Managing Applications with Kubernetes

CommandDescription
kubectl autoscale deploymentAutoscales a Kubernetes Deployment.
kubectl create configmapCreates a ConfigMap resource.
kubectl get deployments -o wideLists deployments with details.
kubectl get hpaLists Horizontal Pod Autoscalers (hpa).
kubectl scale deploymentScales a deployment.
kubectl set image deploymentUpdates the current deployment.
kubectl rolloutManages the rollout of a resource.
kubectl rollout restartRestarts the resource so that the containers restart.
kubectl rollout undoRollbacks the resource.

OpenShift CLI

CommandDescription
oc getDisplays a resource.
oc projectSwitches to a different project.
oc versionDisplays version information.

Comments

Popular posts from this blog

Installing the Certbot Let’s Encrypt Client for NGINX on Amazon Linux 2

psql: error: connection to server at "localhost" (127.0.0.1), port 5433 failed: ERROR: failed to authenticate with backend using SCRAM DETAIL: valid password not found

Deploy Nuxt.js app using Apache 2