Skip to content

Latest commit

 

History

History
99 lines (68 loc) · 1.76 KB

File metadata and controls

99 lines (68 loc) · 1.76 KB
  1. Install minikube: Run command:

    curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.13.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
    

K8S with minikube

  1. Create cluster

    • Run command:

      minikube version
      
      minikube start
      
  2. Deployment

    • Run command:

      kubectl create deployment $DEPLOY_NAME --image=$IMAGE_URL
      
      • Get list deployments:
      kubectl get deployments
      
  3. Create service

    • expose port:
    kubectl expose deployment $DEPLOY_NAME --type=$TYPE --port=$PORT
    
    • Get link access on browser
    minikube service $DEPLOY_NAME
    

Bugs

  1. Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io":
    run command:

    kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission
    
  2. Run local: change domain to:

    • .local
    • .localhost
    • .test
    • (any custom/non-standard top-level domain)
  3. Remove service

    • systemctl stop {service}
    • yum remove {service}
    • systemctl daemon-reload
    • systemctl reset-failed

Monitor

  1. Check CRIO cgroup:

    cat /etc/crio/crio.conf | grep cgroup
    

Mongo command

  1. Mongo dump
mongodump -u [DB_USERNAME] --db [DB_DATABASE] --authenticationDatabase=admin --gzip --archive > /path/to/file/dump_`date "+%Y-%m-%d"`.gz
  1. Copy file remote machine to local computer
scp -P [port] [user]@[server_id]:/path/to/file /path/to/local
  1. Mongo restore
mongorestore -u [DB_USERNAME] --authenticationDatabase=admin --gzip --archive=/path/to/file/dump_2024-10-03.gz --db [DB_DATABASE]