jaymin2609 commented on issue #12597:
URL: https://github.com/apache/apisix/issues/12597#issuecomment-3258241627
Heere are my config files and setup
1. APISIX `config.yaml`
```
apisix:
extra_lua_path: "/opt/apisix/plugins/?.lua"
node_listen: 9080 # APISIX listening port
enable_ipv6: false
enable_control: true
control:
ip: "0.0.0.0"
port: 9092
deployment:
admin:
allow_admin: #
https://nginx.org/en/docs/http/ngx_http_access_module.html#allow
- 0.0.0.0/0 # We need to restrict ip access rules for security.
0.0.0.0/0 is for test.
admin_key:
- name: "admin"
key: edd1c9f034335f136f87ad84b625c8f1
role: admin # admin: manage all configuration data
- name: "viewer"
key: 4054f7cf07e344346cd3f287985e76a2
role: viewer
etcd:
host: # it's possible to define multiple etcd hosts addresses of the
same etcd cluster.
- "http://etcd:2379" # multiple etcd address
prefix: "/apisix" # apisix configurations prefix
timeout: 30 # 30 seconds
ext-plugin:
cmd: ["java", "-jar", "/opt/apisix/customplugin-1.0.0.jar"]
#path_for_test: /tmp/runner.sock
plugin_attr:
prometheus:
export_addr:
ip: "0.0.0.0"
port: 9091
metrics:
http_status:
extra_labels:
- upstream_addr: $upstream_addr # Add an extra upstream_addr label
with value being the NGINX variable $upstream_addr.
- route_name: $route_name
expire: 0
loki-logger:
endpoint_addrs:
- "http://loki:3100"
tenant_id: "apisix"
labels:
service: "apisix-gateway"
route: "$route_id"
consumer: "$consumer_name"
plugins:
- loki-logger
- my-plugin
- ext-plugin-pre-req
- ext-plugin-post-resp
- file-logger
- prometheus
- jwt-auth
- cors
- key-auth
- response-rewrite
- limit-count
- mocking
```
2. Docker compose file
```
services:
apisix:
build: .
#image: apache/apisix:${APISIX_IMAGE_TAG:-3.13.0-debian}
restart: always
volumes:
- ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
- ./plugins/my-plugin.lua:/opt/apisix/plugins/my-plugin.lua:ro
- ./apisix_logs:/usr/local/apisix/logs
-
./plugin-jar/customplugin-1.0.0.jar:/opt/apisix/customplugin-1.0.0.jar:ro
environment:
- APISIX_LISTEN_ADDRESS=/tmp/runner.sock
- APISIX_CONF_EXPIRE_TIME=7200
depends_on:
- etcd
- loki
##network_mode: host
ports:
- "9180:9180/tcp"
- "9080:9080/tcp"
- "9091:9091/tcp"
- "9443:9443/tcp"
- "9092:9092/tcp"
networks:
apisix:
apisix-dashboard:
#image: apache/apisix-dashboard:2.15.1-alpine
image: apache/apisix-dashboard:2.15.1-alpine
restart: always
ports:
- "9000:9000"
volumes:
- ./dashboard_conf/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml
networks:
apisix:
etcd:
image: bitnami/etcd:3.5.11
restart: always
volumes:
- etcd_data:/bitnami/etcd
environment:
ETCD_ENABLE_V2: "true"
ALLOW_NONE_AUTHENTICATION: "yes"
ETCD_ADVERTISE_CLIENT_URLS: "http://etcd:2379"
ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
ports:
- "2379:2379/tcp"
networks:
apisix:
prometheus:
image: prom/prometheus:v2.25.0
restart: always
volumes:
- ./prometheus_conf/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
networks:
apisix:
grafana:
image: grafana/grafana:12.2.0-17389662039-ubuntu
restart: always
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin # set default username
- GF_SECURITY_ADMIN_PASSWORD=StrongPassword123 # set strong password
- GF_AUTH_ANONYMOUS_ENABLED=false # disable anonymous access
volumes:
- "./grafana_conf/provisioning:/etc/grafana/provisioning"
- "./grafana_conf/dashboards:/var/lib/grafana/dashboards"
- "./grafana_conf/config/grafana.ini:/etc/grafana/grafana.ini"
networks:
apisix:
loki:
image: grafana/loki:3.2.1
restart: always
command: -config.file=/etc/loki/local-config.yaml
volumes:
- ./loki_confg/local-config.yaml:/etc/loki/local-config.yaml
- ./loki_data:/tmp/loki
ports:
- "3100:3100"
networks:
apisix:
promtail:
image: grafana/promtail:2.9.0
restart: always
volumes:
- ./promtail_conf/promtail-config.yml:/etc/promtail/promtail.yml
- ./apisix_logs:/var/log/apisix # mount same logs folder as apisix
command: -config.file=/etc/promtail/promtail.yml
networks:
apisix:
depends_on:
- loki
networks:
apisix:
driver: bridge
volumes:
etcd_data:
driver: local
loki_data:
driver: local
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]