Without a database there is nowhere Kong could write single objects. A POST to /services therefore fails – no matter how correct the data is.
Symptom
curl -s -X POST $ADMIN/services -d name=echo -d url=http://echo:8080 | jq .
Trying to create a service via the Admin API.
Diagnosis
The answer names code 12, operation unsupported.
{
"name": "operation unsupported",
"message": "cannot create 'services' entities when not using a database",
"code": 12
}
Causes
database: offKong runs DB-less
The configuration lives only in memory and is replaced as a whole when loaded. Write endpoints for single objects are disabled.
Fix
mkdir -p ~/kong-lab/tag01 && cd ~/kong-lab/tag01
Don't: Switching to a database for single changes just because the Admin API does not write – DB-less with configuration from Git is usually the better choice.
Kong hands-on, Day 1: starting Kong, Admin API and proxy, DB-less, configuration in memory and as a file, Kong Manager.
Go to day 1 →
FAQ
How do I see whether Kong runs DB-less?
At the Admin API root endpoint: it shows "database": "off".
Is a partial update possible in DB-less mode?
No, POST /config always replaces the whole configuration. decK computes the difference and sends the complete state.