- 如何測試一個服務在叢集內的效能?
- kube-proxy的獲取不到iptables lock問題。
- 使用nginx做微服務gateway,其配置使用upstream方式的風險,與另一種替代方案。
- 使用upstream的nginx配置檔案
kubectl describe cm pasp-nginx-conf -n shb-sf-stg-ce9ef3aa #user nobody; worker_processes 1; error_log logs/error.log; pid logs/nginx.pid; events { worker_connections 1024; } http { include /wls/apache/nginx/nginx-1.13.3/conf/mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; client_max_body_size 50M; log_format access '$remote_addr - $remote_user [$time_local] "$request"' '$status $body_bytes_sent "$http_referer"' '"$http_user_agent" $http_x_forwarded_for'; #gzip on; upstream pasp_core_web_upstream { server pasp-core-web-ui:7910; } upstream pasp_ws_web_upstream { server pasp-ws-web-ui:7910; } upstream aiknow_benifit_web_upstream{ server icmp-aiknow-web-benefit-ui:7910; } upstream aiknow_verify_web_upstream { server icmp-aiknow-web-verify-ui:7910; } upstream pasp_aiknow_amlbl_web_upstream { server icmp-aiknow-web-amlbl-ui:7910; } upstream pasp_nmpr_web_upstream { server pasp-nmpr-web-ui:7910; } upstream pasp_pprk_web_upstream { server pasp-pprk-web-ui:7910; } upstream pasp_aiknow_web_rcbl_upstream { server pasp-aiknow-web-rcbl-ui:7910; } upstream pasp_eeportal_web_upstream { server pasp-eeportal-web-ui:7910; } upstream pasp_ira_web_upstream { server pasp-ira-web-ui:7910; } upstream fp_api_gateway_upstream { server fp-core-api-gateway.shb-sf-fp-core-stg-8af201ff:8086; } server { listen 7910; server_name localhost; access_log logs/host.access.log access; #charset koi8-r; #access_log logs/host.access.log main; location = / { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://pasp_core_web_upstream/pasp-web/index.html; } location ~* ^/pasp-web\/(.*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$) { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://pasp_core_web_upstream; } location ^~ /ws-web/ { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://pasp_ws_web_upstream; } location ^~ /aiknow-benefit-web/ { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://aiknow_benifit_web_upstream; } location ^~ /aiknow-verify-web/ { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://aiknow_verify_web_upstream; } location ^~ /aiknow-amlbl-web/ { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://pasp_aiknow_amlbl_web_upstream; } location ^~ /nmpr-web/ { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://pasp_nmpr_web_upstream; } location ^~ /pprk-web/ { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://pasp_pprk_web_upstream; } location ^~ /aiknow-rcbl-web/ { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://pasp_aiknow_web_rcbl_upstream; } location ^~ /eeportal-web/ { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://pasp_eeportal_web_upstream; } location ^~ /ira-web/ { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://pasp_ira_web_upstream; } location / { proxy_connect_timeout 3s; proxy_read_timeout 300s; proxy_send_timeout 3s; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; proxy_pass http://fp_api_gateway_upstream; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } } 複製程式碼
- 不使用upstream的替代方案
kubectl describe cm pasp-nginx-conf -n shb-sf-stg-949093af #user nobody; worker_processes 1; error_log logs/error.log; pid logs/nginx.pid; events { worker_connections 1024; } http { include /wls/apache/nginx/nginx-1.13.3/conf/mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; client_max_body_size 50M; log_format access '$remote_addr - $remote_user [$time_local] "$request"' '$status $body_bytes_sent "$http_referer"' '"$http_user_agent" $http_x_forwarded_for'; #gzip on; server { listen 7910; server_name localhost; access_log logs/host.access.log access; #charset koi8-r; resolver 172.254.0.2 valid=2s; #access_log logs/host.access.log main; location = / { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; #proxy_pass http://pasp_core_web_upstream/pasp-web/index.html; set $backend_servers pasp-core-web-ui.shb-sf-stg-949093af.svc.cluster.local.; proxy_pass http://$backend_servers:7910/pasp-web/index.html; } location ~* ^/pasp-web\/(.*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$) { #resolver 127.0.0.11; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; #proxy_pass http://pasp_core_web_upstream; set $backend_servers pasp-core-web-ui.shb-sf-stg-949093af.svc.cluster.local.; proxy_pass http://$backend_servers:7910; } location ^~ /ws-web/ { #resolver 127.0.0.11; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; #proxy_pass http://pasp_ws_web_upstream; set $backend_servers pasp-ws-web-ui.shb-sf-stg-949093af.svc.cluster.local.; proxy_pass http://$backend_servers:7910; } location ^~ /aiknow-benefit-web/ { #resolver 127.0.0.11; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; #proxy_pass http://pasp_aiknow_benefit_web_upstream; set $backend_servers pasp-aiknow-web-benefit-ui.shb-sf-stg-949093af.svc.cluster.local.; proxy_pass http://$backend_servers:7910; } location ^~ /aiknow-amlbl-web/ { #resolver 127.0.0.11; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; #proxy_pass http://pasp_aiknow_amlbl_web_upstream; set $backend_servers icmp-aiknow-web-amlbl-ui.shb-sf-stg-949093af.svc.cluster.local.; proxy_pass http://$backend_servers:7910; } location ^~ /aiknow-rcbl-web/ { #resolver 127.0.0.11; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; #proxy_pass http://pasp_aiknow_amlbl_web_upstream; set $backend_servers pasp-aiknow-web-rcbl-ui.shb-sf-stg-949093af.svc.cluster.local.; proxy_pass http://$backend_servers:7910; } location ^~ /eeportal-web/ { #resolver 127.0.0.11; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; #proxy_pass http://pasp_aiknow_amlbl_web_upstream; set $backend_servers pasp-eeportal-web-ui.shb-sf-stg-949093af.svc.cluster.local.; proxy_pass http://$backend_servers:7910; } #location ^~ /nmpr-web/ { # resolver 127.0.0.11; # proxy_set_header Host $http_host; # proxy_set_header X-Forwarded-Host $host; # proxy_set_header X-Real-IP $remote_addr; # proxy_set_header X-Forwarded-Server $host; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # add_header Cache-Control no-store; # proxy_pass http://pasp_nmpr_web_upstream; #} location / { #resolver 127.0.0.11; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Cache-Control no-store; #proxy_pass http://fp_api_gateway_upstream; set $backend_servers fp-core-api-gateway.shb-sf-fp-core-stg-5066f14b.svc.cluster.local.; proxy_pass http://$backend_servers:8086; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } } 複製程式碼
- 使用upstream的nginx配置檔案
k8s待研究項
相關文章
- CV待研究
- 雜湊256,待研究
- win10怎麼新增待辦事項_win10待辦事項怎麼新增Win10
- Mac待辦事項提醒軟體Mac
- 光速上手k8s(2023)(containerd)(未完待續)K8SAI
- spring boot 註解物件的問題 待研究Spring Boot物件
- 挑選最佳待辦事項工具:專家指南
- [譯] 用 Flutter 寫一個待辦事項應用Flutter
- Mac待辦事項管理軟體——Microsoft To-Do for MacMacROS
- 如何聰明地利用待辦事項 APP 完成任務APP
- QOwnNotes for mac筆記和待辦事項記錄軟體Mac筆記
- 提升工作效率必備,桌面待辦事項提醒軟體
- 開始使用開源待辦事項清單管理器
- 微軟待辦事項軟體:To Do for Mac中文免費版微軟Mac
- 待辦事項和日曆工具:Task Office for Mac中文版Mac
- k8s實踐——HPA實踐例項K8S
- mixins,自定義指令,render函式(待研究填坑),過濾器函式過濾器
- 使用 Emacs 進行社交併跟蹤你的待辦事項列表Mac
- 頂尖待辦事項軟體對比:找到你的最佳匹配
- 待辦事項列表怎麼顯示在電腦桌面上?
- 待辦事項和日曆軟體:Task Office for Mac中文版Mac
- k8s透過api介面刪除例項K8SAPI
- 深度分析2種最常用待辦事項清單法+工具實操
- 拖延症晚期?你需要這個待辦事項清單來拯救你
- 待整理
- 太牛了,這個待辦事項清單工具讓你告別加班。
- 第七講、Vue3.x 實現一個完整的toDoList(待辦事項)Vue
- CSS(待新增)CSS
- 待整理 mybatisMyBatis
- 待創作
- 排序【未完待續】排序
- Task 5 (待更新....)
- 待完成清單
- 這款免費的待辦事項清單APP,讓我放棄了滴答清單APP
- K8S 生態週報| Knative 進入 CNCF 孵化,K8S ingress-nginx 解決多例項問題K8SNginx
- 談談如何像對待產品一樣對待資料
- 我已經迫不及待地想給各位安利一項遊戲音訊新技術了遊戲音訊
- 彙編指令(待完善)