-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathKubernetes Commands
74 lines (61 loc) · 1.78 KB
/
Kubernetes Commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Kubernetes Commands:
install hyperhit and minikube:
brew update
brew install hyperkit
brew install minikube
kubectl
minikube
create minikube cluster:
minikube start --vm-driver=hyperkit
kubectl get nodes
minikube status
kubectl version
delete cluster and restart in debug mode:
minikube delete
minikube start --vm-driver=hyperkit --v=7 --alsologtostderr
minikube status
kubectl commands:
kubectl get nodes
kubectl get pod
kubectl get services
kubectl create deployment nginx-depl --image=nginx
kubectl get deployment
kubectl get replicaset
kubectl edit deployment nginx-depl
debugging:
kubectl logs {pod-name}
kubectl exec -it {pod-name} -- bin/bash
create mongo deployment:
kubectl create deployment mongo-depl --image=mongo
kubectl logs mongo-depl-{pod-name}
kubectl describe pod mongo-depl-{pod-name}
delete deplyoment:
kubectl delete deployment mongo-depl
kubectl delete deployment nginx-depl
create or edit config file:
vim nginx-deployment.yaml
kubectl apply -f nginx-deployment.yaml
kubectl get pod
kubectl get deployment
delete with config:
kubectl delete -f nginx-deployment.yaml
#Metrics
kubectl top The kubectl top command returns current CPU and memory usage for a cluster’s pods or nodes, or for a particular pod or node if specified.
kubectl apply commands in order:
kubectl apply -f mongo-secret.yaml
kubectl apply -f mongo.yaml
kubectl apply -f mongo-configmap.yaml
kubectl apply -f mongo-express.yaml
kubectl get commands:
kubectl get pod
kubectl get pod --watch
kubectl get pod -o wide
kubectl get service
kubectl get secret
kubectl get all | grep mongodb
kubectl debugging commands:
kubectl describe pod mongodb-deployment-xxxxxx
kubectl describe service mongodb-service
kubectl logs mongo-express-xxxxxx
give a URL to external service in minikube:
minikube service mongo-express-service