Add a Custom Bosh Alias
Assumptions
- You have 2 my-http-server instances deployed (see the story Life Without Route Registrar for setup)
Recorded values from previous stories
BOSH_DNS_IP=<value>
NON_BOSH_DNS_IP=<value>
What
In this story you are going to add your own fun alias for your go HTTP server.
How
đź“ť Add your own alias
-
Update your manifest to include a Bosh DNS alias (copy lines with
# < ---
and remove the# < --- .*
). This alias could be added for any job on the instance group.instance_groups: - azs: - z1 instances: 2 jobs: - name: route_registrar properties: { redacted for brevity } release: routing provides: # < ------------ Add this block to add a Bosh DNS alias my_custom_link: # < ------------ aliases: # < ------------ - domain: "meow.meow" # < ------------ Make the domain anything you want :D health_filter: "healthy" # < ------------ Record the domain you choose as HTTP_SERVER_ALIAS custom_provider_definitions: # < ------------ - name: my_custom_link # < ------------ type: my_custom_link_type # < ------------ name: my-http-server # remaining yaml redacted for brevity
-
Redeploy
-
Make sure the go server is running on both of your my-http-server VMs. See the story Life Without Route Registrar for help with this step.
-
Bosh ssh onto any machine except the my-http-server VM.
-
Wait a couple minutes…
-
Try to access your new URL! Success!
$ curl HTTP_SERVER_ALIAS:9994 Hello from machine with mac address 42:01:0a:00:01:16
-
Try to access your new URL from your local machine.
$ curl HTTP_SERVER_ALIAS:9994 curl: (6) Could not resolve host: meow.meow
Expected Results
Your new alias should only be accessible within Cloud Foundry and not from your local machine.