-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af606a7
commit 9b7b948
Showing
21 changed files
with
265 additions
and
3 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
source/kubernetes/istio/istio_startup/get_ingress_ip_port_url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# 对于其他云环境,参考原文 https://istio.io/latest/docs/setup/getting-started/#determining-the-ingress-ip-and-ports | ||
|
||
# Ingress host: | ||
export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
# Ingress port: | ||
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}') | ||
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].port}') | ||
|
||
# 获得实际访问GATEWAY URL | ||
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT | ||
echo "$GATEWAY_URL" |
1 change: 1 addition & 0 deletions
1
source/kubernetes/istio/istio_startup/get_ingress_ip_port_url_output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
192.168.8.151:80 |
9 changes: 9 additions & 0 deletions
9
source/kubernetes/istio/istio_startup/iptables_port_forwarding_bookinfo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 假设public接口IP地址是 10.10.1.111 (模拟对internet提供服务) | ||
local_host=10.10.1.111 | ||
bookinfo_port=80 | ||
|
||
istio_bookinfo_host=192.168.8.151 | ||
istio_bookinfo_port=80 | ||
|
||
sudo iptables -t nat -D PREROUTING -p tcp --dport ${bookinfo_port} -j DNAT --to-destination ${istio_bookinfo_host}:${istio_bookinfo_port} | ||
sudo iptables -t nat -D POSTROUTING -p tcp -d ${istio_bookinfo_host} --dport ${istio_bookinfo_port} -j SNAT --to-source ${local_host} |
9 changes: 9 additions & 0 deletions
9
source/kubernetes/istio/istio_startup/iptables_port_forwarding_kiali
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
local_host=10.1.1.111 | ||
|
||
kiali_port=20001 | ||
|
||
istio_kiali_host=192.168.8.152 | ||
istio_kiali_port=20001 | ||
|
||
sudo iptables -t nat -A PREROUTING -p tcp -d ${local_host} --dport ${kiali_port} -j DNAT --to-destination ${istio_kiali_host}:${istio_kiali_port} | ||
sudo iptables -t nat -A POSTROUTING -p tcp -d ${istio_kiali_host} --dport ${istio_kiali_port} -j SNAT --to-source ${local_host} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
source/kubernetes/network/metallb/install_metallb/install_metallb_by_manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml | ||
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
source/kubernetes/network/metallb/metallb_with_istio/kubectl_create_metallb_ip-pool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kubectl create -f y-k8s-ip-pool.yaml |
1 change: 1 addition & 0 deletions
1
source/kubernetes/network/metallb/metallb_with_istio/kubectl_get_metallb-system_pods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kubectl -n metallb-system get pods -o wide |
7 changes: 7 additions & 0 deletions
7
source/kubernetes/network/metallb/metallb_with_istio/kubectl_get_metallb-system_pods_output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES | ||
controller-5fd797fbf7-6x8lm 1/1 Running 0 2m56s 10.233.89.145 y-k8s-n-1 <none> <none> | ||
speaker-9lxd5 1/1 Running 0 2m56s 192.168.8.119 y-k8s-n-1 <none> <none> | ||
speaker-fmlzw 1/1 Running 0 2m56s 192.168.8.116 y-k8s-m-1 <none> <none> | ||
speaker-g6f9d 1/1 Running 0 2m56s 192.168.8.118 y-k8s-m-3 <none> <none> | ||
speaker-mpx6m 1/1 Running 0 2m56s 192.168.8.117 y-k8s-m-2 <none> <none> | ||
speaker-x8k7x 1/1 Running 0 2m56s 192.168.8.120 y-k8s-n-2 <none> <none> |
2 changes: 2 additions & 0 deletions
2
source/kubernetes/network/metallb/metallb_with_istio/kubectl_get_svc_metallb_ip_output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | ||
istio-ingressgateway LoadBalancer 10.233.8.166 192.168.8.151 15021:31210/TCP,80:31659/TCP,443:30721/TCP,31400:32337/TCP,15443:30050/TCP 24h |
8 changes: 8 additions & 0 deletions
8
source/kubernetes/network/metallb/metallb_with_istio/y-k8s-ip-pool.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: metallb.io/v1beta1 | ||
kind: IPAddressPool | ||
metadata: | ||
name: y-k8s-ip-pool | ||
namespace: metallb-system | ||
spec: | ||
addresses: | ||
- 192.168.8.151-192.168.8.198 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
upstream book-info { | ||
server 192.168.8.151:80; | ||
} | ||
|
||
server { | ||
listen 80; | ||
#listen [::]:80; | ||
|
||
server_name book-info book-info.cloud-atlas.io; | ||
|
||
location / { | ||
proxy_set_header Host $http_host; | ||
proxy_pass http://book-info; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
site=book-info | ||
ln -s /etc/nginx/sites-available/${site} /etc/nginx/sites-enabled/${site} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _nginx_reverse_proxy_troubleshooting: | ||
|
||
======================== | ||
NGINX反向代理故障排查 | ||
======================== | ||
|
||
参考 | ||
====== | ||
|
||
- `NGINX Reverse Proxy Configuration and Troubleshooting <https://djangocas.dev/blog/nginx-reverse-proxy-configuration-and-troubleshooting/>`_ |