From 421fcf0b86a76320f2e0cfeb625be1bda2c53a30 Mon Sep 17 00:00:00 2001 From: hcornet Date: Fri, 9 Aug 2024 17:02:34 +0200 Subject: [PATCH] add apisix --- .../apisix/apisix_conf/config.yaml | 21 ++++ .../apisix/dashboard_conf/conf.yaml | 104 ++++++++++++++++++ API/apisix/docker-compose.yml | 73 ++++++++++++ 3 files changed, 198 insertions(+) create mode 100644 API/apisix/apisix_volume/apisix/apisix_conf/config.yaml create mode 100644 API/apisix/apisix_volume/apisix/dashboard_conf/conf.yaml create mode 100644 API/apisix/docker-compose.yml diff --git a/API/apisix/apisix_volume/apisix/apisix_conf/config.yaml b/API/apisix/apisix_volume/apisix/apisix_conf/config.yaml new file mode 100644 index 00000000..af1c43ae --- /dev/null +++ b/API/apisix/apisix_volume/apisix/apisix_conf/config.yaml @@ -0,0 +1,21 @@ +apisix: + node_listen: 7080 + enable_ipv6: false + allow_admin: + - 0.0.0.0/0 + admin_key: + - name: "admin" + key: edd1c9f034335f136f87ad84b625c8f1 + role: admin + +etcd: + host: + - http://apisix-etcd:2379 + prefix: "/apisix" + timeout: 30 + +plugin_attr: + prometheus: + export_addr: + ip: 10.12.1.14 + port: 9091 diff --git a/API/apisix/apisix_volume/apisix/dashboard_conf/conf.yaml b/API/apisix/apisix_volume/apisix/dashboard_conf/conf.yaml new file mode 100644 index 00000000..8ce79d83 --- /dev/null +++ b/API/apisix/apisix_volume/apisix/dashboard_conf/conf.yaml @@ -0,0 +1,104 @@ +conf: + listen: + host: 0.0.0.0 + port: 7000 + etcd: + endpoints: + - "http://apisix-etcd:2379" + log: + error_log: + level: warn + file_path: logs/error.log + access_log: + file_path: logs/access.log + +authentication: + secret: secret + expire_time: 3600 + users: + - username: admin + password: admin + - username: user + password: user + +plugins: + - api-breaker + - authz-casbin + - authz-casdoor + - authz-keycloak + - aws-lambda + - azure-functions + - basic-auth + # - batch-requests + - clickhouse-logger + - client-control + - consumer-restriction + - cors + - csrf + - datadog + # - dubbo-proxy + - echo + - error-log-logger + # - example-plugin + - ext-plugin-post-req + - ext-plugin-post-resp + - ext-plugin-pre-req + - fault-injection + - file-logger + - forward-auth + - google-cloud-logging + - grpc-transcode + - grpc-web + - gzip + - hmac-auth + - http-logger + - ip-restriction + - jwt-auth + - kafka-logger + - kafka-proxy + - key-auth + - ldap-auth + - limit-conn + - limit-count + - limit-req + - loggly + # - log-rotate + - mocking + # - node-status + - opa + - openid-connect + - opentelemetry + - openwhisk + - prometheus + - proxy-cache + - proxy-control + - proxy-mirror + - proxy-rewrite + - public-api + - real-ip + - redirect + - referer-restriction + - request-id + - request-validation + - response-rewrite + - rocketmq-logger + - server-info + - serverless-post-function + - serverless-pre-function + - skywalking + - skywalking-logger + - sls-logger + - splunk-hec-logging + - syslog + - tcp-logger + - traffic-split + - ua-restriction + - udp-logger + - uri-blocker + - wolf-rbac + - zipkin + - elasticsearch-logge + - openfunction + - tencent-cloud-cls + - ai + - cas-auth diff --git a/API/apisix/docker-compose.yml b/API/apisix/docker-compose.yml new file mode 100644 index 00000000..d1e97d6a --- /dev/null +++ b/API/apisix/docker-compose.yml @@ -0,0 +1,73 @@ +networks: + docker-traefik_front_network: + external: true + back_network: + driver: bridge + attachable: true + +services: + apisix: + image: apache/apisix:latest + container_name: apisix-server + restart: always + volumes: + - ./apisix_volume/apisix/apisix_log:/usr/local/apisix/logs + - ./apisix_volume/apisix/apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro + depends_on: + - apisix-etcd + ports: + - 7080:9080 + - 7180:9180 + - 7091:9091 + - 7092:9092 + - 7443:9443 + networks: + - back_network + + apisix-dashboard: + image: apache/apisix-dashboard:latest + container_name: apisix-dashboard + restart: always + volumes: + - ./apisix_volume/apisix/dashboard_conf/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml:ro + depends_on: + - apisix-etcd + ports: + - 7000:9000 + networks: + - back_network + - docker-traefik_front_network + labels: + - "traefik.enable=true" + - "traefik.docker.network=docker-traefik_front_network" +# HTTP + - "traefik.http.routers.apisix-http.rule=Host(`apisix-dashboard.fr.dgs.group`)" + + - "traefik.http.routers.apisix-http.entrypoints=http" +# HTTPS + - "traefik.http.routers.apisix-https.rule=Host(`apisix-dashboard.fr.dgs.group`)" + - "traefik.http.routers.apisix-https.entrypoints=https" + - "traefik.http.routers.apisix-https.tls=true" + - "traefik.http.routers.apisix.service=apisix-service" +# Middleware +# Service + - "traefik.http.services.apisix-service.loadbalancer.server.port=7000" + + apisix-etcd: + image: bitnami/etcd:latest + container_name: apisix-etcd + ports: + - 2380:2380 + - 2379:2379 + environment: + - ALLOW_NONE_AUTHENTICATION=yes + - ETCD_NAME=etcd-1 + - ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380 + - ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379 + - ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379 + volumes: + - ./apisix_volume/etcd:/etcd +# - ./apisix_volume/etcd/conf:/opt/bitnami/etcd/conf + networks: + - back_network +