Skip to content

fixed bug: now compatible with inress-nginx 0.22 and up (only fixed&…#16

Open
ljkoning wants to merge 1 commit intotpryan:masterfrom
ljkoning:patch-1
Open

fixed bug: now compatible with inress-nginx 0.22 and up (only fixed&…#16
ljkoning wants to merge 1 commit intotpryan:masterfrom
ljkoning:patch-1

Conversation

@ljkoning
Copy link
Copy Markdown

…tested for deploy.generic)

All requests were be rewritten to /
See: https://github.com/kubernetes/ingress-nginx/tree/master/docs/examples/rewrite

@smiklos
Copy link
Copy Markdown

smiklos commented Jan 6, 2020

It appears that for whatever reasons running this on k8s 1.17 (microk8s) would redirect all requests to assets to the home page.

Adding the special asset path solves this to me and although is probably not a good solution, for a demo it works :)

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: wap-ingress
  labels:
    exercise: mole
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
    - http:
        paths:
          - path: /api/(.*)
            backend:
              serviceName: api
              servicePort: 8080
          - path: /admin/(.*)
            backend:
              serviceName: admin
              servicePort: 8080
          - path: /(.*)
            backend:
              serviceName: game
              servicePort: 8080
          - path: /asset/(.*)
            backend:
              serviceName: game
              servicePort: 8080
      host: whackapod.example.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants