NGINX Declarative API can be deployed on Kubernetes using the plain manifests in this directory (nginx-declarative-api.yaml).
Looking for configurable production options (custom
values.yaml, autoscaling, persistence, TLS, NetworkPolicies, or per-component toggles)? Use the Helm chart instead.
nginx-declarative-api.yaml creates the nginx-dapi namespace and deploys:
| Component | Service | Port | Image | Purpose |
|---|---|---|---|---|
| nginx-dapi | nginx-dapi |
5000 |
ghcr.io/f5devcentral/nginx-declarative-api:latest |
Core Declarative REST API service |
| devportal | devportal |
5000 |
ghcr.io/f5devcentral/nginx-declarative-api-devportal:latest |
Redocly Developer Portal generator |
| webui | webui |
80 → 8080 |
ghcr.io/f5devcentral/nginx-declarative-api-webui:latest |
Browser-based Web UI (nginx-unprivileged on port 8080) |
| mcp | mcp |
8800 |
ghcr.io/f5devcentral/nginx-declarative-api-mcp:latest |
Model Context Protocol (MCP) server (streamable-http on /mcp) |
| redis | redis |
6379 |
redis:8.10 |
Declaration state, GitOps sync metadata, and async queue |
- Kubernetes 1.23+
- An Ingress controller matching
ingressClassName: nginx(or updatespec.ingressClassNameinnginx-declarative-api.yaml), or a Kubernetes Gateway APIv1controller (such as F5 NGINX Gateway Fabric) if enabling the commented-outGateway+HTTPRouteoption - Connectivity from the cluster to F5 NGINX Instance Manager or F5 NGINX One Console
-
Edit
nginx-declarative-api.yamland update theIngresshostnames to match your DNS environment:rules: - host: nginx-dapi.k8s.example.com - host: nginx-dapi-webui.k8s.example.com - host: nginx-dapi-mcp.k8s.example.com
Tip: To pin release
5.7.2explicitly instead of:latest, replace the:latesttags on the fourghcr.io/f5devcentral/nginx-declarative-api*images (or configureNDAPI_VERSION/NDAPI_API_KEYon themcpDeployment if authentication is enabled). -
Apply the manifest:
kubectl apply -f nginx-declarative-api.yaml
Expected output:
namespace/nginx-dapi created deployment.apps/redis created service/redis created deployment.apps/nginx-dapi created service/nginx-dapi created deployment.apps/devportal created service/devportal created deployment.apps/webui created service/webui created deployment.apps/mcp created service/mcp created ingress.networking.k8s.io/nginx-dapi created -
Verify all pods and services are running:
kubectl get all -n nginx-dapi
Expected output:
NAME READY STATUS RESTARTS AGE pod/devportal-xxxxxxxxxx-xxxxx 1/1 Running 0 30s pod/mcp-xxxxxxxxxx-xxxxx 1/1 Running 0 30s pod/nginx-dapi-xxxxxxxxxx-xxxxx 1/1 Running 0 30s pod/redis-xxxxxxxxxx-xxxxx 1/1 Running 0 30s pod/webui-xxxxxxxxxx-xxxxx 1/1 Running 0 30s -
Inspect the
Ingressendpoints:kubectl get ingress -n nginx-dapi
- REST API & Swagger docs:
http://nginx-dapi.k8s.example.com/docs(plus/redocand/openapi.json) - Web UI:
http://nginx-dapi-webui.k8s.example.com/ - MCP Server (Streamable HTTP):
http://nginx-dapi-mcp.k8s.example.com/mcp(see contrib/mcp/README.md for client setup)
- REST API & Swagger docs:
-
Build all images locally using the Docker Compose helper script:
cd contrib/docker-compose ./nginx-dapi.sh -c build -
Tag and push the four built images to your registry:
for img in \ nginx-declarative-api \ nginx-declarative-api-devportal \ nginx-declarative-api-webui \ nginx-declarative-api-mcp do docker tag ghcr.io/f5devcentral/${img}:latest YOUR_REGISTRY_HERE/${img}:latest docker push YOUR_REGISTRY_HERE/${img}:latest done
-
Replace the
ghcr.io/f5devcentral/...image references innginx-declarative-api.yamlwithYOUR_REGISTRY_HERE/...and apply the manifest as shown in Option A.
nginx-declarative-api.yaml includes a commented-out Kubernetes Gateway API (gateway.networking.k8s.io/v1) configuration at the bottom of the file as an alternative to Ingress (for controllers such as F5 NGINX Gateway Fabric):
| Resource | Kind | Hostname (spec.hostnames) |
Target Service & Port |
|---|---|---|---|
nginx-dapi-gateway |
Gateway |
HTTP listener on port 80 (gatewayClassName: nginx) |
Accepts routes from the nginx-dapi namespace |
nginx-dapi |
HTTPRoute |
nginx-dapi.k8s.example.com |
nginx-dapi:5000 (PathPrefix /) |
webui |
HTTPRoute |
nginx-dapi-webui.k8s.example.com |
webui:80 (PathPrefix /) |
mcp |
HTTPRoute |
nginx-dapi-mcp.k8s.example.com |
mcp:8800 (PathPrefix /) |
To switch from Ingress to Gateway and HTTPRoute:
-
Ensure Gateway API CRDs and a controller are installed in your cluster (e.g., F5 NGINX Gateway Fabric with a
GatewayClassnamednginx, or updategatewayClassNameto match your controller'sGatewayClass). -
Comment out or remove the
Ingressresource innginx-declarative-api.yamlto avoid duplicate hostname/routing conflicts. -
Uncomment the
GatewayandHTTPRoutemanifests at the bottom ofnginx-declarative-api.yamland updatehostnamesfor your DNS domain. -
Apply and verify the Gateway API resources:
kubectl apply -f nginx-declarative-api.yaml kubectl get gateway,httproute -n nginx-dapi
Verify that
gateway/nginx-dapi-gatewayreportsPROGRAMMED: Truewith an external address assigned, and all threeHTTPRouteresources are accepted by thehttplistener.
Delete the resources created by nginx-declarative-api.yaml:
kubectl delete -f nginx-declarative-api.yaml