Healthcheck and Version Addresses for Apinizer Applications
Requesting the statuses and versions of Apinizer's core modules by sending requests can provide valuable information in many cases.
To do this, you first need to connect to the Master server with authorized credentials and identify the relevant pods and their statuses.
As an example, we execute the first command, as shown in the image below:
kubectl get pods -A
This command will provide the output for all pods in your system. In this example, all pods are running smoothly:
In addition, information about the services facilitating communication among the running pods is also required.
kubectl get svc -A
Example output:
The Apinizer Interface (Manager) is by default run on the 'apinizer' namespace. Unless specified otherwise, the default namespaces for Apinizer Gateways (worker and cache) are set to 'test' or 'prod'.
In this example, Apinizer Integration and Apinizer Portal modules are seen in the 'apinizer-integration' and 'apinizer-portal' namespaces, respectively.
With this information and the following commands, you can create a URL to check whether the desired application is running or not.
http://<SERVICE_NAME>.<ENVIRONMENT_NAME>.svc.cluster.local:<SERVICE_INTERNAL_PORT>/apinizer/management/health
http://manager.apinizer.svc.cluster.local:8080/apinizer/management/health
However, the existing servers won't be able to resolve these DNS addresses managed within Kubernetes on their own.
You can make a request to the desired address from within a pod using the following command.
The pod information can be obtained from the output in the first screenshot above.
kubectl exec -it <ANY_POD_NAME> -n <PODS_NAMESPACE> -- curl apinizer.com
If you want to go directly from the server, you can obtain the information about the IP address of the relevant service from the output in the second screenshot above. By replacing the name in the first section with the IP of the respective pod, direct access can also be achieved.
http://<SERVER_IP>:8080/apinizer/management/health
In summary, when installed with default settings, the health and version check for each module can be performed based on the information obtained from the screenshots above, as outlined in the following addresses:
Manager:
kubectl exec -it manager-7695978796-q78fx -n apinizer -- curl -X GET http://manager.apinizer.svc.cluster.local:8080/apinizer/management/health
curl -X GET http://<SERVER_IP>:8080/apinizer/management/health
kubectl exec -it manager-7695978796-q78fx -n apinizer -- curl -X GET http://manager.apinizer.svc.cluster.local:8080/apinizer/management/version
curl -X GET http://<SERVER_IP>:8080/apinizer/management/version
Worker:
kubectl exec -it manager-7695978796-q78fx -n apinizer -- curl -X GET http://worker-http-service.prod.svc.cluster.local:8091/apinizer/management/health
curl -X GET http://<SERVER_IP>:8091/apinizer/management/health
kubectl exec -it manager-7695978796-q78fx -n apinizer -- curl -X GET http://worker-http-service.prod.svc.cluster.local:8091/apinizer/management/version
curl -X GET http://<SERVER_IP>:8091/apinizer/management/version
Cache:
kubectl exec -it manager-7695978796-q78fx -n apinizer -- curl -X GET http://cache-http-service.prod.svc.cluster.local:8090/apinizer/management/health
kubectl exec -it manager-7695978796-q78fx -n apinizer -- curl -X GET http://cache-http-service.prod.svc.cluster.local:8090/apinizer/management/version
Integration:
kubectl exec -it manager-7695978796-q78fx -n apinizer -- curl -X GET http://integration-http-service.apinizer-integration.svc.cluster.local:8092/apinizer/management/health
curl -X GET http://<SERVER_IP>:8092/apinizer/management/health
kubectl exec -it manager-7695978796-q78fx -n apinizer -- curl -X GET http://integration-http-service.apinizer-integration.svc.cluster.local:8092/apinizer/management/version
curl -X GET http://<SERVER_IP>:8092/apinizer/management/version
Portal:
kubectl exec -it manager-7695978796-q78fx -n apinizer -- curl -X GET http://apinizer-portal-service.apinizer-portal.svc.cluster.local:8080/apinizer/management/health
curl -X GET http://<SERVER_IP>:8080/apinizer/management/health
kubectl exec -it manager-7695978796-q78fx -n apinizer -- curl -X GET http://apinizer-portal-service.apinizer-portal.svc.cluster.local:8080/apinizer/management/version
curl -X GET http://<SERVER_IP>:8080/apinizer/management/version