{"id":3482,"date":"2018-04-06T09:33:58","date_gmt":"2018-04-06T01:33:58","guid":{"rendered":"http:\/\/switch.linesno.com\/?p=3482"},"modified":"2018-04-06T09:39:42","modified_gmt":"2018-04-06T01:39:42","slug":"exposing-spinnaker-to-end-users","status":"publish","type":"post","link":"http:\/\/switch.linesno.com\/?p=3482","title":{"rendered":"Exposing Spinnaker to End Users"},"content":{"rendered":"<p id=\"8801\" class=\"graf graf--p graf-after--h3\">One of the things we are commonly asked in the\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/join.spinnaker.io\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/join.spinnaker.io\">Spinnaker chat room<\/a>\u00a0is \u201cHow do I open\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.spinnaker.io\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.spinnaker.io\">Spinnaker<\/a>\u00a0up to end users?\u201d<\/p>\n<p id=\"498b\" class=\"graf graf--p graf-after--p\">The answer depends on how you deploy Spinnaker\u200a\u2014\u200awith a\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.spinnaker.io\/setup\/install\/environment\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.spinnaker.io\/setup\/install\/environment\/\">Local or Distributed environment<\/a>.<\/p>\n<p id=\"227d\" class=\"graf graf--p graf-after--p\">This post focuses on a Local environment. To prevent inadvertently exposing your cloud infrastructure to the whole world, Halyard installs Spinnaker in its most locked-down form. This means all services only bind to\u00a0<code class=\"markup--code markup--p-code\">localhost<\/code>\u00a0, which only accepts connections from inside the same server.<\/p>\n<p id=\"054d\" class=\"graf graf--p graf-after--p\">On the other hand, Distributed environment services bind to\u00a0<code class=\"markup--code markup--p-code\">0.0.0.0<\/code>\u00a0, which allows them to receive requests from services running on different hosts. This is essential to scaling Spinnaker to large enterprise deployments as a high-availability service. The diagram below outlines Spinnaker\u2019s\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.spinnaker.io\/reference\/architecture\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.spinnaker.io\/reference\/architecture\/\">micro-service architecture<\/a>.<\/p>\n<figure id=\"0f57\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*aXcS3U9F5hNf5R4xcWrhVQ.png\" data-width=\"760\" data-height=\"734\" data-action=\"zoom\" data-action-value=\"1*aXcS3U9F5hNf5R4xcWrhVQ.png\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"71\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"\/2018\/04\/be8426955a665ac9adbde766f9e4cd11-4.png\" data-src=\"\/2018\/04\/be8426955a665ac9adbde766f9e4cd11-4.png\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">All Spinnaker micro-services can run on a single host in a Local environment, or each on its own host in a Distributed environment.<\/figcaption><\/figure>\n<h3 id=\"d640\" class=\"graf graf--h3 graf-after--figure\">Starting Point<\/h3>\n<p id=\"983a\" class=\"graf graf--p graf-after--h3\">Because we\u2019re focusing on the Local environment, we must first have a VM with all of Spinnaker installed. The \u201c<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.spinnaker.io\/setup\/quickstart\/halyard-gce\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.spinnaker.io\/setup\/quickstart\/halyard-gce\/\">Halyard on GCE Quickstart<\/a>\u201d guide is a great way to get a Halyard-enabled instance up and running.<\/p>\n<h3 id=\"8acc\" class=\"graf graf--h3 graf-after--p\">(Semi-Optional) Load Balancer and DNS\u00a0Entries<\/h3>\n<p id=\"2e83\" class=\"graf graf--p graf-after--h3\">It is generally a good practice to front a service with its own load balancer, so that you can change the backing implementation (say, when a\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.spinnaker.io\/community\/releases\/versions\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.spinnaker.io\/community\/releases\/versions\/\">new version<\/a>\u00a0of Spinnaker is released) without changing the way clients connect to it. A load balancer will have a (usually static) IP address that we can bind to a DNS name. More details on configuring static IPs and connecting them to DNS can be found\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.spinnaker.io\/setup\/quickstart\/halyard-gke-public\/#part-2-creating-public-spinnaker-endpoints\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.spinnaker.io\/setup\/quickstart\/halyard-gke-public\/#part-2-creating-public-spinnaker-endpoints\">here<\/a>.<\/p>\n<p id=\"db9c\" class=\"graf graf--p graf-after--p\">This step is only semi-optional because most users are going to want to hook up an authentication mechanism like OAuth 2.0, which doesn\u2019t work with raw IP addresses on some OAuth providers.<\/p>\n<h3 id=\"767d\" class=\"graf graf--h3 graf-after--p\">Opening Gate and\u00a0Deck<\/h3>\n<p id=\"50d6\" class=\"graf graf--p graf-after--h3\">With DNS entries configured, we can now open Gate and Deck for external access. To do this for a Local environment, we need to hook into the\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.spinnaker.io\/reference\/halyard\/custom\/#custom-service-settings\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.spinnaker.io\/reference\/halyard\/custom\/#custom-service-settings\">custom service settings<\/a>\u00a0feature of Halyard.<\/p>\n<p id=\"1f05\" class=\"graf graf--p graf-after--p\">We\u2019ll specify the\u00a0<code class=\"markup--code markup--p-code\">0.0.0.0<\/code>\u00a0host in both\u00a0<code class=\"markup--code markup--p-code\">gate.yml<\/code>\u00a0and\u00a0<code class=\"markup--code markup--p-code\">deck.yml<\/code>\u00a0in our\u00a0<code class=\"markup--code markup--p-code\">default<\/code>\u00a0Halyard deployment with this command:<\/p>\n<pre id=\"0073\" class=\"graf graf--pre graf-after--p\">echo \"host: 0.0.0.0\" | tee \\\r\n    ~\/.hal\/default\/service-settings\/gate.yml \\\r\n    ~\/.hal\/default\/service-settings\/deck.yml<\/pre>\n<pre id=\"6a99\" class=\"graf graf--pre graf-after--pre\">sudo hal deploy apply<\/pre>\n<p id=\"58f4\" class=\"graf graf--p graf-after--pre\">You can test this out by navigating to the instance\u2019s public IP address on port\u00a0<code class=\"markup--code markup--p-code\">9000<\/code>\u00a0in your browser.<\/p>\n<blockquote id=\"81fb\" class=\"graf graf--blockquote graf-after--p\"><p>Note: You may need to take further action by editing your Security Groups in order to access your instance. For example, a Google Compute Engine instance needs a firewall rule that allows ports 8084 and 9000 through. You can create these with the following commands:<\/p><\/blockquote>\n<pre id=\"fd25\" class=\"graf graf--pre graf-after--blockquote\">INSTANCE= # put your instance's name here\r\nTAGNAME=blogpost<\/pre>\n<pre id=\"cfa9\" class=\"graf graf--pre graf-after--pre\">gcloud compute firewall-rules create $TAGNAME-1 \\\r\n    --allow=tcp:8084,tcp:9000 \\\r\n    --target-tags $TAGNAME<\/pre>\n<pre id=\"faa4\" class=\"graf graf--pre graf-after--pre\">gcloud compute instances add-tags $INSTANCE --tags=$TAGNAME<\/pre>\n<h4 id=\"117c\" class=\"graf graf--h4 graf-after--pre\">Map to your DNS\u00a0address<\/h4>\n<p id=\"1f2a\" class=\"graf graf--p graf-after--h4\">Gate and Deck are now listening for all connections, and the security groups are permitting access to ports 8084 and 9000. The last thing is configuring Gate and Deck to talk to each other over their DNS names instead of IP address. This is accomplished with the following commands:<\/p>\n<pre id=\"9e01\" class=\"graf graf--pre graf-after--p\"><code class=\"markup--code markup--pre-code\">hal config security ui edit \\\r\n    --override-base-url http:\/\/spinnaker.mydomain.org:9000\r\n\r\nhal config security api edit \\\r\n    --override-base-url http:\/\/spinnaker.mydomain.org:8084<\/code><\/pre>\n<pre id=\"1cc9\" class=\"graf graf--pre graf-after--pre\">hal deploy apply<\/pre>\n<h3 id=\"d489\" class=\"graf graf--h3 graf-after--pre\">Test it\u00a0out<\/h3>\n<p id=\"9627\" class=\"graf graf--p graf-after--h3\">Your Spinnaker instance should now be available and mapped to your DNS entry:<\/p>\n<figure id=\"41bf\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*YsbzvHpM725OdUKlZ-g28Q.png\" data-width=\"856\" data-height=\"299\" data-action=\"zoom\" data-action-value=\"1*YsbzvHpM725OdUKlZ-g28Q.png\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"25\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"\/2018\/04\/42b4e3ce130482097053bd87590bc430-4.png\" data-src=\"\/2018\/04\/42b4e3ce130482097053bd87590bc430-4.png\" \/><\/div>\n<\/div>\n<\/figure>\n<p id=\"55f8\" class=\"graf graf--p graf-after--figure graf--trailing\">Now that Spinnaker is exposed for your end users, you should explore our different authentication and authorization mechanisms in the\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.spinnaker.io\/setup\/security\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.spinnaker.io\/setup\/security\/\">Security<\/a>documentation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the things we are commonly asked in the\u00a0Spinnake [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3486,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86,71],"tags":[],"class_list":["post-3482","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-service","category-phone"],"_links":{"self":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3482"}],"version-history":[{"count":5,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3482\/revisions"}],"predecessor-version":[{"id":3497,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3482\/revisions\/3497"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/media\/3486"}],"wp:attachment":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3482"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}