PageSourceSearch

https://archive-os-3-24.netlify.app/assets/js/d403dbea.0048e1ab.js

js archive-os-3-24.netlify.app collected 2026-10-04 10:29:52 UTC 9,925 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunktigera_docs=self.webpackChunktigera_docs||[]).push([[2990],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var r=n(67294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var i=r.createContext({}),p=function(e){var t=r.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},c=function(e){var t=p(e.components);return r.createElement(i.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),u=p(n),m=a,g=u["".concat(i,".").concat(m)]||u[m]||d[m]||o;return n?r.createElement(g,l(l({ref:t},c),{},{components:n})):r.createElement(g,l({ref:t},c))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,l=new Array(o);l[0]=u;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s.mdxType="string"==typeof e?e:a,l[1]=s;for(var p=2;p<o;p++)l[p]=n[p];return r.createElement.apply(null,l)}return r.createElement.apply(null,n)}u.displayName="MDXCreateElement"},79430:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>d,frontMatter:()=>o,metadata:()=>s,toc:()=>p});var r=n(87462),a=(n(67294),n(3905));const o={description:"Test that networking works correctly."},l="Test networking",s={unversionedId:"getting-started/kubernetes/hardway/test-networking",id:"version-3.24/getting-started/kubernetes/hardway/test-networking",title:"Test networking",description:"Test that networking works correctly.",source:"@site/calico_versioned_docs/version-3.24/getting-started/kubernetes/hardway/test-networking.mdx",sourceDirName:"getting-started/kubernetes/hardway",slug:"/getting-started/kubernetes/hardway/test-networking",permalink:"/calico/3.24/getting-started/kubernetes/hardway/test-networking",draft:!1,editUrl:"https://github.com/tigera/docs/edit/main/calico_versioned_docs/version-3.24/getting-started/kubernetes/hardway/test-networking.mdx",tags:[],version:"3.24",frontMatter:{description:"Test that networking works correctly."},sidebar:"calicoSidebar",previous:{title:"Configure BGP peering",permalink:"/calico/3.24/getting-started/kubernetes/hardway/configure-bgp-peering"},next:{title:"Test network policy",permalink:"/calico/3.24/getting-started/kubernetes/hardway/test-network-policy"}},i={},p=[{value:"Pod to pod pings",id:"pod-to-pod-pings",level:2},{value:"Check routes",id:"check-routes",level:2},{value:"IPAM allocations from different pools",id:"ipam-allocations-from-different-pools",level:2},{value:"Clean up",id:"clean-up",level:2},{value:"Next",id:"next",level:2}],c={toc:p};function d(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"test-networking"},"Test networking"),(0,a.kt)("p",null,"In this lab we will test the Calico cluster to demonstrate networking is working correctly."),(0,a.kt)("h2",{id:"pod-to-pod-pings"},"Pod to pod pings"),(0,a.kt)("p",null,"Create three busybox instances"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"kubectl create deployment pingtest --image=busybox --replicas=3 -- sleep infinity\n")),(0,a.kt)("p",null,"Check their IP addresses"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"kubectl get pods --selector=app=pingtest --output=wide\n")),(0,a.kt)("p",null,"Result"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"NAME                      READY   STATUS    RESTARTS   AGE     IP               NODE               NOMINATED NODE   READINESS GATES\npingtest-b4b6f8cf-b5z78   1/1     Running   0          3m28s   192.168.38.128   ip-172-31-37-123   <none>           <none>\npingtest-b4b6f8cf-jmzq6   1/1     Running   0          3m28s   192.168.45.193   ip-172-31-40-217   <none>           <none>\npingtest-b4b6f8cf-rn9nm   1/1     Running   0          3m28s   192.168.60.64    ip-172-31-45-29    <none>           <none>\n")),(0,a.kt)("p",null,"Note the IP addresses of the second two pods, then exec into the first one. For example"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"kubectl exec -ti pingtest-b4b6f8cf-b5z78 -- sh\n")),(0,a.kt)("p",null,"From inside the pod, ping the other two pod IP addresses. For example"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"ping 192.168.45.193 -c 4\n")),(0,a.kt)("p",null,"Result"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"PING 192.168.45.193 (192.168.45.193): 56 data bytes\n64 bytes from 192.168.45.193: seq=0 ttl=62 time=1.847 ms\n64 bytes from 192.168.45.193: seq=1 ttl=62 time=0.684 ms\n64 bytes from 192.168.45.193: seq=2 ttl=62 time=0.488 ms\n64 bytes from 192.168.45.193: seq=3 ttl=62 time=0.442 ms\n\n--- 192.168.45.193 ping statistics ---\n4 packets transmitted, 4 packets received, 0% packet loss\nround-trip min/avg/max = 0.442/0.865/1.847 ms\n")),(0,a.kt)("h2",{id:"check-routes"},"Check routes"),(0,a.kt)("p",null,"From one of the nodes, verify that routes exist to each of the ",(0,a.kt)("inlineCode",{parentName:"p"},"pingtest")," pods' IP addresses. For example"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"ip route get 192.168.38.128\n")),(0,a.kt)("p",null,"Result"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"192.168.38.128 via 172.31.37.123 dev eth0 src 172.31.42.47 uid 1000\n    cache\n")),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"via 172.31.37.123")," in this example indicates the next-hop for this pod IP, which matches the IP address of the node the\npod is scheduled on, as expected."),(0,a.kt)("h2",{id:"ipam-allocations-from-different-pools"},"IPAM allocations from different pools"),(0,a.kt)("p",null,"Recall that we created two IP pools, but left one disabled."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"calicoctl get ippools -o wide\n")),(0,a.kt)("p",null,"Result"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"NAME    CIDR               NAT    IPIPMODE   VXLANMODE   DISABLED   SELECTOR\npool1   192.168.0.0/18     true   Never      Never       false      all()\npool2   192.168.192.0/19   true   Never      Never       true       all()\n")),(0,a.kt)("p",null,"Enable the second pool."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"calicoctl apply -f - <<EOF\napiVersion: projectcalico.org/v3\nkind: IPPool\nmetadata:\n  name: pool2\nspec:\n  cidr: 192.168.192.0/19\n  ipipMode: Never\n  natOutgoing: true\n  disabled: false\n  nodeSelector: all()\nEOF\n")),(0,a.kt)("p",null,"Create a pod, explicitly requesting an address from ",(0,a.kt)("inlineCode",{parentName:"p"},"pool2")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'kubectl apply -f - <<EOF\napiVersion: v1\nkind: Pod\nmetadata:\n  name: pingtest-pool2\n  annotations:\n    cni.projectcalico.org/ipv4pools: "[\\"pool2\\"]"\nspec:\n  containers:\n  - args:\n    - sleep\n    - infinity\n    image: busybox\n    imagePullPolicy: Always\n    name: pingtest\nEOF\n')),(0,a.kt)("p",null,"Verify it has an IP address from ",(0,a.kt)("inlineCode",{parentName:"p"},"pool2")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"kubectl get pod pingtest-pool2 -o wide\n")),(0,a.kt)("p",null,"Result"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"NAME             READY   STATUS    RESTARTS   AGE   IP              NODE              NOMINATED NODE   READINESS GATES\npingtest-pool2   1/1     Running   0          75s   192.168.219.0   ip-172-31-45-29   <none>           <none>\n")),(0,a.kt)("p",null,"From one of the original pingtest pods, ping the IP address."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"ping 192.168.219.0 -c 4\n")),(0,a.kt)("p",null,"Result"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"PING 192.168.219.0 (192.168.219.0): 56 data bytes\n64 bytes from 192.168.219.0: seq=0 ttl=62 time=0.524 ms\n64 bytes from 192.168.219.0: seq=1 ttl=62 time=0.459 ms\n64 bytes from 192.168.219.0: seq=2 ttl=62 time=0.505 ms\n64 bytes from 192.168.219.0: seq=3 ttl=62 time=0.492 ms\n\n--- 192.168.219.0 ping statistics ---\n4 packets transmitted, 4 packets received, 0% packet loss\nround-trip min/avg/max = 0.459/0.495/0.524 ms\n")),(0,a.kt)("h2",{id:"clean-up"},"Clean up"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"kubectl delete deployments.apps pingtest\nkubectl delete pod pingtest-pool2\n")),(0,a.kt)("h2",{id:"next"},"Next"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"/calico/3.24/getting-started/kubernetes/hardway/test-network-policy"},"Test network policy")))}d.isMDXComponent=!0}}]);

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.