{"id":4332,"date":"2018-12-31T14:14:16","date_gmt":"2018-12-31T14:14:16","guid":{"rendered":"http:\/\/howk.de\/w1\/blog-dynamic-ingress-in-kubernetes\/"},"modified":"2018-12-31T14:14:16","modified_gmt":"2018-12-31T14:14:16","slug":"blog-dynamic-ingress-in-kubernetes","status":"publish","type":"post","link":"https:\/\/howk.de\/?p=4332","title":{"rendered":"Blog: Dynamic Ingress in Kubernetes"},"content":{"rendered":"<p><strong>Author<\/strong>: Richard Li (Datawire)<\/p>\n<p>Kubernetes makes it easy to deploy applications that consist of many microservices, but one of the key challenges with this type of architecture is dynamically routing ingress traffic to each of these services.  One approach is <a href=\"https:\/\/www.getambassador.io\" target=\"_blank\">Ambassador<\/a>, a Kubernetes-native open source API Gateway built on the <a href=\"https:\/\/www.envoyproxy.io\" target=\"_blank\">Envoy Proxy<\/a>. Ambassador is designed for dynamic environment where services may come and go frequently.<\/p>\n<p>Ambassador is configured using Kubernetes annotations. Annotations are used to configure specific mappings from a given Kubernetes service to a particular URL. A mapping can include a number of annotations for configuring a route. Examples include rate limiting, protocol, cross-origin request sharing, traffic shadowing, and routing rules.<\/p>\n<h2 id=\"a-basic-ambassador-example\">A Basic Ambassador Example<\/h2>\n<p>Ambassador is typically installed as a Kubernetes deployment, and is also available as a Helm chart. To configure Ambassador, create a Kubernetes service with the Ambassador annotations. Here is an example that configures Ambassador to route requests to \/httpbin\/ to the public httpbin.org service:<\/p>\n<pre><code>apiVersion: v1\nkind: Service\nmetadata:\n  name: httpbin\n  annotations:\n    getambassador.io\/config: |\n      ---\n      apiVersion: ambassador\/v0\n      kind:  Mapping\n      name:  httpbin_mapping\n      prefix: \/httpbin\/\n      service: httpbin.org:80\n      host_rewrite: httpbin.org\nspec:\n  type: ClusterIP\n  ports:\n    - port: 80\n<\/code><\/pre>\n<p>A mapping object is created with a prefix of \/httpbin\/ and a service name of httpbin.org. The host_rewrite annotation specifies that the HTTP <code>host<\/code> header should be set to httpbin.org.<\/p>\n<h2 id=\"kubeflow\">Kubeflow<\/h2>\n<p><a href=\"https:\/\/github.com\/kubeflow\/kubeflow\" target=\"_blank\">Kubeflow<\/a> provides a simple way to easily deploy machine learning infrastructure on Kubernetes. The Kubeflow team needed a proxy that provided a central point of authentication and routing to the wide range of services used in Kubeflow, many of which are ephemeral in nature.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/kubernetes.io\/images\/blog\/2018-06-01-dynamic-ingress-kubernetes\/kubeflow.png\" alt=\"kubeflow\" \/><br \/>\n<center><i>Kubeflow architecture, pre-Ambassador<\/center><\/i><\/p>\n<h2 id=\"service-configuration\">Service configuration<\/h2>\n<p>With Ambassador, Kubeflow can use a distributed model for configuration. Instead of a central configuration file, Ambassador allows each service to configure its route in Ambassador via Kubernetes annotations. Here is a simplified example configuration:<\/p>\n<pre><code>---\napiVersion: ambassador\/v0\nkind:  Mapping\nname: tfserving-mapping-test-post\nprefix: \/models\/test\/\nrewrite: \/model\/test\/:predict\nmethod: POST\nservice: test.kubeflow:8000\n<\/code><\/pre>\n<p>In this example, the \u201ctest\u201d service uses Ambassador annotations to dynamically configure a route to the service, triggered only when the HTTP method is a POST, and the annotation also specifies a rewrite rule.<\/p>\n<h2 id=\"kubeflow-and-ambassador\">Kubeflow and Ambassador<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/kubernetes.io\/images\/blog\/2018-06-01-dynamic-ingress-kubernetes\/kubeflow-ambassador.png\" alt=\"kubeflow-ambassador\" \/><\/p>\n<p>With Ambassador, Kubeflow manages routing easily with Kubernetes annotations. Kubeflow configures a single ingress object that directs traffic to Ambassador, then creates services with Ambassador annotations as needed to direct traffic to specific backends. For example, when deploying TensorFlow services,  Kubeflow creates and annotates a K8s service so that the model will be served at https:\/\/<ingress host>\/models\/<model name>\/. Kubeflow can also use the Envoy Proxy to do the actual L7 routing. Using Ambassador, Kubeflow takes advantage of additional routing configuration like URL rewriting and method-based routing.<\/p>\n<p>If you\u2019re interested in using Ambassador with Kubeflow, the standard Kubeflow install automatically installs and configures Ambassador.<\/p>\n<p>If you\u2019re interested in using Ambassador as an API Gateway or Kubernetes ingress solution for your non-Kubeflow services, check out the <a href=\"https:\/\/www.getambassador.io\/user-guide\/getting-started\" target=\"_blank\">Getting Started with Ambassador guide<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Author: Richard Li (Datawire) Kubernetes makes it easy to deploy applications that consist of many microservices, but one of the key challenges with this type of architecture is dynamically routing ingress traffic to each of these services. One approach is Ambassador, a Kubernetes-native open source API Gateway built on the Envoy Proxy. Ambassador is designed [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Blog: Dynamic Ingress in Kubernetes - Howk IT-Dienstleistungen<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/howk.de\/?p=4332\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Blog: Dynamic Ingress in Kubernetes - Howk IT-Dienstleistungen\" \/>\n<meta property=\"og:description\" content=\"Author: Richard Li (Datawire) Kubernetes makes it easy to deploy applications that consist of many microservices, but one of the key challenges with this type of architecture is dynamically routing ingress traffic to each of these services. One approach is Ambassador, a Kubernetes-native open source API Gateway built on the Envoy Proxy. Ambassador is designed [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/howk.de\/?p=4332\" \/>\n<meta property=\"og:site_name\" content=\"Howk IT-Dienstleistungen\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/howk.de\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-31T14:14:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kubernetes.io\/images\/blog\/2018-06-01-dynamic-ingress-kubernetes\/kubeflow.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/howk.de\/?p=4332#article\",\"isPartOf\":{\"@id\":\"https:\/\/howk.de\/?p=4332\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/howk.de\/#\/schema\/person\/b029bd02d4f35dce869ef54c81a100c5\"},\"headline\":\"Blog: Dynamic Ingress in Kubernetes\",\"datePublished\":\"2018-12-31T14:14:16+00:00\",\"dateModified\":\"2018-12-31T14:14:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/howk.de\/?p=4332\"},\"wordCount\":451,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/howk.de\/#organization\"},\"articleSection\":[\"Hi Tech\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/howk.de\/?p=4332#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/howk.de\/?p=4332\",\"url\":\"https:\/\/howk.de\/?p=4332\",\"name\":\"Blog: Dynamic Ingress in Kubernetes - Howk IT-Dienstleistungen\",\"isPartOf\":{\"@id\":\"https:\/\/howk.de\/#website\"},\"datePublished\":\"2018-12-31T14:14:16+00:00\",\"dateModified\":\"2018-12-31T14:14:16+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/howk.de\/?p=4332#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/howk.de\/?p=4332\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/howk.de\/?p=4332#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/howk.de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blog: Dynamic Ingress in Kubernetes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/howk.de\/#website\",\"url\":\"https:\/\/howk.de\/\",\"name\":\"Howk IT-Dienstleistungen\",\"description\":\"Howk IT Services - Howk IT-Dienstleistungen\",\"publisher\":{\"@id\":\"https:\/\/howk.de\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/howk.de\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/howk.de\/#organization\",\"name\":\"HowK\",\"url\":\"https:\/\/howk.de\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/howk.de\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/howk.de\/w1\/wp-content\/uploads\/2013\/12\/howk-logo.png\",\"contentUrl\":\"https:\/\/howk.de\/w1\/wp-content\/uploads\/2013\/12\/howk-logo.png\",\"width\":170,\"height\":170,\"caption\":\"HowK\"},\"image\":{\"@id\":\"https:\/\/howk.de\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/howk.de\",\"http:\/\/de.linkedin.com\/in\/howkde\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/howk.de\/#\/schema\/person\/b029bd02d4f35dce869ef54c81a100c5\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/howk.de\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b5a20f4d07bca1b73f25cff58a1116c4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b5a20f4d07bca1b73f25cff58a1116c4?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/howk.de\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Blog: Dynamic Ingress in Kubernetes - Howk IT-Dienstleistungen","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/howk.de\/?p=4332","og_locale":"en_US","og_type":"article","og_title":"Blog: Dynamic Ingress in Kubernetes - Howk IT-Dienstleistungen","og_description":"Author: Richard Li (Datawire) Kubernetes makes it easy to deploy applications that consist of many microservices, but one of the key challenges with this type of architecture is dynamically routing ingress traffic to each of these services. One approach is Ambassador, a Kubernetes-native open source API Gateway built on the Envoy Proxy. Ambassador is designed [&hellip;]","og_url":"https:\/\/howk.de\/?p=4332","og_site_name":"Howk IT-Dienstleistungen","article_publisher":"https:\/\/www.facebook.com\/howk.de","article_published_time":"2018-12-31T14:14:16+00:00","og_image":[{"url":"https:\/\/kubernetes.io\/images\/blog\/2018-06-01-dynamic-ingress-kubernetes\/kubeflow.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/howk.de\/?p=4332#article","isPartOf":{"@id":"https:\/\/howk.de\/?p=4332"},"author":{"name":"admin","@id":"https:\/\/howk.de\/#\/schema\/person\/b029bd02d4f35dce869ef54c81a100c5"},"headline":"Blog: Dynamic Ingress in Kubernetes","datePublished":"2018-12-31T14:14:16+00:00","dateModified":"2018-12-31T14:14:16+00:00","mainEntityOfPage":{"@id":"https:\/\/howk.de\/?p=4332"},"wordCount":451,"commentCount":0,"publisher":{"@id":"https:\/\/howk.de\/#organization"},"articleSection":["Hi Tech"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/howk.de\/?p=4332#respond"]}]},{"@type":"WebPage","@id":"https:\/\/howk.de\/?p=4332","url":"https:\/\/howk.de\/?p=4332","name":"Blog: Dynamic Ingress in Kubernetes - Howk IT-Dienstleistungen","isPartOf":{"@id":"https:\/\/howk.de\/#website"},"datePublished":"2018-12-31T14:14:16+00:00","dateModified":"2018-12-31T14:14:16+00:00","breadcrumb":{"@id":"https:\/\/howk.de\/?p=4332#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/howk.de\/?p=4332"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/howk.de\/?p=4332#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/howk.de\/"},{"@type":"ListItem","position":2,"name":"Blog: Dynamic Ingress in Kubernetes"}]},{"@type":"WebSite","@id":"https:\/\/howk.de\/#website","url":"https:\/\/howk.de\/","name":"Howk IT-Dienstleistungen","description":"Howk IT Services - Howk IT-Dienstleistungen","publisher":{"@id":"https:\/\/howk.de\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/howk.de\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/howk.de\/#organization","name":"HowK","url":"https:\/\/howk.de\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/howk.de\/#\/schema\/logo\/image\/","url":"https:\/\/howk.de\/w1\/wp-content\/uploads\/2013\/12\/howk-logo.png","contentUrl":"https:\/\/howk.de\/w1\/wp-content\/uploads\/2013\/12\/howk-logo.png","width":170,"height":170,"caption":"HowK"},"image":{"@id":"https:\/\/howk.de\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/howk.de","http:\/\/de.linkedin.com\/in\/howkde"]},{"@type":"Person","@id":"https:\/\/howk.de\/#\/schema\/person\/b029bd02d4f35dce869ef54c81a100c5","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/howk.de\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b5a20f4d07bca1b73f25cff58a1116c4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b5a20f4d07bca1b73f25cff58a1116c4?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/howk.de\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/howk.de\/index.php?rest_route=\/wp\/v2\/posts\/4332"}],"collection":[{"href":"https:\/\/howk.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/howk.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/howk.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/howk.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4332"}],"version-history":[{"count":0,"href":"https:\/\/howk.de\/index.php?rest_route=\/wp\/v2\/posts\/4332\/revisions"}],"wp:attachment":[{"href":"https:\/\/howk.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/howk.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/howk.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}