File tree 7 files changed +61
-36
lines changed
7 files changed +61
-36
lines changed Original file line number Diff line number Diff line change
1
+ ## Simple pod demo
1
2
2
- ## simple pod demo
3
- ### run nginx as webserver
4
- ```
3
+ ### Run nginx as webserver
4
+
5
+ ``` shell
5
6
$ kubectl run --image=nginx nginx
6
7
$ kubectl run --image=nginx nginx --restart=' Always'
7
8
```
8
- ### show running pod
9
- ```
9
+
10
+ ### Show running pod
11
+
12
+ ``` shell
10
13
$ kubectl get po --show-labels -owide -w
11
14
```
12
- ### expose svc
13
- ```
15
+
16
+ ### Expose svc
17
+
18
+ ``` shell
14
19
$ kubectl expose deploy nginx --selector run=nginx --port=80 --type=NodePort
15
20
```
16
- ### check svc detail
17
- ```
21
+
22
+ ### Check svc detail
23
+
24
+ ``` shell
18
25
$ kubectl get svc
19
26
```
20
- ### access service
21
- ```
27
+
28
+ ### Access service
29
+
30
+ ``` shell
22
31
$ curl 192.168.34.2:< nodeport>
23
32
```
Original file line number Diff line number Diff line change 1
- ## run envoy
2
- ```
1
+ ## Run envoy
2
+
3
+ ``` shell
3
4
$ kubectl create configmap envoy-config --from-file=envoy.yaml
4
5
$ kubectl create -f envoy-deploy.yaml
5
6
$ kubectl expose deploy envoy --selector run=envoy --port=10000 --type=NodePort
6
7
```
7
- ## access service
8
- ```
8
+
9
+ ## Access service
10
+
11
+ ``` shell
9
12
$ curl < NODE IP Address> :< NodePort>
13
+ ```
14
+
10
15
Notices: Node IP Address base on your kubernetes cluster.
11
16
12
17
Example:
18
+
19
+ ``` shell
13
20
$ curl 192.168.34.2:< nodeport>
14
21
```
15
- ## scale up/down/failover
16
- ```
22
+
23
+ ## Scale up/down/failover
24
+
25
+ ``` shell
17
26
$ kubectl scale deploy < deployment-name> --replicas=< n>
18
27
```
Original file line number Diff line number Diff line change 1
- # configmap
2
- ```
1
+ # ConfigMap
2
+
3
+ ``` sh
3
4
cat game.properties
4
5
5
6
# configmap from file
6
7
kubectl create configmap game-config --from-file=game.properties
7
8
kubectl create configmap game-env-config --from-env-file=game.properties
8
9
kubectl get configmap -oyaml game-config
9
10
```
10
- ## configmap from literal
11
- ```
11
+
12
+ ## ConfigMap from literal
13
+
14
+ ``` sh
12
15
kubectl create configmap special-config --from-literal=special.how=very --from-literal=special.type=charm
13
16
# downward api pod
14
17
kubectl create -f downward-api-pod.yaml
15
18
kubectl get po downward-api-pod
16
19
kubectl logs -f downward-api-pod
17
- ```
20
+ ```
Original file line number Diff line number Diff line change 1
- # volume
2
- ```
1
+ # Volume
2
+
3
+ ``` sh
3
4
kubectl create -f configmap-volume-pod.yaml
4
5
kubectl get po
5
6
kubectl logs -f configmap-volume-pod
6
- ```
7
+ ```
Original file line number Diff line number Diff line change 1
- # readiness probe
2
- ```
1
+ # Readiness probe
2
+
3
+ ``` sh
3
4
kubectl create -f centos-readiness.yaml
4
- ```
5
+ ```
Original file line number Diff line number Diff line change 1
- ## get object by columns
1
+ ## Get object by columns
2
+
3
+ ``` sh
4
+ kubectl get svc -o=custom-columns=NAME:.metadata.name,CREATED:' .metadata.annotations'
2
5
```
3
- kubectl get svc -o=custom-columns=NAME:.metadata.name,CREATED:'.metadata.annotations'
4
- ```
Original file line number Diff line number Diff line change 11
11
12
12
#### Envoy
13
13
14
- - [ 中文介绍] ( https://cloudnative.to/blog/what-is-envoy/ )
14
+ - [ 中文介绍] ( https://cloudnative.to/blog/what-is-envoy/ )
15
15
16
- - [ 中文翻译文档] ( https://cloudnative.to/envoy/intro/intro.html )
16
+ - [ 中文翻译文档] ( https://cloudnative.to/envoy/intro/intro.html )
17
17
18
- 官方资料
18
+ #### 官方资料
19
19
20
20
- [ 英文文档] ( https://www.envoyproxy.io/docs/envoy/latest/intro/what_is_envoy )
21
21
22
22
- [ sandboxes (新手入门必须试试)] ( https://www.envoyproxy.io/docs/envoy/latest/start/sandboxes/ )
23
23
24
- 博客
24
+ #### 博客
25
+
25
26
- FuckCloudNative
26
27
- https://fuckcloudnative.io/tags/envoy/page/2/
27
28
- https://fuckcloudnative.io/tags/envoy/page/1/
28
29
29
- ### Kubernetes
30
+ ### Kubernetes
30
31
31
32
- [ Architecting Kubernetes clusters — choosing a worker node size] ( https://learnk8s.io/kubernetes-node-size )
32
33
You can’t perform that action at this time.
0 commit comments