-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathkubernetes_0409
More file actions
74 lines (68 loc) · 1.47 KB
/
kubernetes_0409
File metadata and controls
74 lines (68 loc) · 1.47 KB
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
### service type - clusterip
apiVersion: v1
kind: Service
metadata:
name: edureka-clusterip
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIP
## service type - nodeport
apiVersion: v1
kind: Service
metadata:
name: edureka-nodeport
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
type: NodePort
### service type - loadbalancer
apiVersion: v1
kind: Service
metadata:
name: edureka-nodeport
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer
#### kubernetes commands
kubectl describe deployment abc123
512 clear
513 kubectl get all
514 cat a.yml
515 kubectl set image deployment abc123 amit=nginx
516 kubectl get all
517 kubectl describe pod abc123-f5cc4759f-456bb
518 kubectl get all
519 kubectl rollout history deployment abc123
520 kubectl rollout undo deployment abc123 --to-revision=1
521 kubectl get all
522 kubectl rollout history deployment abc123
523 clear
524 kubectl get all
525 kubectl get pods --show-labels
526 vi cluster.yml
527 kubectl apply -f cluster.yml
528 kubectl get svc
529 vi nodeport.yml
530 kubectl apply -f nodeport.yml
531 clear
532 kubectl get all
533 kubectl get nodes -o wide
534 clear
535 ls
536 cp nodeport.yml loadbalancer.yml
537 vi loadbalancer.yml
538 kubectl apply -f loadbalancer.yml