-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade of the docker package to typescript #150
Comments
The template-starter project uses |
Upgrade would need to be mindful of the issues described in this gist concerning the different responses from jolokia. |
@phantomjinx @grgrzybek I have another idea on the task. I don't think the current Nginx + NJS architecture is scalable in several ways:
What I propose here instead is to migrate the hawtio-online architecture to Nginx + Node.js (two containers in one pod).
(Note a single pod can have multiple containers in K8s. https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/) This is actually a common architecture in Nginx and Node.js communities. The benefits of the new architecture:
|
If I understand correctly, the node.js container in common pod would run express.js server with some endpoints implemented as express.js middleware, right? |
Yes, the Node.js container would provide some REST endpoints for Nginx, which can be run/tested outside of K8s. That doesn't exclude choosing other web servers such as Hono instead of Express.js. |
Not so much outside of k8s as we still need the responses from the k8s cluster to determine the url of the jolokiaAgent. The njs logic to be replaced is here. The There is, though, now an additional endpoint in the njs that we need to take account of:
For this to be pushed down to the nodejs container as well, will require the /master endpoint to be pushed down too. As the communication, I think, will only be 1-way (nginx -> nodejs)? Incidentally, this will mean that there will be 2 images for hawtio-online rather than one since each container in the pod will have their own image. |
The nginx.js njs module script is written as native javascript according to the unique standards of the njs module framework.
Convert the script to typescript to enforce greater typing for improved maintainability and to conform with the rest of the project.
This can be achieved using the njs template-starter project.
A POC branch has already been implemented here.
The text was updated successfully, but these errors were encountered: