Apisix Ingress
约 2 分钟阅读
- 不建议使用
- 依赖 etcd
- etcd 难维护
- helm 直接启动的 etcd 可能会有各种问题 - 可能导致无法启动
- 没必要为了 apisix 专门去维护 etcd
- etcd 非常吃 IO - IO 慢的时候 CPU 非常高
- 建议尝试 kong - 使用现有的 DB 作为 backend
- Helm
- charts.apiseven.com apisix
- apisix 依赖 apisix-dashboard, apisix-ingress-controller, etcd
- apache.github.io/apisix-helm-chart
- apache/apisix-helm-chartGitHubapache/apisix-helm-chart
- charts.bitnami.com/bitnami etcd
- charts.apiseven.com apisix
- apisix.apache.org/docs/ingress-controller/getting-started
- v2
IngressController
- ApisixRoute
- ApisixUpstream
- 名字与 service 名字相同会自动匹配
- ApisixTls
- ApisixClusterConfig
- 配置 prometheus、skywalking
- ApisixConsumer
- ApisixPluginConfig
- ingress 通过 annotation 引用
k8s.apisix.apache.org/plugin-config-name: "echo-and-cors-apc"
- ingress 通过 annotation 引用
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: httpbin-route
spec:
http:
- name: rule1
match:
hosts:
- httpbin.com
paths:
- /ip
backends:
- serviceName: httpbin-service-e2e-test
servicePort: 80annotations:
k8s.apisix.apache.org/enable-cors: 'true'
k8s.apisix.apache.org/cors-allow-origin: 'https://foo.com,http://bar.com:8080'
k8s.apisix.apache.org/cors-allow-headers: 'Host: https://bar.com:8080'
k8s.apisix.apache.org/cors-allow-methods: 'GET,POST'
k8s.apisix.apache.org/allowlist-source-range: '10.0.5.0/16,127.0.0.1,192.168.3.98'
k8s.apisix.apache.org/blocklist-source-range: '127.0.0.1,172.17.0.0/16'
k8s.apisix.apache.org/http-allow-methods: 'GET,POST'
k8s.apisix.apache.org/http-block-method: 'PUT,DELETE'
k8s.apisix.apache.org/rewrite-target-regex: '/app/(.*)'
k8s.apisix.apache.org/rewrite-target-regex-template: '/$1'
k8s.apisix.apache.org/http-to-https: 'true'
k8s.apisix.apache.org/use-regex: 'true'
k8s.apisix.apache.org/enable-websocket: 'true'
k8s.apisix.apache.org/enable-response-rewrite: 'true'
k8s.apisix.apache.org/response-rewrite-status-code: '404'
k8s.apisix.apache.org/response-rewrite-body: 'bar-body'
k8s.apisix.apache.org/response-rewrite-body-base64: 'true'
# 可以通过 Prefix 路由
# path: /helloworld.Greeter/SayHello
k8s.apisix.apache.org/upstream-scheme: grpcs
# 跨 namespace 引用
k8s.apisix.apache.org/svc-namespace: test关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub2 条
- apache/apisix-helm-chartgithub.com/apache/apisix-helm-chart
- apache/apisix-ingress-controller#1104github.com/apache/apisix-ingress-controller/issues/1104
其他外链5 条
- apache.github.io/apisix-helm-chartapache.github.io/apisix-helm-chart
- apisix.apache.org/docs/ingress-controller/getting-startedapisix.apache.org/docs/ingress-controller/getting-started
- apisix.apache.org/docs/ingress-controller/next/references/v2apisix.apache.org/docs/ingress-controller/next/references/v2
- charts.apiseven.comcharts.apiseven.com/
- charts.bitnami.com/bitnamicharts.bitnami.com/bitnami