PageSourceSearch

https://eksworkshop.com/assets/js/71b0a39c.951984a7.js

js eksworkshop.com collected 2026-10-02 04:40:31 UTC 9,432 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3101],{58553:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>s,metadata:()=>d,toc:()=>c});var o=t(62540),i=t(43023);const s={title:"Routing Traffic to Hybrid Nodes",sidebar_position:10,sidebar_custom_props:{module:!1},weight:25},r=void 0,d={id:"networking/eks-hybrid-nodes/routing-traffic",title:"Routing Traffic to Hybrid Nodes",description:"Now that we have our hybrid node instance connected to the cluster, we can",source:"@site/docs/networking/eks-hybrid-nodes/routing-traffic.md",sourceDirName:"networking/eks-hybrid-nodes",slug:"/networking/eks-hybrid-nodes/routing-traffic",permalink:"/docs/networking/eks-hybrid-nodes/routing-traffic",draft:!1,unlisted:!1,editUrl:"https://github.com/aws-samples/eks-workshop-v2/tree/main/website/docs/networking/eks-hybrid-nodes/routing-traffic.md",tags:[],version:"current",sidebarPosition:10,frontMatter:{title:"Routing Traffic to Hybrid Nodes",sidebar_position:10,sidebar_custom_props:{module:!1},weight:25},sidebar:"networking",previous:{title:"Connect Hybrid Node",permalink:"/docs/networking/eks-hybrid-nodes/connect-hybrid-node"},next:{title:"Cloud Bursting",permalink:"/docs/networking/eks-hybrid-nodes/cloud-bursting"}},a={},c=[];function l(e){const n={admonition:"admonition",code:"code",div:"div",em:"em",p:"p",...(0,i.R)(),...e.components},{Terminal:t,YamlAnnotation:s,YamlFile:r}=n;return t||u("Terminal",!0),s||u("YamlAnnotation",!0),r||u("YamlFile",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["Now that we have our hybrid node instance connected to the cluster, we can\ndeploy a sample workload using the ",(0,o.jsx)(n.code,{children:"Deployment"})," and ",(0,o.jsx)(n.code,{children:"Ingress"})," manifests below:"]}),"\n",(0,o.jsxs)(n.div,{children:[(0,o.jsx)(r,{title:"~/environment/eks-workshop/modules/networking/eks-hybrid-nodes/kustomize/deployment.yaml",zoomed:"false",children:'apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: nginx\n  namespace: nginx-remote\n  labels:\n    app: nginx\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: nginx\n  template:\n    metadata:\n      labels:\n        app: nginx\n    spec:\n      affinity:\n# annotated-highlight-start-even\n# highlight-annotation\n        nodeAffinity:\n          preferredDuringSchedulingIgnoredDuringExecution:\n            - weight: 1\n              preference:\n                matchExpressions:\n                  - key: eks.amazonaws.com/compute-type\n                    operator: In\n                    values:\n                      - hybrid\n# annotated-highlight-end-even\n      containers:\n        - name: nginx\n          image: public.ecr.aws/nginx/nginx:1.26\n          volumeMounts:\n            - name: workdir\n              mountPath: /usr/share/nginx/html\n          resources:\n            requests:\n              cpu: 200m\n            limits:\n              cpu: 200m\n          ports:\n            - containerPort: 80\n      initContainers:\n        - name: install\n          image: busybox:1.28\n          command: [ "sh", "-c"]\n          args:\n            - \'echo "Connected to $(POD_IP) on $(NODE_NAME)" > /work-dir/index.html\'\n          env:\n            - name: POD_IP\n              valueFrom:\n                fieldRef:\n                  fieldPath: status.podIP\n            - name: NODE_NAME\n              valueFrom:\n                fieldRef:\n                  fieldPath: spec.nodeName\n          volumeMounts:\n            - name: workdir\n              mountPath: "/work-dir"\n      volumes:\n        - name: workdir\n          emptyDir: {}\n'}),(0,o.jsx)(s,{sequence:"1",children:(0,o.jsxs)(n.p,{children:["We use ",(0,o.jsx)(n.code,{children:"nodeAffinity"})," rules to tell the Kubernetes scheduler to ",(0,o.jsx)(n.em,{children:"prefer"})," cluster nodes\nwith the ",(0,o.jsx)(n.code,{children:"eks.amazonaws.com/compute-type=hybrid"})," label and value."]})})]}),"\n",(0,o.jsx)(n.div,{}),"\n",(0,o.jsxs)(n.div,{children:[(0,o.jsx)(r,{title:"~/environment/eks-workshop/modules/networking/eks-hybri
1d-nodes/kustomize/ingress.yaml",zoomed:"false",children:"apiVersion: networking.k8s.io/v1\nkind: Ingress\nmetadata:\n  name: nginx\n  namespace: nginx-remote\n  annotations:\n    alb.ingress.kubernetes.io/scheme: internet-facing\n    alb.ingress.kubernetes.io/target-type: ip\n    alb.ingress.kubernetes.io/inbound-cidrs: $INBOUND_CIDRS\nspec:\n# annotated-highlight-start-even\n# highlight-annotation\n  ingressClassName: alb\n# annotated-highlight-end-even\n  rules:\n    - http:\n        paths:\n          - path: /\n            pathType: Prefix\n            backend:\n              service:\n                name: nginx\n                port:\n                  number: 80\n"}),(0,o.jsx)(s,{sequence:"1",children:(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"ingress"})," resource will configure an AWS Load Balancer (ALB) to route traffic to the workload pods."]})})]}),"\n",(0,o.jsx)(n.div,{}),"\n",(0,o.jsx)(n.p,{children:"Let's deploy the workload:"}),"\n",(0,o.jsx)(t,{output:"JCBrdWJlY3RsIGt1c3RvbWl6ZSB+L2Vudmlyb25tZW50L2Vrcy13b3Jrc2hvcC9tb2R1bGVzL25ldHdvcmtpbmcvZWtzLWh5YnJpZC1ub2Rlcy9rdXN0b21pemUgfCBlbnZzdWJzdCB8IGt1YmVjdGwgYXBwbHkgLWYgLQpuYW1lc3BhY2UvbmdpbngtcmVtb3RlIGNyZWF0ZWQKc2VydmljZS9uZ2lueCBjcmVhdGVkCmRlcGxveW1lbnQuYXBwcy9uZ2lueCBjcmVhdGVkCmluZ3Jlc3MubmV0d29ya2luZy5rOHMuaW8vbmdpbnggY3JlYXRlZA=="}),"\n",(0,o.jsx)(n.p,{children:"Let\u2019s confirm the pods were scheduled on our hybrid node successfully:"}),"\n",(0,o.jsx)(t,{output:"JCBrdWJlY3RsIGdldCBwb2RzIC1uIG5naW54LXJlbW90ZSAtbz1jdXN0b20tY29sdW1ucz0nTkFNRToubWV0YWRhdGEubmFtZSxOT0RFOi5zcGVjLm5vZGVOYW1lJwpOQU1FICAgICAgICAgICAgICAgICAgICAgTk9ERQpuZ2lueC03ODdkNjY1ZjliLTJiY21zICAgbWktMDI3NTA0YzA5NzA0NTViYTUKbmdpbngtNzg3ZDY2NWY5Yi1oZ3JucCAgIG1pLTAyNzUwNGMwOTcwNDU1YmE1Cm5naW54LTc4N2Q2NjVmOWIta3Y0eDkgICBtaS0wMjc1MDRjMDk3MDQ1NWJhNQ=="}),"\n",(0,o.jsx)(n.p,{children:"Great! The three nginx pods are running on our hybrid node as expected."}),"\n",(0,o.jsxs)(n.admonition,{type:"tip",children:[(0,o.jsx)(n.p,{children:"The provisioning of the ALB may take a couple minutes. Before continuing, ensure the load balancer has finished provisioning with the following command:"}),(0,o.jsx)(t,{output:"JCBhd3MgZWxidjIgZGVzY3JpYmUtbG9hZC1iYWxhbmNlcnMgLS1xdWVyeSAnTG9hZEJhbGFuY2Vyc1s/Y29udGFpbnMoTG9hZEJhbGFuY2VyTmFtZSwgYGs4cy1uZ2lueHJlbS1uZ2lueGApID09IGB0cnVlYF0nIC0tcXVlcnkgJ0xvYWRCYWxhbmNlcnNbMF0uU3RhdGUuQ29kZScKImFjdGl2ZSI="})]}),"\n",(0,o.jsxs)(n.p,{children:["Once the ALB is active, we can check the ",(0,o.jsx)(n.code,{children:"Address"})," associated with the Ingress to retrieve the URL of the ALB:"]}),"\n",(0,o.jsx)(t,{output:"JCBleHBvcnQgQUREUkVTUz0kKGt1YmVjdGwgZ2V0IGluZ3Jlc3MgLW4gbmdpbngtcmVtb3RlIG5naW54IC1vIGpzb25wYXRoPSJ7LnN0YXR1cy5sb2FkQmFsYW5jZXIuaW5ncmVzc1sqXS5ob3N0bmFtZX17J1xuJ30iKSAmJiBlY2hvICRBRERSRVNTCms4cy1uZ2lueHJlbS1uZ2lueC0wM2VmYTFlODRjLTAxMjM0NTY3OC51cy13ZXN0LTIuZWxiLmFtYXpvbmF3cy5jb20="}),"\n",(0,o.jsx)(n.p,{children:"With the ALB URL, we can access our deployment through the command line or by entering the address into a web browser. The ALB will then route the traffic to the appropriate pods based on the Ingress rules."}),"\n",(0,o.jsx)(t,{output:"JCBjdXJsICRBRERSRVNTCkNvbm5lY3RlZCB0byAxMC41My4wLjUgb24gbWktMDI3NTA0YzA5NzA0NTViYTU="}),"\n",(0,o.jsxs)(n.p,{children:["In the output from curl or the browser, we can see the ",(0,o.jsx)(n.code,{children:"10.53.0.X"})," IP address of the pod receiving the request from the load balancer which is running on our hybrid node with the ",(0,o.jsx)(n.code,{children:"mi-"})," prefix."]}),"\n",(0,o.jsx)(n.p,{children:"Rerun the curl command or refresh your browser a few times and note that the pod IP changes in each request and the node name stays the same, as all pods are scheduled on the same remote node."}),"\n",(0,o.jsx)(t,{output:"JCBjdXJsIC1zICRBRERSRVNTCkNvbm5lY3RlZCB0byAxMC41My4wLjUgb24gbWktMDI3NTA0YzA5NzA0NTViYTUKJCBjdXJsIC1zICRBRERSRVNTCkNvbm5lY3RlZCB0byAxMC41My4wLjExIG9uIG1pLTAyNzUwNGMwOTcwNDU1YmE1CiQgY3VybCAtcyAkQUREUkVTUwpDb25uZWN0ZWQgdG8gMTAuNTMuMC44NCBvbiBtaS0wMjc1MDRjMDk3MDQ1NWJhNQ=="}),"\n",(0,o.jsx)(n.p,{children:"We've successfully deployed a workload to our hybrid node, configured it to be accessed through an ALB, and verified that the traffic is being properly routed to our pods running on the remote node."}),"\n",(0,o.jsx)(n.p,{children:"Before we move on to explore more use cases with EKS Hybrid Nodes, let's do a little cleanup."}),"\n",(0,o.jsx)(t,{output:"JCBrdWJlY3RsIGRlbGV0ZSAtayB+L2Vudmlyb25tZW50L2Vrcy13b3Jrc2hvcC9tb2R1bGVzL25ldHdvcmtpbmcvZWtzLWh5YnJpZC1ub2Rlcy9rdXN0b21pemUgLS1pZ25vcmUtbm90LWZvdW5kPXRydWU="})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}function u(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},43023:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>d});var o=t(63696);const i={},s=o.createContext(i);function r(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.