Hello Config World Helidon
This example is a Helidon-based service that returns a “HelloConfig World” response when invoked. The application configuration uses a Kubernetes ConfigMap, instead of the default, microprofile properties file.
Before you begin
Install Verrazzano by following the installation instructions.
NOTE: The Hello World Helidon configuration example application deployment files are contained in the Verrazzano project located at <VERRAZZANO_HOME>/examples/helidon-config, where <VERRAZZANO_HOME> is the root of the Verrazzano project.
Deploy the Hello Config World Helidon application
-
Create a namespace for the application and add a label identifying the namespace as managed by Verrazzano.
$ kubectl create namespace helidon-config $ kubectl label namespace helidon-config verrazzano-managed=true istio-injection=enabled -
To deploy the application, apply the
helidon-configOAM resources.$ kubectl apply -f https://raw.githubusercontent.com/verrazzano/verrazzano/v1.0.4/examples/helidon-config/helidon-config-comp.yaml $ kubectl apply -f https://raw.githubusercontent.com/verrazzano/verrazzano/v1.0.4/examples/helidon-config/helidon-config-app.yaml -
Wait for the application to be ready.
$ kubectl wait \ --for=condition=Ready pods \ --all -n helidon-config \ --timeout=300s
Explore the application
The Hello World Helidon configuration example implements a REST API endpoint, /config, which returns a message {"message":"HelloConfig World!"} when invoked.
NOTE: The following instructions assume that you are using a Kubernetes environment such as OKE. Other environments or deployments may require alternative mechanisms for retrieving addresses, ports, and such.
Follow these steps to test the endpoints:
-
Get the generated host name for the application.
$ HOST=$(kubectl get gateway helidon-config-helidon-config-appconf-gw \ -n helidon-config \ -o jsonpath={.spec.servers[0].hosts[0]}) $ echo $HOST helidon-config-appconf.helidon-config.11.22.33.44.nip.io -
Get the
EXTERNAL_IPaddress of theistio-ingressgatewayservice.$ ADDRESS=$(kubectl get service \ -n istio-system istio-ingressgateway \ -o jsonpath='{.status.loadBalancer.ingress[0].ip}') $ echo $ADDRESS 11.22.33.44 -
Access the application:
-
Using the command line
$ curl -sk \ -X GET \ https://${HOST}/config \ --resolve ${HOST}:443:${ADDRESS} {"message":"HelloConfig World!"}If you are using
nip.io, then you do not need to include--resolve. -
Local testing with a browser
Temporarily, modify the
/etc/hostsfile (on Mac or Linux) orc:\Windows\System32\Drivers\etc\hostsfile (on Windows 10), to add an entry mapping the host name to the ingress gateway’sEXTERNAL-IPaddress. For example:11.22.33.44 helidon-config.example.comThen you can access the application in a browser at
https://<host>/config. -
Using your own DNS name
- Point your own DNS name to the ingress gateway’s
EXTERNAL-IPaddress. - In this case, you would need to edit the
helidon-config-app.yamlfile to use the appropriate value under thehostssection (such asyourhost.your.domain), before deploying thehelidon-configapplication. - Then, you can use a browser to access the application at
https://<yourhost.your.domain>/config.
- Point your own DNS name to the ingress gateway’s
-
-
A variety of endpoints associated with the deployed application, are available to further explore the logs, metrics, and such.
Accessing them may require the following:
-
Run this command to get the password that was generated for the telemetry components:
$ kubectl get secret \ --namespace verrazzano-system verrazzano \ -o jsonpath={.data.password} | base64 \ --decode; echoThe associated user name is
verrazzano. -
You will have to accept the certificates associated with the endpoints.
You can retrieve the list of available ingresses with following command:
$ kubectl get ing -n verrazzano-system NAME CLASS HOSTS ADDRESS PORTS AGE verrazzano-console-ingress <none> verrazzano.default.140.238.94.217.nip.io 140.238.94.217 80, 443 7d2h vmi-system-api <none> api.vmi.system.default.140.238.94.217.nip.io 140.238.94.217 80, 443 7d2h vmi-system-es-ingest <none> elasticsearch.vmi.system.default.140.238.94.217.nip.io 140.238.94.217 80, 443 7d2h vmi-system-grafana <none> grafana.vmi.system.default.140.238.94.217.nip.io 140.238.94.217 80, 443 7d2h vmi-system-kibana <none> kibana.vmi.system.default.140.238.94.217.nip.io 140.238.94.217 80, 443 7d2h vmi-system-prometheus <none> prometheus.vmi.system.default.140.238.94.217.nip.io 140.238.94.217 80, 443 7d2hUsing the ingress host information, some of the endpoints available are:
Description Address Credentials Kibana https://[vmi-system-kibana ingress host]verrazzano/telemetry-passwordGrafana https://[vmi-system-grafana ingress host]verrazzano/telemetry-passwordPrometheus https://[vmi-system-prometheus ingress host]verrazzano/telemetry-password
-
Troubleshooting
-
Verify that the application configuration, domain, and ingress trait all exist.
$ kubectl get ApplicationConfiguration -n helidon-config $ kubectl get IngressTrait -n helidon-config -
Verify that the
helidon-configservice pods are successfully created and transition to theREADYstate. Note that this may take a few minutes and that you may see some of the services terminate and restart.$ kubectl get pods -n helidon-config NAME READY STATUS RESTARTS AGE helidon-config-deployment-676d97c7d4-wkrj2 3/3 Running 0 5m39s
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.