Skip to content

Instantly share code, notes, and snippets.

@davideagle
Created May 8, 2019 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davideagle/a5d846f8446d811471a882aaea74120f to your computer and use it in GitHub Desktop.
Save davideagle/a5d846f8446d811471a882aaea74120f to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service
metadata:
name: wallet
labels:
name: wallet
team: myice
annotations:
plugins.konghq.com: wallet-key-auth, wallet-acl
spec:
ports:
# the port that this service should serve on
- port: 10000
name: http
selector:
name: wallet
tier: backend
type: micro
---
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: kong-eventlogging-ingress
namespace: default
proxy:
path: /
route:
protocols:
- https
- http
strip_path: true
preserve_host: true
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kong-eventlogging-ingress
namespace: default
annotations:
kubernetes.io/ingress.class: "kong"
configuration.konghq.com: kong-eventlogging-ingress
spec:
rules:
- host: ${KONG_AWS_DNS}
http:
paths:
- path: "/api/eventlogging"
backend:
serviceName: eventlogging
servicePort: http
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: eventlogging-key-auth
namespace: default #this should match the namespace of the route or service you're adding it too.
plugin: key-auth
protocols: ['http','https']
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: eventlogging-basic-auth
namespace: default #this should match the namespace of the route or service you're adding it too.
plugin: basic-auth
protocols: ['http','https']
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: eventlogging-acl
namespace: default #this should match the namespace of the route or service you're adding it too.
config:
whitelist: ['eventlogging-amadeus', 'eventlogging-advania', 'eventlogging-travelear', 'eventlogging-bookingflow']
plugin: acl
protocols: ['http','https']
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
metadata:
name: eventlogging-amadeus-credential
consumerRef: amadeus-consumer
type: key-auth
config:
key: ${KONG_EVENTLOGGING_AMADEUS_API_KEY}
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
metadata:
name: eventlogging-amadeus-acl
consumerRef: amadeus-consumer
type: acl
config:
group: "eventlogging-amadeus"
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
metadata:
name: eventlogging-advania-credential
consumerRef: advania-consumer
type: key-auth
config:
key: ${KONG_EVENTLOGGING_ADVANIA_API_KEY}
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
metadata:
name: eventlogging-advania-acl
consumerRef: advania-consumer
type: acl
config:
group: "eventlogging-advania"
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
metadata:
name: eventlogging-travelear-credential
consumerRef: travelear-consumer
type: key-auth
config:
key: ${KONG_EVENTLOGGING_TRAVELEAR_API_KEY}
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
metadata:
name: eventlogging-travelear-acl
consumerRef: travelear-consumer
type: acl
config:
group: "eventlogging-travelear"
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
metadata:
name: eventlogging-bookingflow-credential
consumerRef: bookingflow-consumer
type: basic-auth
config:
username: ${KONG_EVENTLOGGING_BOOKINGFLOW_USER}
password: ${KONG_EVENTLOGGING_BOOKINGFLOW_PASSWORD}
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
metadata:
name: eventlogging-bookingflow-acl
consumerRef: bookingflow-consumer
type: acl
config:
group: "eventlogging-bookingflow"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment