Created
April 9, 2018 13:25
-
-
Save DevWichrowski/c868c07800020930c843d83181b32d54 to your computer and use it in GitHub Desktop.
Few Kubernetes commands I used during video course
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minikube start - to start minikube | |
minikube status - to check the status | |
kubectl get nodes - to return nodes | |
minikube dashboard - to open darshboard | |
kubeadm init - set nodes up to master | |
kubectl run ghost --image=ghost - create deployment from dockerhub | |
kubectl delete deployments ghost - to delete deployment | |
kubectl proxy - to start proxy on localhost | |
kubectl create ns test - to create namespace test | |
kubetl get ns - to get namespaces | |
kubectl get pods --all-namespaces - to show all namespaces | |
kubectl create quota foobar --hard pods=1 - hardlock for only 1 pods / creating quota | |
kubectl get resourcequotas - to get quotas list | |
kubectl get pods --show-labels - to show labels | |
kubectl label pods ghost foo=bar - to create a label and add ghost to it | |
kubectl get pods -l foo=bar - to search by labels | |
kubectl get rs - to get replicasset | |
kubect lscale rs ghost --replicas==2 - to set repilas max to 2 | |
------------------QUICK DEPLOYMENT----------- | |
kubectl run ghostone --image=ghost:1.7 --port 2368 --expose=true - to create quick deployment and expose | |
kubectl edit svc ghostone - to edit a service ( change type: ClusterIP to NodePort to run) | |
----------------HELM package menager---------------- | |
helm init - to init helm | |
helm search redis - to search redis using helm | |
helm install stable/redis - to install using helm | |
helm ls | |
--------------Useful Curl's---------------- | |
curl -H "Content-type : application/json" --data @pod.json -XPOST http://localhost:8001/api/v1/namespaces/default/pods - to post pod | |
curl -XDELETE localhost:8001/api/v1/namespaces/default/pods/ghost - to delete from pod | |
curl -s localhost:8001/api/v1/namespaces | jq -r .items[].metadata.name - to return namespaces |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment