kubernets in action

docker build -t kubia .
docker ps
docker inspect kubia-container
docker exec -it kubia-container bash
docker stop kubia-container
docker rm kubia-container
docker tag kubia luksa/kubia
kubectl cluster-info
kubectl get nodes
kubectl get pods
kubectl get services
kubectl describe nodes
kubectl run kubia --image=luksa/kubia --port=8080 --generator=run/v1
kubectl get jobs
kubectl expose rc kubia --type=LoadBalancer --name kubia-http
kubectl get replicationcontrollers
kubectl scale rc kubia --replicas=3
kubectl get pods -o wide
kubectl describe pod kubia-hczji
kubectl proxy
kubectl get deployment kubernetes-dashboard --namespace=kube-system
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=default
kubectl -n kube-system edit service kubernetes-dashboard
kubectl -n kube-system describe secret kubernetes-dashboard-token-bgnmp
kubectl get po kubia-zxzij -o yaml
kubectl explain pods
kubectl create -f kubia-manual.yaml
kubectl get po kubia-manual -o yaml
kubectl get po kubia-manual -o json
kubectl logs kubia-manual
kubectl logs kubia-manual -c kubia
kubectl port-forward kubia-manual 8888:8080
kubectl get po --show-labels
kubectl get po -L creation_method,env
kubectl label po kubia-manual creation_method=manual
kubectl label po kubia-manual-v2 env=debug --overwrite
kubectl get po -l creation_method=manual
kubectl get po -l '!env'
kubectl label node gke-kubia-85f6-node-0rrx gpu=true
kubectl get nodes -l gpu=true
kubectl annotate pod kubia-m anual mycompany.com/someannotation="foo bar"
kubectl get ns
kubectl get po --namespace kube-system
kubectl create -f kubia-manual.yaml -n custom-namespace
kubectl delete po -l creation_method=manual
kubectl delete ns custom-namespace
kubectl delete po --all
kubectl delete all --all
kubectl create -f kubia-rc.yaml
kubectl delete pod kubia-53thy
kubectl get rc
kubectl describe rc kubia
kubectl label pod kubia-dmdck type=special
kubectl get pods --show-labels
kubectl label pod kubia-dmdck app=foo --overwrite
kubectl get pods -L app
kubectl edit rc kubia
kubectl scale rc kubia --replicas=10
kubectl edit rc kubia
kubectl delete rc kubia --cascade=false
kubectl create -f ssd-monitor-daemonset.yaml
kubectl get ds
kubectl label node minikube disk=ssd
kubectl get jobs
kubectl get po -a
kubectl scale job multi-completion-batch-job --replicas 3
kubectl get svc
kubectl exec kubia-7nog1 -- curl -s http://10.111.249.153
kubectl exec kubia-3inly env
kubectl exec -it kubia-3inly bash
kubectl get svc kubia-loadbalancer
kubectl get ingresses
kubectl exec kubia-2r1qb -- touch /var/ready
kubectl run dnsutils --image=tutum/dnsutils --generator=run-pod/v1 ➥  --command -- sleep infinity
kubectl port-forward fortune 8080:80
kubectl get pod s --namespace kube-system
kubectl exec -it mongodb mongo
kubectl get pv 
kubectl get pvc
kubectl delete pvc mongodb-pvc
kubectl get sc standard -o yaml
kubectl get pods | grep dask | awk '{print $1}' | xargs kubectl delete pod 
kubectl create configmap fortune-config --from-literal=sleep-interval=25
kubectl create configmap myconfigmap  --from-literal=foo=bar --from-literal=bar=baz --from-literal=one=two
kubectl get configmap fortune-config -o yaml
kubectl create -f fortune-config.yaml
kubectl create configmap my-config --from-file=config-file.conf
kubectl create configmap my-config --from-file=customkey=config-file.conf
kubectl create configmap my-config  --from-file=foo.json --from-file=bar=foobar.conf  --from-file=config-opts/ --from-literal=some=thing
kubectl create configmap fortune-config --from-file=configmap-files
kubectl port-forward fortune-configmap-volume 8080:80
kubectl describe secrets
openssl genrsa -out https.key 2048
openssl req -new -x509 -key https.key -out https.cert -days 3650 -subj /CN=www.kubia-example.com
kubectl create secret generic fortune-https --from-file=https.key   --from-file=https.cert --from-file=foo
kubectl get secret fortune-https -o yaml
kubectl edit configmap fortune-config
kubectl create secret docker-registry mydockerhubsecret \   --docker-username=myusername --docker-password=mypassword \   [email protected]
kubectl exec downward env
kubectl get svc
kubectl rolling-update kubia-v1 kubia-v2 --image=luksa/kubia:v2
kubectl describe rc kubia-v2
kubectl get po --show-labels
kubectl rollout status deployment kubia
kubectl get replicasets
kubectl patch deployment kubia -p '{"spec": {"minReadySeconds": 10}}'
kubectl set image deployment kubia nodejs=luksa/kubia:v2
kubectl edit statefulset kubia
kubectl get componentstatuses
kubectl get po -o custom-columns=POD:metadata.name,NODE:spec.nodeName   --sort-by spec.nodeName -n kube-system
etcdctl ls /registry
etcdctl ls /registry/pods
etcdctl ls /registry/pods/default
etcdctl get /registry/pods/default/kubia-159041347-wt6ga
kubectl get events --watch
kubectl get endpoints kube-scheduler -n kube-system -o yaml
kubectl create serviceaccount foo
kubectl get clusterrole view -o yaml
kubectl delete clusterrolebinding view-test
kubectl create rolebinding view-test --clusterrole=view   --serviceaccount=foo:default -n foo
kubectl get clusterrolebindings
kubectl exec pod-with-host-network ifconfig
kubectl autoscale deployment kubia --cpu-percent=30 --min=1 --max=5

发布了64 篇原创文章 · 获赞 264 · 访问量 106万+

猜你喜欢

转载自blog.csdn.net/bbbeoy/article/details/104282956