{"id":384,"date":"2018-10-16T16:08:47","date_gmt":"2018-10-16T16:08:47","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw93\/?p=384"},"modified":"2018-10-17T09:02:53","modified_gmt":"2018-10-17T09:02:53","slug":"flexible-software-deployment-patterns-with-ingressroute","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw93\/index.php\/2018\/10\/16\/flexible-software-deployment-patterns-with-ingressroute\/","title":{"rendered":"Flexible software deployment patterns with IngressRoute"},"content":{"rendered":"<p>This is the third post in a series highlighting some of the exciting new features released in <a href=\"https:\/\/blog.heptio.com\/introducing-heptio-contour-0-6-ecaa5ee6a67d\" target=\"_blank\" rel=\"noopener\">Heptio Contour version 0.6<\/a>. If you missed out on those, start with <a href=\"https:\/\/blog.heptio.com\/introducing-heptio-contour-0-6-ecaa5ee6a67d\" target=\"_blank\" rel=\"noopener\">Introducing Heptio Contour 0.6<\/a> and <a href=\"https:\/\/blog.heptio.com\/improving-the-multi-team-kubernetes-ingress-experience-with-heptio-contour-0-6-55ae0c0cadef\" target=\"_blank\" rel=\"noopener\">Improving the multi-team Kubernetes ingress experience with Heptio Contour 0.6<\/a>.<\/p>\n<p>One of the improvements that we added to IngressRoute is the ability to route traffic to multiple Services for a given path as well as apply weights to those upstream Services. This seemingly small addition allows users to implement some simple, yet very powerful deployment patterns.<\/p>\n<h3>Canary Deployments<\/h3>\n<p>One way to roll out a new version of an application is to utilize a canary deployment. In this model, first deploy the change to a small subset of users to gather information on how the new version is responding. Since only a small set of traffic is targeted, the impact overall will not be as apparent in the event of a failure of the new version. The amount of traffic sent to the canary version is determined by the weight configured, a higher proportion of weight means more traffic will be sent.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*Tfa1v2uJNmxOi4aMeWP57g.png\" \/><\/p>\n<p>Without IngressRoute, the only way to implement this would be to have a Service select pods from two different deployments, however, traffic would be limited by the number of replicas of each deployment and it would be difficult to manage. Additionally, the standard Kubernetes Ingress object does not allow for multiple Services per virtual host and does not support configurable weighting.<\/p>\n<p>We took these requirements into account as we designed the IngressRoute specification and added the ability to define multiple Services per Route as well as configurable weighting. By manipulating weights across the Services, the entire rollout can be managed easily until the new version of the application is receiving 100% of the traffic.<\/p>\n<p>Following is a diagram which visualizes how a canary deployment is rolled out:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/0*Gw8318G-sB661Sqg\" \/>apiVersion: contour.heptio.com\/v1beta1<br \/>\nkind: IngressRoute<br \/>\nmetadata:<br \/>\nname: production-webapp<br \/>\nspec:<br \/>\nvirtualhost:<br \/>\nfqdn: foo.com<br \/>\nroutes:<br \/>\n&#8211; match: \/<br \/>\nservices:<br \/>\n&#8211; name: webapp-v1.0.0<br \/>\nport: 80<br \/>\nweight: 90<br \/>\n&#8211; name: webapp-v1.1.0<br \/>\nport: 80<br \/>\nweight: 10<\/p>\n<p>In this example, 90% of the requests to <em>foo.com<\/em> are routed to the Service <em>webapp-v1.0.0<\/em> and 10% are routed to <em>webapp-v1.1.0<\/em>. It\u2019s important to note that modifying the weights triggers an <em>immediate<\/em> shift of traffic pattern in Envoy (via Contour).<\/p>\n<h3>Other Use-Cases<\/h3>\n<p><a href=\"https:\/\/github.com\/heptio\/gimbal\" target=\"_blank\" rel=\"noopener\">Heptio Gimbal<\/a> is an open source initiative that builds on Heptio Contour with the goal of unifying and managing internet traffic on hybrid environments consisting of multiple Kubernetes clusters running on cloud providers and on traditional data centers.<\/p>\n<p>Gimbal allows users to utilize multi-service IngressRoutes to route traffic across clusters. You can read more about Gimbal from our <a href=\"https:\/\/blog.heptio.com\/introducing-heptio-gimbal-bridging-cloud-native-and-traditional-infrastructure-9d6224bece5a\" target=\"_blank\" rel=\"noopener\">launch blog post<\/a>.<\/p>\n<h3>What\u2019s next?<\/h3>\n<p>In this post, we have explored how traffic can be routed to multiple weighted Services within a Kubernetes cluster utilizing IngressRoute. This is one of the many exciting features available in the latest version of <a href=\"https:\/\/github.com\/heptio\/contour\/releases\/tag\/v0.6.0\" target=\"_blank\" rel=\"noopener\">Heptio Contour<\/a>.<\/p>\n<p>In future posts, we will explore other patterns enabled by the IngressRoute, including blue\/green deployments and load balancing strategies. If you have any questions or are interested in learning more, reach us via the #contour channel on the <a href=\"http:\/\/slack.k8s.io\/\" target=\"_blank\" rel=\"noopener\">Kubernetes community Slack<\/a> or follow us on <a href=\"https:\/\/twitter.com\/heptio\" target=\"_blank\" rel=\"noopener\">Twitter<\/a>.<\/p>\n<p><a href=\"https:\/\/blog.heptio.com\/flexible-software-deployment-patterns-with-ingressroute-a49a43253992?source=rss----7d24bed16a19---4\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the third post in a series highlighting some of the exciting new features released in Heptio Contour version 0.6. If you missed out on those, start with Introducing Heptio Contour 0.6 and Improving the multi-team Kubernetes ingress experience with Heptio Contour 0.6. One of the improvements that we added to IngressRoute is the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw93\/index.php\/2018\/10\/16\/flexible-software-deployment-patterns-with-ingressroute\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Flexible software deployment patterns with IngressRoute&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-384","post","type-post","status-publish","format-standard","hentry","category-kubernetes"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/comments?post=384"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/384\/revisions"}],"predecessor-version":[{"id":530,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/384\/revisions\/530"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/media?parent=384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/categories?post=384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/tags?post=384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}