Visit Support

Configuring Cloud Native Compiler Host and Port

Table of Contents
Need help?
Schedule a consultation with an Azul performance expert.
Contact Us
Talk about OpenJDK?
Discuss with the community on the Foojay Forum.
Go to Forum

As a Cloud Native Compiler administrator, you must provide Cloud Native Compiler users the host and ports for connecting to the Cloud Native Compiler service. Customers should use the host and port name in the CNCHost JVM parameter.

Determining the Cloud Native Compiler Endpoint

Use the IP address of the Cloud Native Compiler gateway service as the connection endpoint for your JVMs.

Using an External Load Balancer

It is strongly recommended to use CNC with an external load balancer. If you correctly defined the load-balancer in values-override.yaml as described in Installing Cloud Native Compiler, you can discover the external IP of the service using the following command:

$ kubectl describe service gateway -n compiler | grep 'LoadBalancer Ingress:' LoadBalancer Ingress:

JVM customers then connect using the following command:

java -jar my-app.jar

Connecting Without an External Load Balancer

If you did not set up an external load balancer, you can find the endpoint using the following steps:

  1. Run the following command:

    kubectl -n compiler get services
  2. Look for the gateway service and note the ports corresponding to port 50051 inside the container. This is the port to use for connecting VMs to this Cloud Native Compiler cluster.

    service/gateway NodePort <none> 8080:31951/TCP,50051:30926/TCP 52d

    In this example the ports is 31951.

  3. Run the kubectl get nodes command and note the IP address or name of any node.

  4. Concatenate node IP with service ports to get something like Do not prefix it with http://.

  5. JVM customers set -XX:CNCHost=host:port flag to the port mapped to 50051.

    java -XX:CNCHost= -jar my-app.jar

Specifying a Custom Compiler Engine Upload Port

Cloud Native Compiler uses compiler engines to provide instructions for working with a specific version of the JVM. These compiler engines are not shipped with CNC. When attempting to use CNC for compilation, the JVM checks if the right compiler engine is present and, if not, automatically uploads it to CNC.

If your CNC service is using default 8080 HTML ports, or you are fronting the CNC service with a load balancer, then there is nothing the user needs to do to configure uploads correctly. If you are connecting without a loadbalancer and are not using the default 8080 ports, follow the process described above to provide the JVM user with the host and port mapped to 8080. The JVM user must specify this host/port in the -XX:CNCEngineUploadAddress=host:port. In the above example, the host/port combination is