apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: skillhub
  annotations:
    nginx.ingress.kubernetes.io/limit-rps: "10"
    nginx.ingress.kubernetes.io/limit-burst-multiplier: "3"
    nginx.ingress.kubernetes.io/limit-connections: "20"
    nginx.ingress.kubernetes.io/server-snippet: |
      location ~ ^/(oauth2/authorization|login/oauth2/code|api/v1/auth|api/v1/search|api/v1/skills/.*/download|api/v1/namespaces) {
        limit_req zone=default burst=30 nodelay;
      }
spec:
  ingressClassName: nginx
  rules:
    - host: skills.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: skillhub-web
                port:
                  number: 80
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: skillhub-server
                port:
                  number: 8080
