Skip to content

route_registrar job from routing/0.182.0

Used for registering routes

Github source: 8fc5ec0 or master branch

Properties

host

(string, optional) By default, route_registrar will detect the IP of the VM and use it, in combination with port as the backend destination for each uri being registered. This property enables overriding the destination hostname or IP.

Example
192.168.60.25

nats

machines

IPs of each NATS cluster member

Example
|+
  - 192.168.50.123
  - 192.168.52.123

password

Password for NATS authentication

Example
natSpa55w0rd

port

TCP port of NATS servers

Example
4222

user

User name for NATS authentication

Example
nats

route_registrar

routes

(required, array of objects): Routes that will be registered

route object name (required, string): Human-readable reference for the route uris (required, array): When Gorouter receives a request that matches one of these URIs, it will forward them to the IP of the host on which route_registrar runs, and either port or tls_port. port (required, integer): Either port or tls_port are required; if both are provided, Gorouter will prefer tls_port. Requests for associated URIs will be forwarded unencypted by the router to this port. The IP is determined automatically from the host on which route-registrar is run. tls_port (required, integer): Either port or tls_port are required; if both are provided, Gorouter will prefer tls_port. Requests for associated URIs will be forwarded over TLS by the router to this port. The IP is determined automatically from the host on which route-registrar is run. server_cert_domain_san (conditional, string): Required if tls_port is present. Gorouter will validate that the TLS certificate presented by the destination host contains this as a Subject Alternative Name (SAN). registration_interval (required, string): Interval between heartbeated route registrations (e.g. 10s). It must parse to a positive time duration i.e. “-5s” is not permitted. tags (optional, array of objects): Arbitrary key-value pairs emitted with metrics to support filtering of metrics prepend_instance_index (optional, boolean): When set to true the values in uris will be prepended with the instance index. e.g. ‘some-uri.system-domain.com’ will become ‘0-some-uri.system-domain.com’ on the instance with index 0, and ‘2-some-url.system-domain.com’ on the instance with index 2. When this value is enabled, each instance will register its own, unique, set of uris. To additionally continue to register these original uris, create another route with the same uris and set ‘prepend_instance_index’ to false (or omit the key entirely). health_check (optional, object): Script executed on frequency of registration_interval. If healthcheck script exits with success, route registration heartbeat is sent. If script exits with error, the route is unregistered.

health_check object name (required, string): Human-readable reference for the healthcheck script_path (required, string): Path to script that will be run periodically to determine service health timeout (optional, string): The healthcheck script must exit within this timeout, otherwise the script is terminated with SIGKILL and the route is unregistered. Value is a string (e.g. “10s”) and must parse to a positive time duration i.e. “-5s” is not permitted. Must be less than the value of registration_interval. Default: Half of the value of registration_interval

Example
|+
  - name: my-service
    uris:
      - my-service.system-domain.com
      - *.my-service.system-domain.com
    port: 12345
    registration_interval: 20s
    tags:
      component: my-service
      env: production
    health_check:
      name: my-service-health_check
      script_path: /path/to/script
      timeout: 5s
  - name: my-tls-endpoint
    tls_port: 12346
    server_cert_domain_san: "my-tls-endpoint.internal.com"
    uris:
      - my-service.system-domain.com
  - name: my-debug-endpoint
    uris:
      - my-service.system-domain.com/debug
    port: 12346
  - name: cf-mysql-proxy-api-per-instance
    uris:
    - proxy-cf-mysql.system.domain
    port: 8080
    prepend_instance_index: true
  - name: cf-mysql-proxy-api
    uris:
    - proxy-cf-mysql.system.domain
    port: 8081

Templates

Templates are rendered and placed onto corresponding instances during the deployment process. This job's templates will be placed into /var/vcap/jobs/route_registrar/ directory (learn more).

  • config/bpm.yml (from bpm.yml.erb)
  • config/registrar_settings.json (from registrar_settings.json.erb)

Packages

Packages are compiled and placed onto corresponding instances during the deployment process. Packages will be placed into /var/vcap/packages/ directory.