{"__v":0,"_id":"5894e8e798ca870f00e3f219","category":{"__v":14,"_id":"55c6bec2b9aa4e0d0016c2c7","pages":["55c6bec3b9aa4e0d0016c2c9","55c8f451b79cb30d005b3e49","55ccea804906d12f001226e4","56c14ca9f203270d00d6c546","56c3bbeb2d97560d00e23ccf","56cce248ca43550b002814db","56cceaacd98d851d00c0c376","56cceefc723ad71d00cae46d","56ccef4e8fa8b01b00b8200e","56cd03e8723ad71d00cae4af","56cd03f2723ad71d00cae4b1","56cd061eca43550b0028151c","56cd07e4d98d851d00c0c3ba","56df35fbef8c1b320047c2d5"],"project":"55c6bec1b9aa4e0d0016c2c3","version":"55c6bec1b9aa4e0d0016c2c6","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-09T02:45:22.223Z","from_sync":false,"order":0,"slug":"documentation","title":"Guides"},"parentDoc":null,"project":"55c6bec1b9aa4e0d0016c2c3","user":"56f4597f2509363200e07f0f","version":{"__v":8,"_id":"55c6bec1b9aa4e0d0016c2c6","project":"55c6bec1b9aa4e0d0016c2c3","createdAt":"2015-08-09T02:45:21.683Z","releaseDate":"2015-08-09T02:45:21.683Z","categories":["55c6bec2b9aa4e0d0016c2c7","56c14bc5826df10d00e82230","56cceed8723ad71d00cae46c","56ccf29a431ada1f00e85aae","56ccf3c28fa8b01b00b82018","56ce1e6ee538330b0021ac5d","56f97e9a4c612020008f2eaf","5734fafd146eb82000597261"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-02-03T20:32:39.868Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"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:\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/2e08f82-Screen_Shot_2017-02-03_at_10.16.34_AM.png\",\n        \"Screen Shot 2017-02-03 at 10.16.34 AM.png\",\n        620,\n        1056,\n        \"#f8f9f7\"\n      ],\n      \"caption\": \"Common Netflix instance links\"\n    }\n  ]\n}\n[/block]\nThere are two basic approaches to customizing links: organization-wide links (i.e. links that apply to every instance managed by Spinnaker), and application-specific links (i.e. links that are common to every instance of your application).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Default Links\"\n}\n[/block]\nAt 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:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"window.spinnakerSettings = {\\n  // ...\\n  defaultInstanceLinks: [\\n        {\\n            title: 'Logs',\\n            links: [\\n                { title: 'catalina.out', path: ':7000/Logs/catalina.out'},\\n                { title: 'Log File Archive', path: ':7000/Logs/all'},\\n                { title: 'Thread dumps', path: ':7000/Logs/threadDumps'},\\n                { title: 'Admin Proxy Info', path: ':7000/ProxyInfo'},\\n                { title: 'Admin Proxy Status', path: ':7000/ProxyStatus'},\\n                { title: 'GC Visualization', path: ':7000/GCVisualization'},\\n            ]\\n        },\\n        {\\n            title: 'Netflix Configuration',\\n            links: [\\n                { title: 'Properties Console', path: ':8088/props'},\\n                { title: 'Libraries Console', path: ':8088/libraries'},\\n                { title: 'Machine Readable Properties', path: ':8088/machineProperties'},\\n                { title: 'Manifest', path: '/manifest'},\\n            ]\\n        }\\n    ]\\n  // ...\\n};\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nWhen users create a new application, these links are available in each instance in Spinnaker with no additional input from the application owner.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Customizing Application Links\"\n}\n[/block]\nThese 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.\n\nLinks 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 that templating only applies to the path portion of the link - the title must be a hard-coded value.\n\nMost 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.\n\nIf no instance port is configured for the application, port 80 will be used for links (unless the path starts with a colon).\n\nSome example paths:\n*An application configured with a default port of 9000, and an instance (id: 'i-1234') with an IP address of 104.156.81.74*\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"path\",\n    \"h-1\": \"result\",\n    \"0-0\": \"`/help`\",\n    \"0-1\": \"`http://104.156.81.74:9000/help`\",\n    \"1-0\": \"`:9001/admin`\",\n    \"1-1\": \"`http://104.156.81.74:9001/admin`\",\n    \"2-0\": \"`https://my.company/trafficFrom?instance={{id}}`\",\n    \"2-1\": \"`https://my.company/trafficFrom?instance=i-1234`\",\n    \"3-0\": \"`https://{{publicIpAddress}}:9090/secureAdmin`\",\n    \"3-1\": \"`https://104.156.81.74:9090/secureAdmin`\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Available Template Fields\"\n}\n[/block]\nThis 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.\n\n## AWS ##\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"name\",\n    \"h-1\": \"description\",\n    \"h-2\": \"example\",\n    \"0-0\": \"account\",\n    \"0-1\": \"account owner of the instance\",\n    \"0-2\": \"prod\",\n    \"1-0\": \"availabilityZone\",\n    \"1-1\": \"zone where instance resides\",\n    \"1-2\": \"us-east-1a\",\n    \"2-0\": \"cloudProvider\",\n    \"2-1\": \"\\\"aws\\\"\",\n    \"2-2\": \"\\\"aws\\\"\",\n    \"3-0\": \"clientToken\",\n    \"3-1\": \"see [AWS Documentation](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html#client-tokens)\",\n    \"3-2\": \"(string)\",\n    \"4-0\": \"id\",\n    \"4-1\": \"instance ID\",\n    \"4-2\": \"i-12345678\",\n    \"5-0\": \"imageId\",\n    \"5-1\": \"ID of the AMI running on this instance\",\n    \"5-2\": \"ami-123456\",\n    \"6-0\": \"instanceId\",\n    \"6-1\": \"same as id\",\n    \"6-2\": \"i-12345678\",\n    \"7-0\": \"instanceType\",\n    \"7-1\": \"AWS instance type\",\n    \"7-2\": \"m3.medium\",\n    \"8-0\": \"keyName\",\n    \"8-1\": \"See [AWS Documentation](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)\",\n    \"8-2\": \"my-keypair-for-this-account\",\n    \"9-0\": \"launchTime\",\n    \"9-1\": \"timestamp of when instance launched\",\n    \"9-2\": \"1486146739000\",\n    \"10-0\": \"privateDnsName\",\n    \"10-1\": \"internal DNS name associated by AWS to this instance\",\n    \"10-2\": \"ip-104-156-81-74.ec2.internal\",\n    \"11-0\": \"privateIpAddress\",\n    \"11-1\": \"internal IP address (within AWS)\",\n    \"11-2\": \"104.156.81.74\",\n    \"12-0\": \"publicDnsName\",\n    \"12-1\": \"external DNS name (for instances in external subnets only)\",\n    \"12-2\": \"ip-104-156-81-74.ec2.external\",\n    \"13-0\": \"region\",\n    \"13-1\": \"region where instance resides\",\n    \"13-2\": \"us-east-1\",\n    \"14-0\": \"serverGroup\",\n    \"14-1\": \"ASG name\",\n    \"14-2\": \"myapp-v002\",\n    \"15-0\": \"subnetId\",\n    \"15-1\": \"subnet where instance resides\",\n    \"15-2\": \"subnet-1abcde2f\",\n    \"16-0\": \"vpcId\",\n    \"16-1\": \"vpc where instance resides\",\n    \"16-2\": \"vpc-1234567\",\n    \"17-0\": \"zone\",\n    \"17-1\": \"alias of availabilityZone\",\n    \"17-2\": \"us-east-1c\"\n  },\n  \"cols\": 3,\n  \"rows\": 18\n}\n[/block]\n## Google Compute Engine ##\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"name\",\n    \"h-1\": \"description\",\n    \"h-2\": \"example\",\n    \"0-0\": \"account\",\n    \"0-1\": \"account owner of the instance\",\n    \"0-2\": \"prod\",\n    \"1-0\": \"availabilityZone\",\n    \"1-1\": \"zone where instance resides\",\n    \"1-2\": \"us-central1-f\",\n    \"2-0\": \"cloudProvider\",\n    \"2-1\": \"cloud provider abbreviation\",\n    \"2-2\": \"gce\",\n    \"3-0\": \"externalIpAddress\",\n    \"3-1\": \"external IP address\",\n    \"3-2\": \"104.156.81.74\",\n    \"4-0\": \"id\",\n    \"4-1\": \"instance id\",\n    \"4-2\": \"app-stack-detail-v000-e20p\",\n    \"5-0\": \"instanceType\",\n    \"5-1\": \"GCE instance type\",\n    \"5-2\": \"f1-micro\",\n    \"6-0\": \"internalDnsName\",\n    \"6-1\": \"internal DNS name associated by GCE to the instance\",\n    \"6-2\": \"app-stack-detail-v000-e20p\",\n    \"7-0\": \"internalIpAddress\",\n    \"7-1\": \"internal IP address (within GCE)\",\n    \"7-2\": \"104.156.81.74\",\n    \"8-0\": \"launchTime\",\n    \"8-1\": \"timestamp of when instance launched\",\n    \"10-0\": \"region\",\n    \"10-1\": \"region where instance resides\",\n    \"10-2\": \"us-central1\",\n    \"11-0\": \"serverGroup\",\n    \"11-1\": \"name of Spinnaker server group (GCE managed instance group) where instance resides\",\n    \"11-2\": \"app-stack-detail-v000\",\n    \"9-0\": \"network\",\n    \"9-1\": \"network where instance resides\",\n    \"9-2\": \"default\",\n    \"12-0\": \"subnet\",\n    \"12-1\": \"subnet where instance resides\",\n    \"12-2\": \"default-b13fe48693219e49\",\n    \"8-2\": \"1485801280421\"\n  },\n  \"cols\": 3,\n  \"rows\": 13\n}\n[/block]","excerpt":"This page describes how to add links to instances from the instance details panel","slug":"customizing-instance-links","type":"basic","title":"Customizing Instance Links"}

Customizing Instance Links

This page describes how to add links to instances from the instance details panel

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: [block:image] { "images": [ { "image": [ "https://files.readme.io/2e08f82-Screen_Shot_2017-02-03_at_10.16.34_AM.png", "Screen Shot 2017-02-03 at 10.16.34 AM.png", 620, 1056, "#f8f9f7" ], "caption": "Common Netflix instance links" } ] } [/block] There are two basic approaches to customizing links: organization-wide links (i.e. links that apply to every instance managed by Spinnaker), and application-specific links (i.e. links that are common to every instance of your application). [block:api-header] { "type": "basic", "title": "Default Links" } [/block] 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: [block:code] { "codes": [ { "code": "window.spinnakerSettings = {\n // ...\n defaultInstanceLinks: [\n {\n title: 'Logs',\n links: [\n { title: 'catalina.out', path: ':7000/Logs/catalina.out'},\n { title: 'Log File Archive', path: ':7000/Logs/all'},\n { title: 'Thread dumps', path: ':7000/Logs/threadDumps'},\n { title: 'Admin Proxy Info', path: ':7000/ProxyInfo'},\n { title: 'Admin Proxy Status', path: ':7000/ProxyStatus'},\n { title: 'GC Visualization', path: ':7000/GCVisualization'},\n ]\n },\n {\n title: 'Netflix Configuration',\n links: [\n { title: 'Properties Console', path: ':8088/props'},\n { title: 'Libraries Console', path: ':8088/libraries'},\n { title: 'Machine Readable Properties', path: ':8088/machineProperties'},\n { title: 'Manifest', path: '/manifest'},\n ]\n }\n ]\n // ...\n};", "language": "javascript" } ] } [/block] When users create a new application, these links are available in each instance in Spinnaker with no additional input from the application owner. [block:api-header] { "type": "basic", "title": "Customizing Application Links" } [/block] 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 that 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* [block:parameters] { "data": { "h-0": "path", "h-1": "result", "0-0": "`/help`", "0-1": "`http://104.156.81.74:9000/help`", "1-0": "`:9001/admin`", "1-1": "`http://104.156.81.74:9001/admin`", "2-0": "`https://my.company/trafficFrom?instance={{id}}`", "2-1": "`https://my.company/trafficFrom?instance=i-1234`", "3-0": "`https://{{publicIpAddress}}:9090/secureAdmin`", "3-1": "`https://104.156.81.74:9090/secureAdmin`" }, "cols": 2, "rows": 4 } [/block] [block:api-header] { "type": "basic", "title": "Available Template Fields" } [/block] 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 ## [block:parameters] { "data": { "h-0": "name", "h-1": "description", "h-2": "example", "0-0": "account", "0-1": "account owner of the instance", "0-2": "prod", "1-0": "availabilityZone", "1-1": "zone where instance resides", "1-2": "us-east-1a", "2-0": "cloudProvider", "2-1": "\"aws\"", "2-2": "\"aws\"", "3-0": "clientToken", "3-1": "see [AWS Documentation](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html#client-tokens)", "3-2": "(string)", "4-0": "id", "4-1": "instance ID", "4-2": "i-12345678", "5-0": "imageId", "5-1": "ID of the AMI running on this instance", "5-2": "ami-123456", "6-0": "instanceId", "6-1": "same as id", "6-2": "i-12345678", "7-0": "instanceType", "7-1": "AWS instance type", "7-2": "m3.medium", "8-0": "keyName", "8-1": "See [AWS Documentation](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)", "8-2": "my-keypair-for-this-account", "9-0": "launchTime", "9-1": "timestamp of when instance launched", "9-2": "1486146739000", "10-0": "privateDnsName", "10-1": "internal DNS name associated by AWS to this instance", "10-2": "ip-104-156-81-74.ec2.internal", "11-0": "privateIpAddress", "11-1": "internal IP address (within AWS)", "11-2": "104.156.81.74", "12-0": "publicDnsName", "12-1": "external DNS name (for instances in external subnets only)", "12-2": "ip-104-156-81-74.ec2.external", "13-0": "region", "13-1": "region where instance resides", "13-2": "us-east-1", "14-0": "serverGroup", "14-1": "ASG name", "14-2": "myapp-v002", "15-0": "subnetId", "15-1": "subnet where instance resides", "15-2": "subnet-1abcde2f", "16-0": "vpcId", "16-1": "vpc where instance resides", "16-2": "vpc-1234567", "17-0": "zone", "17-1": "alias of availabilityZone", "17-2": "us-east-1c" }, "cols": 3, "rows": 18 } [/block] ## Google Compute Engine ## [block:parameters] { "data": { "h-0": "name", "h-1": "description", "h-2": "example", "0-0": "account", "0-1": "account owner of the instance", "0-2": "prod", "1-0": "availabilityZone", "1-1": "zone where instance resides", "1-2": "us-central1-f", "2-0": "cloudProvider", "2-1": "cloud provider abbreviation", "2-2": "gce", "3-0": "externalIpAddress", "3-1": "external IP address", "3-2": "104.156.81.74", "4-0": "id", "4-1": "instance id", "4-2": "app-stack-detail-v000-e20p", "5-0": "instanceType", "5-1": "GCE instance type", "5-2": "f1-micro", "6-0": "internalDnsName", "6-1": "internal DNS name associated by GCE to the instance", "6-2": "app-stack-detail-v000-e20p", "7-0": "internalIpAddress", "7-1": "internal IP address (within GCE)", "7-2": "104.156.81.74", "8-0": "launchTime", "8-1": "timestamp of when instance launched", "10-0": "region", "10-1": "region where instance resides", "10-2": "us-central1", "11-0": "serverGroup", "11-1": "name of Spinnaker server group (GCE managed instance group) where instance resides", "11-2": "app-stack-detail-v000", "9-0": "network", "9-1": "network where instance resides", "9-2": "default", "12-0": "subnet", "12-1": "subnet where instance resides", "12-2": "default-b13fe48693219e49", "8-2": "1485801280421" }, "cols": 3, "rows": 13 } [/block]