Skip to content

Instantly share code, notes, and snippets.

@DeclanPaulKeane
Created November 15, 2024 23:24
Show Gist options
  • Select an option

  • Save DeclanPaulKeane/90e991326eb06b60ae9cce96aacf3ffb to your computer and use it in GitHub Desktop.

Select an option

Save DeclanPaulKeane/90e991326eb06b60ae9cce96aacf3ffb to your computer and use it in GitHub Desktop.
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: key-auth
namespace: testing
annotations:
kubernetes.io/ingress.class: kong
plugin: key-auth
---
apiVersion: v1
kind: Secret
metadata:
name: jason-apikey
namespace: testing
labels:
konghq.com/credential: key-auth
stringData:
key: jasonkey
---
apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
name: jason
namespace: testing
annotations:
kubernetes.io/ingress.class: kong
username: jason
credentials:
- jason-apikey
---
apiVersion: v1
kind: Secret
metadata:
name: declan-apikey
namespace: testing
labels:
konghq.com/credential: key-auth
stringData:
key: declankey
---
apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
name: declan
namespace: testing
annotations:
kubernetes.io/ingress.class: kong
username: declan
credentials:
- declan-apikey
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: rate-limiting-plugin
namespace: testing
annotations:
kubernetes.io/ingress.class: kong
plugin: rate-limiting
config:
minute: 5
policy: local
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: comments-ing
namespace: testing
annotations:
konghq.com/plugins: key-auth,rate-limiting-plugin
spec:
ingressClassName: kong
rules:
- http:
paths:
- path: /comments
pathType: ImplementationSpecific
backend:
service:
name: echo
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: users-ing
namespace: testing
annotations:
konghq.com/plugins: key-auth,rate-limiting-plugin
spec:
ingressClassName: kong
rules:
- http:
paths:
- path: /users
pathType: ImplementationSpecific
backend:
service:
name: echo
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: categories-ing
namespace: testing
annotations:
konghq.com/plugins: key-auth,rate-limiting-plugin
spec:
ingressClassName: kong
rules:
- http:
paths:
- path: /categories
pathType: ImplementationSpecific
backend:
service:
name: echo
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: tags-ing
namespace: testing
annotations:
konghq.com/plugins: key-auth,rate-limiting-plugin
spec:
ingressClassName: kong
rules:
- http:
paths:
- path: /tags
pathType: ImplementationSpecific
backend:
service:
name: echo
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: search-ing
namespace: testing
annotations:
konghq.com/plugins: key-auth,rate-limiting-plugin
spec:
ingressClassName: kong
rules:
- http:
paths:
- path: /search
pathType: ImplementationSpecific
backend:
service:
name: echo
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: accounts-ing
namespace: testing
annotations:
konghq.com/plugins: key-auth,rate-limiting-plugin
spec:
ingressClassName: kong
rules:
- http:
paths:
- path: /accounts
pathType: ImplementationSpecific
backend:
service:
name: echo
port:
number: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment