From c243a1e4e9a7b12e83e6deff09af321fb3a35eb4 Mon Sep 17 00:00:00 2001 From: Will Tang Date: Thu, 11 Nov 2021 13:03:27 +0800 Subject: [PATCH 1/2] add canary release back. --- .DS_Store | Bin 10244 -> 10244 bytes .gitignore | 1 + .../.DS_Store" | Bin 8196 -> 8196 bytes .../README.md" | 39 ++++++++++++++++++ .../Reverse Proxy/.DS_Store" | Bin 6148 -> 6148 bytes .../Reverse Proxy/conf.d/canary.conf" | 36 ++++++++++++++++ 6 files changed, 76 insertions(+) create mode 100644 "5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/Reverse Proxy/conf.d/canary.conf" diff --git a/.DS_Store b/.DS_Store index d8987a9f18e298fa60fce57ddf645e5ace3601d9..b83c3dd0edc3134f56f60887c38694b9937fd446 100644 GIT binary patch delta 59 zcmV-B0L1@@&dviZLVGcy3PoC^5> diff --git a/.gitignore b/.gitignore index bf9dfdc..fc1432e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.swp .DS_Store +*/.DS_Store diff --git "a/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/.DS_Store" "b/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/.DS_Store" index 389169cdbb0e21de75b5f1a07a91e29493559350..635ab5ea1ee7711a2b542c2c5717836b55c65521 100644 GIT binary patch delta 75 zcmZp1XmQwJD!_PRvY9}GhIng1Lb~Z7nBM8XF_ge gRdr2m-OS1N1mqcKZT=^~!M>SY;v386KO*eR0Cbob4FCWD diff --git "a/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/README.md" "b/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/README.md" index 7e66b32..9aac961 100644 --- "a/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/README.md" +++ "b/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/README.md" @@ -93,6 +93,45 @@ NGINX安装目录为/etc/nginx/,所有实验配置文件均保存在/etc/nginx 10. 通过Dashboard,观察upstream,应该所有的request都打向abtest_b。 ## Lab4 灰度发布 +[^_^]: # +( + 1. 在反代中创建 *canary.conf* 文件,upstream *v1_only* 、 *v2_only* 、 *all* 分别修改为Web1和Web2的容器IP,执行 `nginx -s reload`。 + 2. 在实验客户端多次用curl模拟各种浏览器访问,应该在Web1和Web2之间轮询。 + ``` + curl -A 'Chrome' http://canary.will.com:8080 + ``` + 3. 在实验客户端执行以下命令。 + ``` + curl -X POST -d '{"stage": "b"}' http://x.x.x.x:8000/api/6/http/keyvals/canary + ``` + 4. 在实验客户端多次用curl模拟各种浏览器访问,应该只会访问到Web1。 + ``` + curl -A 'Chrome' http://canary.will.com:8080 + ``` + 5. 在实验客户端执行以下命令。 + ``` + curl -X PATCH -d '{"stage": "c"}' http://x.x.x.x:8000/api/6/http/keyvals/canary + ``` + 6. 在实验客户端多次用curl模拟Chrome浏览器访问,应该只会访问到Web2。 + ``` + curl -A 'Chrome' http://canary.will.com:8080 + ``` + 7. 在实验客户端多次用curl模拟Firefox浏览器访问,应该只会访问到Web1。 + ``` + curl -A 'Firefox' http://canary.will.com:8080 + ``` + 8. 在实验客户端模拟其它浏览器访问,例如Safari,应该也只会访问到Web1。 + 9. 在实验客户端执行以下命令。 + ``` + curl -X PATCH -d '{"stage": "d"}' http://x.x.x.x:8000/api/6/http/keyvals/canary + ``` + 10. 在实验客户端多次用curl模拟各种浏览器访问,应该只会访问到Web2。 + 11. 在实验客户端执行以下命令。 + ``` + curl -X PATCH -d '{"stage": "a"}' http://x.x.x.x:8000/api/6/http/keyvals/canary + ``` + 12. 在实验客户端多次用curl模拟各种浏览器访问,应该在Web1和Web2之间轮询。 +) ## Lab5 动态限流 1. 在反代中创建 *ratelimit.conf* 文件,upstream *ratelimit* 分别修改为Web1和Web2的容器IP,执行 `nginx -s reload`。 diff --git "a/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/Reverse Proxy/.DS_Store" "b/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/Reverse Proxy/.DS_Store" index b944d300f516cc5fd04ece8bbab24d1be89bec13..f46da5f2b14dbb10f34205b5f5563ea37f2907cb 100644 GIT binary patch delta 350 zcmZoMXfc=|#>B)qu~2NHo}wr-0|Nsi1A_nqgC0XlQh9MfQcix-#*NDv>p?PX49N`n z40#M`$g)836G;U*nZ+dr2G<#xm|0la*f}^kI5>DYVuLgC%Y#c2OG=BK5{sfiynw`# zj3g*KBtJg~&Q44U%STXvU}oHMI3i$gQlZuBok?0dy=7 zFao^@2K-POM$MeqBO{68%d+62yqx^Jbf5~xjT;}aY-Z=+=KzM+#*N>ZC-aNwih#6& TjB9|CJzu~2NHo}wrt0|NsP3otO~F{GpvC+8&P=jTi;RA*$I{DDbkvkCKM rmdy^#JxrU~Iruq%+BO?9e`lV|FQUr{(s=-g87ABCNN Date: Thu, 11 Nov 2021 13:06:29 +0800 Subject: [PATCH 2/2] add canary release back. --- .../README.md" | 75 +++++++++---------- 1 file changed, 36 insertions(+), 39 deletions(-) diff --git "a/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/README.md" "b/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/README.md" index 9aac961..104a15d 100644 --- "a/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/README.md" +++ "b/5 NGINX\346\225\217\346\215\267\351\205\215\347\275\256/README.md" @@ -93,45 +93,42 @@ NGINX安装目录为/etc/nginx/,所有实验配置文件均保存在/etc/nginx 10. 通过Dashboard,观察upstream,应该所有的request都打向abtest_b。 ## Lab4 灰度发布 -[^_^]: # -( - 1. 在反代中创建 *canary.conf* 文件,upstream *v1_only* 、 *v2_only* 、 *all* 分别修改为Web1和Web2的容器IP,执行 `nginx -s reload`。 - 2. 在实验客户端多次用curl模拟各种浏览器访问,应该在Web1和Web2之间轮询。 - ``` - curl -A 'Chrome' http://canary.will.com:8080 - ``` - 3. 在实验客户端执行以下命令。 - ``` - curl -X POST -d '{"stage": "b"}' http://x.x.x.x:8000/api/6/http/keyvals/canary - ``` - 4. 在实验客户端多次用curl模拟各种浏览器访问,应该只会访问到Web1。 - ``` - curl -A 'Chrome' http://canary.will.com:8080 - ``` - 5. 在实验客户端执行以下命令。 - ``` - curl -X PATCH -d '{"stage": "c"}' http://x.x.x.x:8000/api/6/http/keyvals/canary - ``` - 6. 在实验客户端多次用curl模拟Chrome浏览器访问,应该只会访问到Web2。 - ``` - curl -A 'Chrome' http://canary.will.com:8080 - ``` - 7. 在实验客户端多次用curl模拟Firefox浏览器访问,应该只会访问到Web1。 - ``` - curl -A 'Firefox' http://canary.will.com:8080 - ``` - 8. 在实验客户端模拟其它浏览器访问,例如Safari,应该也只会访问到Web1。 - 9. 在实验客户端执行以下命令。 - ``` - curl -X PATCH -d '{"stage": "d"}' http://x.x.x.x:8000/api/6/http/keyvals/canary - ``` - 10. 在实验客户端多次用curl模拟各种浏览器访问,应该只会访问到Web2。 - 11. 在实验客户端执行以下命令。 - ``` - curl -X PATCH -d '{"stage": "a"}' http://x.x.x.x:8000/api/6/http/keyvals/canary - ``` - 12. 在实验客户端多次用curl模拟各种浏览器访问,应该在Web1和Web2之间轮询。 -) +1. 在反代中创建 *canary.conf* 文件,upstream *v1_only* 、 *v2_only* 、 *all* 分别修改为Web1和Web2的容器IP,执行 `nginx -sreload`。 +2. 在实验客户端多次用curl模拟各种浏览器访问,应该在Web1和Web2之间轮询。 + ``` + curl -A 'Chrome' http://canary.will.com:8080 + ``` +3. 在实验客户端执行以下命令。 + ``` + curl -X POST -d '{"stage": "b"}' http://x.x.x.x:8000/api/6/http/keyvals/canary + ``` +4. 在实验客户端多次用curl模拟各种浏览器访问,应该只会访问到Web1。 + ``` + curl -A 'Chrome' http://canary.will.com:8080 + ``` +5. 在实验客户端执行以下命令。 + ``` + curl -X PATCH -d '{"stage": "c"}' http://x.x.x.x:8000/api/6/http/keyvals/canary + ``` +6. 在实验客户端多次用curl模拟Chrome浏览器访问,应该只会访问到Web2。 + ``` + curl -A 'Chrome' http://canary.will.com:8080 + ``` +7. 在实验客户端多次用curl模拟Firefox浏览器访问,应该只会访问到Web1。 + ``` + curl -A 'Firefox' http://canary.will.com:8080 + ``` +8. 在实验客户端模拟其它浏览器访问,例如Safari,应该也只会访问到Web1。 +9. 在实验客户端执行以下命令。 + ``` + curl -X PATCH -d '{"stage": "d"}' http://x.x.x.x:8000/api/6/http/keyvals/canary + ``` +10. 在实验客户端多次用curl模拟各种浏览器访问,应该只会访问到Web2。 +11. 在实验客户端执行以下命令。 + ``` + curl -X PATCH -d '{"stage": "a"}' http://x.x.x.x:8000/api/6/http/keyvals/canary + ``` +12. 在实验客户端多次用curl模拟各种浏览器访问,应该在Web1和Web2之间轮询。 ## Lab5 动态限流 1. 在反代中创建 *ratelimit.conf* 文件,upstream *ratelimit* 分别修改为Web1和Web2的容器IP,执行 `nginx -s reload`。 -- Gitee