Skip to content

Instantly share code, notes, and snippets.

@davideagle
Created March 29, 2019 16:36
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/dbc092cebf81b82b0e0eccd5d5969311 to your computer and use it in GitHub Desktop.
Save davideagle/dbc092cebf81b82b0e0eccd5d5969311 to your computer and use it in GitHub Desktop.
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: wallet-kong-ingress
namespace: default
proxy:
path: /
route:
protocols:
- https
- http
strip_path: true
preserve_host: true
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kong-wallet-ingress
namespace: default
annotations:
kubernetes.io/ingress.class: "kong"
configuration.konghq.com: wallet-kong-ingress
spec:
tls:
- hosts:
- ${KONG_AWS_DNS}
secretName: ${KONG_AWS_CERT_NAME}
rules:
- host: ${KONG_AWS_DNS}
http:
paths:
- path: "/api/wallet"
backend:
serviceName: wallet
servicePort: http
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: wallet-key-auth
namespace: default #this should match the namespace of the route or service you're adding it too.
plugin: key-auth
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: wallet-acl
namespace: default #this should match the namespace of the route or service you're adding it too.
config:
whitelist: ['app-checkin-consumer']
plugin: acl
---
# Checkin app Consumer and credentials
apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
name: app-checkin-consumer
namespace: default
username: app-checkin-consumer
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
metadata:
name: wallet-credential
consumerRef: app-checkin-consumer
type: key-auth
config:
key: ${APP_API_KEY}
---
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment