Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 762 Bytes

06-basic-auth.md

File metadata and controls

40 lines (31 loc) · 762 Bytes

create a secret

kubectl create secret generic john-basicauth --from-literal=kongCredType=basic-auth    --from-literal=username=johndoe --from-literal=password=foo -n kuma-demo

then create a Kong Plugin resource and a KongConsumer

apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: basic-auth-example
  namespace: kuma-demo
config:
  hide_credentials: true
plugin: basic-auth
---
apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
  annotations:
    kubernetes.io/ingress.class: kong
  name: johndoe
  namespace: kuma-demo
username: johndoe
credentials:
- john-basicauth

then edit the demo-app Service and add the following annotations

konghq.com/plugins: basic-auth-example

johndoe foo