Hi,
I am a new beginner of kong for kubernetes and for my case that i need to create 2 consumers and use these 2 consumers with 1 service but with different kong url, like one with /a and one with /b. so how can i use these 2 Kongconsumer for the apikey authentication?
For example, i deploy a simple service echo. And then create an ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: demo
annotations:
kubernetes.io/ingress.class: kong
spec:
rules:
- http:
paths:- path: /foo
backend:
serviceName: echo
servicePort: 80 - path: /hoo
backend:
serviceName: echo
servicePort: 80
- path: /foo
for example the key and consumer setup.
apiVersion: v1
kind: Secret
metadata:
name: ’ my-secret’
stringData:
kongCredType: ‘key-auth’
key: mytestkey
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: echo-auth
plugin: key-auth
apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
name: ‘my-consumer’
annotations:
kubernetes.io/ingress.class: kong
username: ‘my-user’
credentials:
- my-secret
apiVersion: v1
kind: Secret
metadata:
name: ’ my-secret1’
stringData:
kongCredType: ‘key-auth’
key: mytestkey1
apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
name: ‘my-consumer1’
annotations:
kubernetes.io/ingress.class: kong
username: ‘my-user1’
credentials:
- my-secret1
So i can access it by both /foo and /hoo, then i want to use the KongConsumer to do the auth apikey check for /foo and use kongconsumer1 to do the auth apikey check for /hoo, then what should I do?
Thanks.