Customizing Instance Links

Give users links to common features of their apps

Spinnaker makes it easy to give users links to common features of their applications (logs, health, etc.), which are accessible from the instance details panel:

There are two basic approaches to customizing links: organization-wide links (links that apply to every instance managed by Spinnaker), and application-specific links (links that are common to every instance of your application).

At Netflix, we use a common base server, which adds a number of default endpoints to every running instance. These are configured in Deck’s settings.js file:

window.spinnakerSettings = {
  // ...
  defaultInstanceLinks: [
        {
            title: 'Logs',
            links: [
                { title: 'catalina.out', path: ':7000/Logs/catalina.out'},
                { title: 'Log File Archive', path: ':7000/Logs/all'},
                { title: 'Thread dumps', path: ':7000/Logs/threadDumps'},
                { title: 'Admin Proxy Info', path: ':7000/ProxyInfo'},
                { title: 'Admin Proxy Status', path: ':7000/ProxyStatus'},
                { title: 'GC Visualization', path: ':7000/GCVisualization'},
            ]
        },
        {
            title: 'Netflix Configuration',
            links: [
                { title: 'Properties Console', path: ':8088/props'},
                { title: 'Libraries Console', path: ':8088/libraries'},
                { title: 'Machine Readable Properties', path: ':8088/machineProperties'},
                { title: 'Manifest', path: '/manifest'},
            ]
        }
    ]
  // ...
};

When users create a new application, these links are available in each instance in Spinnaker with no additional input from the application owner.

These links are customizable via the application’s Config tab in Spinnaker. If configured in settings.js, the default links are displayed. Users can then customize the links for their particular application.

Links support templating based on the instance’s attributes by wrapping the value in two curly braces, e.g. {{ "{{id"}}}}. Common attributes available in templates are listed below.

Note: Templating only applies to the path portion of the link - the title must be a hard-coded value.

Most links will be endpoints on your running server. These will be resolved using the public IP address of the instance if available, falling back to the private IP address. If you’ve specified an instance port in the application attributes, that will be used to generate the link. If the link should point to a different port, the path should start with a colon, then the port.

If no instance port is configured for the application, port 80 will be used for links (unless the path starts with a colon).

Some example paths: An application configured with a default port of 9000, and an instance (id: ‘i-1234’) with an IP address of 104.156.81.74

pathresult
/helphttp://104.156.81.74:9000/help
:9001/adminhttp://104.156.81.74:9001/admin
https://my.company/trafficFrom?instance={{"{{id"}}}}https://my.company/trafficFrom?instance=i-1234
https://{{"{{publicIpAddress”}}}}:9090/secureAdminhttps://104.156.81.74:9090/secureAdmin

Available template fields

This is not a comprehensive list of fields - just the most common ones. Not all fields will be available for every instance, as some are VPC-only, and some depend on subnet, launch configuration, and other factors. Trial and error is a good way to figure out what’s going to work for your application.

AWS

namedescriptionexample
accountaccount owner of the instanceprod
availabilityZonezone where instance residesus-east-1a
cloudProvider“aws”“aws”
clientTokensee AWS Documentation(string)
clustercluster namemyapp-staging
idinstance IDi-12345678
imageIdID of the AMI running on this instanceami-123456
instanceIdsame as idi-12345678
instanceTypeAWS instance typem3.medium
ipAddressconvenience field for private IP address (internal subnets) or publicDnsName (external subnets)104.156.81.74
keyNameSee AWS Documentationmy-keypair-for-this-account
launchTimetimestamp of when instance launched1486146739000
privateDnsNameinternal DNS name associated by AWS to this instanceip-104-156-81-74.ec2.internal
privateIpAddressinternal IP address (within AWS)104.156.81.74
publicDnsNameexternal DNS name (for instances in external subnets only)ip-104-156-81-74.ec2.external
regionregion where instance residesus-east-1
serverGroupASG namemyapp-v002
subnetIdsubnet where instance residessubnet-1abcde2f
vpcIdvpc where instance residesvpc-1234567
zonealias of availabilityZoneus-east-1c

Google Compute Engine

namedescriptionexample
accountaccount owner of the instanceprod
availabilityZonezone where instance residesus-central1-f
cloudProvidercloud provider abbreviationgce
externalIpAddressexternal IP address104.156.81.74
idinstance idapp-stack-detail-v000-e20p
instanceTypeGCE instance typef1-micro
internalDnsNameinternal DNS name associated by GCE to the instanceapp-stack-detail-v000-e20p
internalIpAddressinternal IP address (within GCE)104.156.81.74
launchTimetimestamp of when instance launched1485801280421
networknetwork where instance residesdefault
regionregion where instance residesus-central1
serverGroupname of Spinnaker server group (GCE managed instance group) where instance residesapp-stack-detail-v000
subnetsubnet where instance residesdefault-b13fe48693219e49