Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MyIngressAndKongPlugin
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: user-kong-cors
namespace: app-dev-ns
enabled: true
plugin: cors
config:
origins: "*"
methods:
- GET
- HEAD
- PUT
- PATCH
- POST
- DELETE
- OPTIONS
headers:
- Origin
- Access-Control-Request-Headers
- Access-Control-Allow-Origin
exposed_headers:
- Origin
- Access-Control-Request-Headers
- Access-Control-Allow-Origin
preflight_continue: false
credentials: false
-----
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: app-ingress-api
namespace: app-dev-ns
annotations:
kubernetes.io/ingress.class: kong
cert-manager.io/cluster-issuer: api-letsencrypt-prod
plugins.konghq.com: user-kong-cors
spec:
tls:
- hosts:
- api.myhost.net
secretName: api-letsencrypt-cert
rules:
- host: api.myhost.net
http:
paths:
- path: /
backend:
serviceName: app-api
servicePort: 3333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment