NGINX Declarative API can be deployed on Kubernetes using the manifest provided
-
Build the NGINX Declarative API docker images using the Docker-compose script
-
Tag and push the docker images to a private registry
docker tag nginx-declarative-api:latest YOUR_REGISTRY_HERE/nginx-declarative-api:latest docker push YOUR_REGISTRY_HERE/nginx-declarative-api:latest docker tag nginx-declarative-api-devportal:latest YOUR_REGISTRY_HERE/nginx-declarative-api-devportal:latest docker push YOUR_REGISTRY_HERE/nginx-declarative-api-devportal:latest
-
Edit
nginx-declarative-api.yamland update the following lines to match the docker images and to set theIngresshost DNS nameimage: YOUR_REGISTRY_HERE/nginx-declarative-api:latest image: YOUR_REGISTRY_HERE/nginx-declarative-api-devportal:latest image: YOUR_REGISTRY_HERE/nginx-declarative-api-webui:latest- host: nginx-dapi.k8s.f5.ff.lan - host: nginx-dapi-webui.k8s.f5.ff.lan -
Apply the manifest
$ kubectl apply -f nginx-declarative-api.yaml namespace/nginx-dapi created deployment.apps/redis created deployment.apps/nginx-dapi created deployment.apps/devportal created deployment.apps/webui created service/redis created service/nginx-dapi created service/devportal created service/webui created ingress.networking.k8s.io/nginx-dapi created
-
Make sure all pods are up and running
$ kubectl get all -n nginx-dapi NAME READY STATUS RESTARTS AGE pod/devportal-74fc5c9ccb-5wjpr 1/1 Running 0 25s pod/nginx-dapi-848599b79b-ll2kg 1/1 Running 0 25s pod/redis-5cdb78b899-hjz9x 1/1 Running 0 25s pod/webui-2edc85a732-jrg8p 1/1 Running 0 25s
-
The NGINX Declarative API can be accessed through its
Ingressresource$ kubectl get ingress -n nginx-dapi NAME CLASS HOSTS ADDRESS PORTS AGE nginx-dapi nginx nginx-dapi.k8s.f5.ff.lan 80 34s nginx-dapi nginx nginx-dapi-webui.k8s.f5.ff.lan 80 34s
-
Delete the
nginx-declarative-api.yamlmanifestkubectl delete -f nginx-declarative-api.yaml