hongbo-miao/hongbomiao.com

View on GitHub
kubernetes/manifests/hasura/traefik-configmap.yaml

Summary

Maintainability
Test Coverage
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: traefik-configmap
  namespace: hm-hasura
data:
  traefik.yaml: |
    pilot:
      token: 44e5b50c-cfa9-4ff7-ab74-2c90fb8ec89f
    entryPoints:
      hasura-graphql-engine-entrypoint:
        address: :16022
    api:
      insecure: true
      dashboard: true
    providers:
      file:
        filename: /etc/traefik/dynamic_conf.yaml
    log:
      level: INFO
    accessLog: {}
    metrics:
      prometheus:
        buckets:
          - 0.1
          - 0.3
          - 1.2
          - 5.0
    ping: {}
    experimental:
      # localPlugins:
      #   traefik-plugin-disable-graphql-introspection:
      #     moduleName: "github.com/hongbo-miao/traefik-plugin-disable-graphql-introspection"
      plugins:
        traefik-plugin-disable-graphql-introspection:
          moduleName: "github.com/hongbo-miao/traefik-plugin-disable-graphql-introspection"
          version: "v0.2.0"

  dynamic_conf.yaml: |
    http:
      routers:
        hasura-graphql-engine-router:
          service: hasura-graphql-engine-service
          entrypoints:
            - hasura-graphql-engine-entrypoint
          rule: Host(`localhost`)
          middlewares:
            - test-ratelimit
            - my-traefik-plugin-disable-graphql-introspection
        hasura-metric-adapter-router:
          service: hasura-metric-adapter-service
          rule: Host(`localhost`) && PathPrefix(`/metrics`)
      services:
        hasura-graphql-engine-service:
          loadBalancer:
            servers:
              - url: http://localhost:16020/
        hasura-metric-adapter-service:
          loadBalancer:
            servers:
              - url: http://localhost:16021/metrics
      # https://doc.traefik.io/traefik/middlewares/http/ratelimit
      middlewares:
        test-ratelimit:
          rateLimit:
            average: 100
            burst: 50
        my-traefik-plugin-disable-graphql-introspection:
          plugin:
            traefik-plugin-disable-graphql-introspection:
              GraphQLPath: /v1/graphql