Basic configuration examples
Enable on a service
The following examples provide some typical configurations for enabling
the application-registration
plugin on a
service.
Kong Admin API
Kubernetes
Declarative (YAML)
Make the following request:
curl -X POST http://localhost:8001/services/{serviceName|Id}/plugins \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "application-registration",
"config": {
"auto_approve": false,
"description": "<my_service_description>",
"display_name": "<my_service_display_name>",
"show_issuer": false
}
}
'
Replace SERVICE_NAME|ID
with the id
or name
of the service that this plugin configuration will target.
First, create a KongPlugin resource:
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: application-registration-example
plugin: application-registration
config:
auto_approve: false
description: "<my_service_description>"
display_name: "<my_service_display_name>"
show_issuer: false
" | kubectl apply -f -
Next, apply the KongPlugin
resource to an ingress by annotating the service
as follows:
kubectl annotate service SERVICE_NAME konghq.com/plugins=application-registration-example
Replace SERVICE_NAME
with the name of the service that this plugin configuration will target.
You can see your available ingresses by running kubectl get service
.
Note: The KongPlugin resource only needs to be defined once and can be applied to any service, consumer, or route in the namespace. If you want the plugin to be available cluster-wide, create the resource as aKongClusterPlugin
instead ofKongPlugin
.
Add this section to your declarative configuration file:
plugins:
- name: application-registration
service: SERVICE_NAME|ID
config:
auto_approve: false
description: "<my_service_description>"
display_name: "<my_service_display_name>"
show_issuer: false
Replace SERVICE_NAME|ID
with the id
or name
of the service that this plugin configuration will target.