1 Star 0 Fork 0

lad/apisix

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Kubernetes

There are some yaml files for deploying apisix in Kubernetes.

Note: You can also install Apache APISIX in Kubernetes by Helm Chart.

Prerequisites

  • use etcd, if there is no etcd service, please install and set etcd address in ../conf/config.yaml

Usage

Create configmap for apache apisix

if you do not need to change any config, and use default config in ../conf/config.yaml

$ kubectl create configmap apisix-gw-config.yaml --from-file=../conf/config.yaml

When using etcd-operator

when using etcd-operator, you need to change apisix-gw-config-cm.yaml:

  • add CoreDNS IP into dns_resolver
dns_resolver:
  - 10.233.0.3      # default coreDNS cluster ip

  • change etcd host

Following {your-namespace} should be changed to your namespace, for example default.

Mention: must use Full Qualified Domain Name. Short name etcd-cluster-client is not work.

etcd:
  host:
    - "http://etcd-cluster-client.{your-namespace}.svc.cluster.local:2379"     # multiple etcd address

Create deployment for apache apisix

$ kubectl apply -f deployment.yaml

Create service for apache apisix

$ kubectl apply -f service.yaml

Scale apache apisix

$ kubectl scale deployment apisix-gw-deployment --replicas=4

Check running status

$ kubectl get cm | grep -i apisix
apisix-gw-config.yaml                             1      1d

$ kubectl get pod | grep -i apisix
apisix-gw-deployment-68df7c7578-5pvxb   1/1     Running   0          1d
apisix-gw-deployment-68df7c7578-kn89l   1/1     Running   0          1d
apisix-gw-deployment-68df7c7578-i830r   1/1     Running   0          1d
apisix-gw-deployment-68df7c7578-32ow1   1/1     Running   0          1d

$ kubectl get svc | grep -i apisix
apisix-gw-svc            LoadBalancer   172.19.33.28    10.253.0.11   80:31141/TCP,443:30931/TCP                  1d

Clean up (dangerous)

kubectl delete -f .
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Lua
1
https://gitee.com/liulad/apisix.git
git@gitee.com:liulad/apisix.git
liulad
apisix
apisix
master

搜索帮助