Skip to content

Commit 712cdd3

Browse files
authored
Merge pull request #11 from SignorMercurio/master
Docs improvement
2 parents ceae745 + 5295532 commit 712cdd3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1166
-722
lines changed

3.microservice.md

+80-41
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,140 @@
1-
# Understand Microsoft
2-
## microsoft demo, run nginx as webserver
3-
```
1+
# Understand Microservice
2+
3+
## Microservice demo, run nginx as webserver
4+
5+
```shell
46
$ kubectl run --image=nginx nginx
57
```
6-
## show running pod
7-
```
8+
9+
## Show running pod
10+
11+
```shell
812
$ kubectl get po --show-labels -owide -w
913
```
10-
## expose svc
11-
```
14+
15+
## Expose svc
16+
17+
```shell
1218
$ kubectl expose deploy nginx --selector run=nginx --port=80 --type=NodePort
1319
```
14-
## check svc detail
15-
```
20+
21+
## Check svc detail
22+
23+
```shell
1624
$ kubectl get svc
1725
```
18-
## check nodeip
19-
```
26+
27+
## Check nodeip
28+
29+
```shell
2030
$ minikube ssh
2131
$ ifconfig eth1
2232
```
23-
## access service
24-
```
33+
34+
## Access service
35+
36+
```shell
2537
$ curl <nodeip>:<nodeport>
2638
```
27-
## run envoy
28-
```
39+
40+
## Run envoy
41+
42+
```shell
2943
$ kubectl create configmap envoy-config --from-file=envoy.yaml
3044
$ kubectl create -f envoy-deploy.yaml
3145
$ kubectl expose deploy envoy --selector run=envoy --port=10000 --type=NodePort
3246
```
33-
## access service
34-
```
47+
48+
## Access service
49+
50+
```shell
3551
$ curl <nodeip>:<nodeport>
3652
```
37-
## scale up/down/failover
38-
```
53+
54+
## Scale up/down/failover
55+
56+
```shell
3957
$ kubectl scale deploy <deployment-name> --replicas=<n>
4058
```
41-
# configmap
42-
```
59+
60+
# ConfigMap
61+
62+
```sh
4363
cat game.properties
4464

4565
#configmap from file
4666
kubectl create configmap game-config --from-file=game.properties
4767
kubectl create configmap game-env-config --from-env-file=game.properties
4868
kubectl get configmap -oyaml game-config
4969
```
50-
## configmap from literal
51-
```
70+
71+
## ConfigMap from literal
72+
73+
```sh
5274
kubectl create configmap special-config --from-literal=special.how=very --from-literal=special.type=charm
5375
#downward api pod
5476
kubectl create -f downward-api-pod.yaml
5577
kubectl get po downward-api-pod
5678
kubectl logs -f downward-api-pod
5779
```
58-
# volume
59-
```
80+
81+
# Volume
82+
83+
```sh
6084
kubectl create -f configmap-volume-pod.yaml
6185
kubectl get po
6286
kubectl logs -f configmap-volume-pod
6387
```
64-
# readiness probe
65-
```
88+
89+
# Readiness probe
90+
91+
```sh
6692
kubectl create -f centos-readiness.yaml
6793
```
68-
# multiple container pods
69-
## get object by columns
70-
```
94+
95+
# Multiple container pods
96+
97+
## Get object by columns
98+
99+
```sh
71100
kubectl get svc -o=custom-columns=NAME:.metadata.name,CREATED:'.metadata.annotations'
72101
```
102+
73103
# Operator
104+
74105
## kubebuilder
75-
```
106+
107+
```shell
76108
$ kubebuilder init --domain example.com
77109
$ kubebuilder create api --group infra --version v1 --kind WebService
78110
$ make install
79111
```
80-
## operator sdk
81-
## create new project
82-
```
112+
113+
## Operator sdk
114+
115+
## Create new project
116+
117+
```sh
83118
operator-sdk new memorycache-operator
84119
```
85-
## add types
86120

87-
```
121+
## Add types
122+
123+
```sh
88124
cd memorycache-operator
89125
operator-sdk add api --api-version=cache.example.com/v1alpha1 --kind=Memcached
90126
```
91-
## modify types and generate new code
92127

93-
```
128+
## Modify types and generate new code
129+
130+
```sh
94131
operator-sdk generate k8s
95132
operator-sdk generate openapi
96133
```
97-
## operator helm
98-
```
134+
135+
## Operator helm
136+
137+
```sh
99138
operator-sdk new nginx-operator --type=helm --kind=Nginx --api-version=web.example.com/v1alpha1
100139
operator-sdk add crd --api-version=web.example.com/v1alpha1 --kind=Envoy --update-watches=true
101-
```
140+
```

