# Kubernates note

1\. Start minikube server:

  

<table><tbody><tr><td colspan="1" rowspan="1"><p>minikube start&nbsp;&nbsp;</p></td></tr></tbody></table>

  

2\. Show how many pods are running now

  

<table><tbody><tr><td colspan="1" rowspan="1"><p>kubectl get pods -A</p></td></tr></tbody></table>

  
  

3\. Access the web dashboard of minikube

<table><tbody><tr><td colspan="1" rowspan="1"><p>minikube dashboard</p></td></tr></tbody></table>

  

4\. Restart deployment 

kubectl rollout restart deployment spring-boot-app

  
  
  

4\. Apply kubernates yaml change

  

<table><tbody><tr><td colspan="1" rowspan="1"><p>kubectl apply -f myapp-deployment.yaml&nbsp;</p></td></tr></tbody></table>

  

5\. Copy jar to kubernates 

<table><tbody><tr><td colspan="1" rowspan="1"><p>minikube cp KubernatesPractice-0.0.1-SNAPSHOT.jar /home/docker/app/KubernatesPractice-0.0.1-SNAPSHOT.jar</p></td></tr></tbody></table>

  

6\. Scale up pods

<table><tbody><tr><td colspan="1" rowspan="1"><p>kubectl scale deployment spring-boot-app --replicas=3</p></td></tr></tbody></table>

  

7\. Update the ConfigMap

<table><tbody><tr><td colspan="1" rowspan="1"><p>kubectl create configmap app-config --from-file=<a target="_self" rel="noopener noreferrer nofollow" href="http://application-prod.properties" style="pointer-events: none">application-prod.properties</a> --dry-run=client -o yaml | kubectl apply -f -</p></td></tr></tbody></table>

  

8\. Create secret in kubernates

<table><tbody><tr><td colspan="1" rowspan="1"><p>kubectl create secret generic mysql-secret \</p></td></tr></tbody></table>

  

9. 

  
  
  
  
  
  

**Deployment of a new Service**

  

1. Build a jar
    
2. Create a YAML file in the deployment folder
    

<table><tbody><tr><td colspan="1" rowspan="1"><p><em># The API version of the Kubernetes resource type you are using.</em></p></td></tr></tbody></table>

  
  
  

3. Publish the deployment
    

<table><tbody><tr><td colspan="1" rowspan="1"><p>kubectl apply -f newapp-deployment.yaml</p></td></tr></tbody></table>

4. List of all deployments 
    

<table><tbody><tr><td colspan="1" rowspan="1"><p>kubectl get deployments</p></td></tr></tbody></table>

5. List of pods in the current running containers
    

<table><tbody><tr><td colspan="1" rowspan="1"><p>kubectl get pods</p></td></tr></tbody></table>

6. List of services 
    

<table><tbody><tr><td colspan="1" rowspan="1"><p>kubectl get svc</p></td></tr></tbody></table>

7. Show detailed information about a specif pods
    

<table><tbody><tr><td colspan="1" rowspan="1"><p>f &lt;pod-name&gt;</p></td></tr></tbody></table>

  

8. Fd
    
9. Re
    
10. Re
    
11. rer
