- 如何測試一個服務在叢集內的效能?
- 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待研究項
相關文章
- histogram一點研究(待整理)Histogram
- win10怎麼新增待辦事項_win10待辦事項怎麼新增Win10
- Mac待辦事項提醒軟體Mac
- spring boot 註解物件的問題 待研究Spring Boot物件
- 光速上手k8s(2023)(containerd)(未完待續)K8SAI
- 挑選最佳待辦事項工具:專家指南
- [譯] 用 Flutter 寫一個待辦事項應用Flutter
- Mac待辦事項管理軟體——Microsoft To-Do for MacMacROS
- AsmL例項研究(二) (轉)ASM
- 微軟待辦事項軟體:To Do for Mac中文免費版微軟Mac
- 如何聰明地利用待辦事項 APP 完成任務APP
- Vuex 模組化實現待辦事項的狀態管理Vue
- mixins,自定義指令,render函式(待研究填坑),過濾器函式過濾器
- k8s實踐——HPA實踐例項K8S
- 開始使用開源待辦事項清單管理器
- QOwnNotes for mac筆記和待辦事項記錄軟體Mac筆記
- 待辦事項和日曆工具:Task Office for Mac中文版Mac
- 提升工作效率必備,桌面待辦事項提醒軟體
- 待整理
- 使用 Emacs 進行社交併跟蹤你的待辦事項列表Mac
- 待辦事項和日曆軟體:Task Office for Mac中文版Mac
- 待辦事項列表怎麼顯示在電腦桌面上?
- 頂尖待辦事項軟體對比:找到你的最佳匹配
- k8s透過api介面刪除例項K8SAPI
- 深度分析2種最常用待辦事項清單法+工具實操
- JavaScript String 物件例項深入研究JavaScript物件
- Amoeba for MySQL學習研究之注意事項MySql
- Delphi Open Tools Api例項研究(一) (轉)API
- CSS(待新增)CSS
- 待處理
- 待整理 mybatisMyBatis
- 太牛了,這個待辦事項清單工具讓你告別加班。
- 排序【未完待續】排序
- 待辦事宜 工具
- 待完成清單
- 第七講、Vue3.x 實現一個完整的toDoList(待辦事項)Vue
- 深圳敏捷部落_4月工作坊《從想法到產品待辦事項列表》敏捷
- 談談如何像對待產品一樣對待資料