日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
ACK部署Apacheapisix-ingress-cotroller

本文轉(zhuǎn)載自微信公眾號「Kirito的技術(shù)分享」,作者金衛(wèi)。轉(zhuǎn)載本文請聯(lián)系Kirito的技術(shù)分享公眾號。金衛(wèi)  

在平泉等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強發(fā)展的系統(tǒng)性、市場前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都網(wǎng)站設(shè)計、網(wǎng)站建設(shè) 網(wǎng)站設(shè)計制作定制網(wǎng)站建設(shè),公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站建設(shè),營銷型網(wǎng)站建設(shè),外貿(mào)網(wǎng)站制作,平泉網(wǎng)站建設(shè)費用合理。

背景

Ingress 是 Kubernetes 中一個值得關(guān)注的模塊,作為外部訪問 Kubernetes 集群服務(wù)的入口,市面上已經(jīng)有了多種 Ingress controller 的實現(xiàn)。國產(chǎn)實時、高性能的 API 網(wǎng)關(guān) Apache APISIX 推出的 Apache/apisix-ingress-controller 就是其中一員,作為功能更加強大的 ingress 對外提供服務(wù)。筆者準(zhǔn)備在阿里云 ACK 集群上部署測試。

主題描述

本文主要介紹在阿里云 ACK 部署 apisix-ingress-controller,并且使用 httpbin 測試一個簡單的場景。

部署拓?fù)?/strong>

網(wǎng)絡(luò)拓?fù)?/p>

依賴項

阿里云的 ACK 集群 ;推薦最低配置:3個 master 節(jié)點:CPU 2核 內(nèi)存 4G2個 worker 節(jié)點:CPU 4核 內(nèi)存 8G

安裝步驟

apisix 2.1 release

通過 helm 安裝 apisix 2.1 release

 
 
 
 
  1. $ kubectl create ns apisix 
  2. $ git clone https://github.com/apache/apisix-helm-chart.git 
  3. $ cd ./apisix-helm-chart 
  4. $ helm repo add bitnami https://charts.bitnami.com/bitnami 
  5. $ helm dependency update ./chart/apisix 
  6. $ helm install apisix ./chart/apisix \ 
  7.   --set gateway.type=LoadBalancer \ 
  8.   --set allow.ipList="{0.0.0.0/0}" \ 
  9.   --namespace apisix 

tips: etcd 安裝時指定 PVC, PVC 在阿里云部署時,需要指定 PV 為云盤, 請在 PVC 的 annotations 中增加:volume.beta.kubernetes.io/storage-class: alicloud-disk-ssd。(關(guān)于 PVC 和 PV 的關(guān)系請參考這里)

apisix-ingress-controller

通過 helm 安裝 apisix-ingress-controller

 
 
 
 
  1. $ git clone https://github.com/apache/apisix-ingress-controller.git 
  2. $ cd ./apisix-ingress-controller 
  3. $ helm install ingress-apisix-base -n apisix ./charts/base 
  4. $ helm install ingress-apisix ./charts/ingress-apisix \    
  5.   --set ingressController.image.tag=dev \ 
  6.   --set ingressController.config.apisix.baseURL=http://apisix-admin:9180/apisix/admin \ 
  7.   --set ingressController.config.apisix.adminKey=edd1c9f034335f136f87ad84b625c8f1 \ 
  8.   --namespace apisix 

測試

檢查集群是否部署成功

 

配置一個簡單的路由做測試

 
 
 
 
  1. apiVersion: apisix.apache.org/v1 
  2. kind: ApisixRoute 
  3. metadata: 
  4.   name: httpbin-route 
  5.   namespace: apisix 
  6. spec: 
  7.   rules: 
  8.   - host: httpbin.apisix.com 
  9.     http: 
  10.       paths: 
  11.       - backend: 
  12.           serviceName: httpbin 
  13.           servicePort: 80 
  14.         path: /hello* 

通過 apisix admin api 查看結(jié)果,發(fā)現(xiàn)路由已經(jīng)正確配置。

 
 
 
 
  1.     "action": "get", 
  2.     "count": "2", 
  3.     "header": { 
  4.         "revision": "46", 
  5.         "cluster_id": "8320356269565269865", 
  6.         "raft_term": "2", 
  7.         "member_id": "3807956127770623265" 
  8.     }, 
  9.     "node": { 
  10.         "key": "/apisix/upstreams", 
  11.         "dir": true, 
  12.         "modifiedIndex": 27, 
  13.         "createdIndex": 3, 
  14.         "nodes": [ 
  15.             { 
  16.                 "key": "/apisix/upstreams/00000000000000000041", 
  17.                 "modifiedIndex": 42, 
  18.                 "value": { 
  19.                     "nodes": { 
  20.                         "172.20.1.12:80": 100 
  21.                     }, 
  22.                     "type": "roundrobin", 
  23.                     "pass_host": "pass", 
  24.                     "hash_on": "vars", 
  25.                     "desc": "apisix_httpbin_80", 
  26.                     "create_time": 1608561159, 
  27.                     "update_time": 1608561159 
  28.                 }, 
  29.                 "createdIndex": 42 
  30.             } 
  31.         ] 
  32.     } 

擴容 httpbin

 

查看 k8s 中 httpbin

查看 apisix 中 httpbin upstream

 
 
 
 
  1. // 格式化后 
  2.     ... 
  3.         "nodes": { 
  4.             "172.20.1.12:80": 100, 
  5.             "172.20.0.198:80": 100, 
  6.             "172.20.0.197:80": 100 
  7.         }, 
  8.         "id": "00000000000000000041", 
  9.         "key": "/apisix/upstreams/00000000000000000041", 
  10.         "desc": "apisix_httpbin_80", 
  11.   ... 

總結(jié)

本文在 ACK 集群環(huán)境依次安裝了 Etcd、 Apache APISIX、Apache apisix-ingress-controller,并且使用 httpbin 服務(wù)驗證 ingress 的基本配置功能,通過 CRD 配置了路由,檢測了后端服務(wù)在擴縮容時服務(wù)注冊發(fā)現(xiàn)機制。

另外值得一提的是 apisix-ingress-controller 可以完整的支持 Apache APISIX 提供的所有插件,甚至是自定義插件。功能豐富且擴展能力強,是一款不錯的 Ingress 項目。


文章題目:ACK部署Apacheapisix-ingress-cotroller
網(wǎng)站鏈接:http://m.5511xx.com/article/cdhedgh.html