{"id":1655,"date":"2021-11-07T12:08:34","date_gmt":"2021-11-07T12:08:34","guid":{"rendered":"https:\/\/the-plot.com\/blog\/?p=1655"},"modified":"2021-11-09T20:04:21","modified_gmt":"2021-11-09T20:04:21","slug":"exposing-the-linkderd-dashboard-via-metallb","status":"publish","type":"post","link":"https:\/\/the-plot.com\/blog\/?p=1655","title":{"rendered":"Exposing the Linkderd dashboard via MetalLB"},"content":{"rendered":"\n<p>Note: these steps apply to Linkderd installed via Microk8s. They should be adaptable to other environments, but I don&#8217;t have other installs to test against.<\/p>\n\n\n\n<p>This is another possible variant to the instructions provided in <a href=\"https:\/\/linkerd.io\/2.10\/tasks\/exposing-dashboard\/\">the official MetalLB documentation<\/a>. There are good reasons why to use something like Nginx for ingress, as it opens up various authentication possibilities. The approach documented here is just another variant of the <a href=\"https:\/\/linkerd.io\/2.10\/tasks\/exposing-dashboard\/#dns-rebinding-protection\">Kustomize approach<\/a> to change the <code>enforced-hosts<\/code> value, but applying the change manually by a YAML rewrite.<\/p>\n\n\n\n<p>There are 3 steps, which all have to happen in the linkerd namespace. First, create a service definition of type <code>LoadBalancer <\/code>that uses the annotations defined in <code>pod\/linkerd-web<\/code>.<\/p>\n\n\n\n<p>\n<pre>\napiVersion: v1\nkind: Service\nmetadata:\n  name: linkerd-lb\nspec:\n  ports:\n  - name: http\n    port: 80\n    protocol: TCP\n    targetPort: 8084\n  selector:\n    linkerd.io\/control-plane-component: web\n    linkerd.io\/control-plane-ns: linkerd\n  type: LoadBalancer\n\n<\/pre>\n<\/p>\n\n\n<p>Next, output the YAML of the deployment by executing:<\/p>\n<p><!-- \/wp:post-content --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p> <code>kubectl get deployment.apps\/linkerd-web -o yaml &gt; linkerdwebdeployment.yaml<\/code><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>Looks for the second occurrence of the &#8216;enforce-hosts&#8217; strings in the yaml file (the first is in the annotation). Alter the RegEx to the value for me. As I&#8217;m running a test instance with a client getting IP addresses via DHCP, I set this to the (insecure!) wildcard value:<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><code>- -enforced-host=.*<\/code><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>I actually deleted deployment.apps\/linkerd-web rather than just applying the new version. Your mileage may vary here. It&#8217;s worth pointing out there is another service defined straight out of the box (service\/linkerd-web) which you don&#8217;t need to change. <\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>I had a couple of bites at this, and at one point uninstalled and reinstalled via the microk8s command line, which seems to work very cleanly.<\/p>\n<p><!-- \/wp:paragraph --><\/p>","protected":false},"excerpt":{"rendered":"<p>Note: these steps apply to Linkderd installed via Microk8s. They should be adaptable to other environments, but I don&#8217;t have other installs to test against. This is another possible variant to the instructions provided in the official MetalLB documentation. There &hellip; <a href=\"https:\/\/the-plot.com\/blog\/?p=1655\">Continue reading <span class=\"meta-nav\">&rarr;<\/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":[12],"tags":[],"class_list":["post-1655","post","type-post","status-publish","format-standard","hentry","category-cloud"],"_links":{"self":[{"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1655"}],"version-history":[{"count":5,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1655\/revisions"}],"predecessor-version":[{"id":1679,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1655\/revisions\/1679"}],"wp:attachment":[{"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}