Farid Ahmadian / DevOps



Some examples

    sudo minikube --vm-driver=none start
    kubectl config get-contexts
    kubectl apply -f ....
    kubectl get pods
    kubectl logs -f POD-NAME
    kubectl get deployments
    kubectl get service
    kubectl get pods -l app=guestbook -l tier=frontend
    minikube service frontend --url
    kubectl scale deployment frontend --replicas=5
    kubectl scale deployment frontend --replicas=2
    kubectl delete deployment -l app=redis
    kubectl delete service -l app=redis
    kubectl delete deployment -l app=guestbook
    kubectl delete service -l app=guestbook


    kubectl apply -k ./
    kubectl get secrets
    kubectl get pvc
    kubectl get services wordpress
    minikube service wordpress --url
    kubectl delete -k ./

    kubectl describe pod PODNAME

    kubectl get deployment
    ubectl delete deployment DEPLOYMENT_NAME


    kubectl config view --minify
    Kubectl edit
    kubectl get pv
    kubectl get pvc
    kubectl logs <...>
    kubectl del -f pods.yaml
    kubectl get ns 
    kubectl get pods -n kube-system
    kubectl rollout status deployment <...>
    kubectl rollout history deployment <...>
    kubectl rollout undo deployment <...> --to-revision=2
    kubectl delete po --all
    kubectl delete pod <...>
    kubectl get all
    kubectl exec
    kubectl describe pod ...
    kubectl get secret -n ....
    kubectl create -n monitoring generic alertmanager-kube-prometheus --from-file=alertmanager.yaml
    kubectl get secret -n monitoring <....> -o json

BY: Farid Ahmadian
TAG: k8s, kubernetes
DATE: 2020-01-123 16:55:11

Farid Ahmadian / DevOps [ TXT ]

With many thanks and best wishes for dear Pejman Moghadam, someone who taught me alot in linux and life :)