4.istio-setup.md

+22-7
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,45 @@
11
# Setup Istio
2+
23
## Download istio release
3-
```
4+
5+
```shell
46
$ curl -L https://istio.io/downloadIstio | sh -
57
```
8+
69
## Move to the Istio package directory
7-
```
10+
11+
```shell
812
$ cd istio-1.6.2
913
```
14+
1015
## Add istioctl to path
11-
```
16+
17+
```shell
1218
$ export PATH=$PWD/bin:$PATH
1319
```
20+
1421
## Install Istio
15-
```
22+
23+
```shell
1624
$ istioctl install --set profile=demo
1725
```
26+
1827
# Manage Istio
28+
1929
## Enable access log
20-
```
30+
31+
```shell
2132
$ istioctl manifest apply --set values.global.proxy.accessLogFile="/dev/stdout"
2233
```
34+
2335
## Enable mts
24-
```
36+
37+
```shell
2538
$ istioctl manifest apply --set values.global.mtls.enabled=true --set values.global.controlPlaneSecurityEnabled=true
2639
```
40+
2741
## Enable tracing
28-
```
42+
43+
```shell
2944
$ istioctl manifest apply --set values.tracing.enabled=disable --set values.tracing.provider=zipkin
3045
```

5.undestand-istio.md

+35-17
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,61 @@
11
# Understand Istio
2+
23
## Create bookinfo app sample
3-
```
4+
5+
```shell
46
$ kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
57
```
68

7-
## create dr
8-
```
9+
## Create destination rule
10+
11+
```shell
912
$ kubectl apply -f samples/bookinfo/networking/destination-rule-all.yaml
1013
```
14+
1115
## vs all v1
12-
```
16+
17+
```shell
1318
$ kubectl apply -f samples/bookinfo/networking/virtual-service-all-v1.yaml
1419
```
15-
## header based vs
16-
```
20+
21+
## Header based vs
22+
23+
```shell
1724
$ kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-test-v2.yaml
1825
```
19-
## delete vs
20-
```
26+
27+
## Delete vs
28+
29+
```shell
2130
$ kubectl delete -f samples/bookinfo/networking/virtual-service-all-v1.yaml
2231
```
23-
## add fix delay to rating
24-
```
32+
33+
## Add fix delay to rating
34+
35+
```shell
2536
$ kubectl apply -f samples/bookinfo/networking/virtual-service-ratings-test-delay.yaml
2637
```
38+
2739
## proxy-config
28-
```
40+
41+
```shell
2942
$ istioctl pc
3043
```
44+
3145
## proxy-status
32-
```
46+
47+
```shell
3348
$ istioctl ps
3449
```
35-
## check authn status
36-
```
50+
51+
## Check authn status
52+
53+
```shell
3754
$ istioctl authn tls-check details-v1-74f858558f-qqg99
3855
```
39-
## rate limit
40-
```
56+
57+
## Rate limit
58+
59+
```shell
4160
$ kubectl apply -f samples/bookinfo/policy/mixer-rule-productpage-ratelimit.yaml
4261
```
43-

envoy_default.yaml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
admin:
2+
access_log_path: /tmp/admin_access.log
3+
address:
4+
socket_address:
5+
protocol: TCP
6+
address: 0.0.0.0
7+
port_value: 9901
8+
static_resources:
9+
listeners:
10+
- name: listener_0
11+
address:
12+
socket_address:
13+
protocol: TCP
14+
address: 0.0.0.0
15+
port_value: 10000
16+
filter_chains:
17+
- filters:
18+
- name: envoy.http_connection_manager
19+
config:
20+
access_log:
21+
- name: envoy.file_access_log
22+
config:
23+
path: "/dev/stdout"
24+
typed_config:
25+
"@type": type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager
26+
stat_prefix: ingress_http
27+
route_config:
28+
name: local_route
29+
virtual_hosts:
30+
- name: local_service
31+
domains: ["*"]
32+
routes:
33+
- match:
34+
prefix: "/nginx"
35+
route:
36+
host_rewrite: www.google.com
37+
cluster: service_google
38+
http_filters:
39+
- name: envoy.router
40+
clusters:
41+
- name: service_google
42+
connect_timeout: 0.25s
43+
type: LOGICAL_DNS
44+
# Comment out the following line to test on v6 networks
45+
dns_lookup_family: V4_ONLY
46+
lb_policy: ROUND_ROBIN
47+
load_assignment:
48+
cluster_name: service_google
49+
endpoints:
50+
- lb_endpoints:
51+
- endpoint:
52+
address:
53+
socket_address:
54+
address: nginx
55+
port_value: 80

0 commit comments

Comments
 (0)