kube_troucleshooting
Differences
This shows you the differences between two versions of the page.
| kube_troucleshooting [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadm | kube_troucleshooting [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Troubleshooting ====== | ||
| - | <code bash> | ||
| - | $ kubectl create deploy nginx --image=nginx | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl expose deploy nginx --port=80 --target-port=80 --cluster-ip=' | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl get services nginx | ||
| - | NAME TYPE CLUSTER-IP | ||
| - | nginx | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl run multitool --image=praqma/ | ||
| - | pod/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl exec -it multitool -- bash | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | bash-5.1# curl -I -k http:// | ||
| - | HTTP/1.1 200 OK | ||
| - | Server: nginx/ | ||
| - | Date: Fri, 08 Apr 2022 20:55:20 GMT | ||
| - | Content-Type: | ||
| - | Content-Length: | ||
| - | Last-Modified: | ||
| - | Connection: keep-alive | ||
| - | ETag: " | ||
| - | Accept-Ranges: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | bash-5.1# nslookup google.com | ||
| - | Server: | ||
| - | Address: | ||
| - | |||
| - | Non-authoritative answer: | ||
| - | Name: | ||
| - | Address: 172.217.162.110 | ||
| - | Name: | ||
| - | Address: 2800: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | bash-5.1# nslookup kubernetes | ||
| - | Server: | ||
| - | Address: | ||
| - | |||
| - | Name: | ||
| - | Address: 10.96.0.1 | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ cat / | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | }, | ||
| - | " | ||
| - | " | ||
| - | }, | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | }, | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | }, | ||
| - | {" | ||
| - | ] | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl get installation -o yaml | ||
| - | apiVersion: v1 | ||
| - | items: | ||
| - | - apiVersion: operator.tigera.io/ | ||
| - | kind: Installation | ||
| - | metadata: | ||
| - | annotations: | ||
| - | kubectl.kubernetes.io/ | ||
| - | {" | ||
| - | creationTimestamp: | ||
| - | generation: 2 | ||
| - | name: default | ||
| - | resourceVersion: | ||
| - | uid: 0ba3ed49-2649-4853-9745-09728868694c | ||
| - | spec: | ||
| - | calicoNetwork: | ||
| - | bgp: Enabled | ||
| - | hostPorts: Enabled | ||
| - | ipPools: | ||
| - | - blockSize: 26 | ||
| - | cidr: 10.85.0.0/ | ||
| - | encapsulation: | ||
| - | natOutgoing: | ||
| - | nodeSelector: | ||
| - | - blockSize: 122 | ||
| - | cidr: 1100: | ||
| - | encapsulation: | ||
| - | natOutgoing: | ||
| - | nodeSelector: | ||
| - | linuxDataplane: | ||
| - | multiInterfaceMode: | ||
| - | nodeAddressAutodetectionV4: | ||
| - | firstFound: true | ||
| - | nodeAddressAutodetectionV6: | ||
| - | firstFound: true | ||
| - | cni: | ||
| - | ipam: | ||
| - | type: Calico | ||
| - | type: Calico | ||
| - | controlPlaneReplicas: | ||
| - | flexVolumePath: | ||
| - | nodeUpdateStrategy: | ||
| - | rollingUpdate: | ||
| - | maxUnavailable: | ||
| - | type: RollingUpdate | ||
| - | nonPrivileged: | ||
| - | variant: Calico | ||
| - | status: | ||
| - | computed: | ||
| - | calicoNetwork: | ||
| - | bgp: Enabled | ||
| - | hostPorts: Enabled | ||
| - | ipPools: | ||
| - | - blockSize: 26 | ||
| - | cidr: 10.85.0.0/ | ||
| - | encapsulation: | ||
| - | natOutgoing: | ||
| - | nodeSelector: | ||
| - | - blockSize: 122 | ||
| - | cidr: 1100: | ||
| - | encapsulation: | ||
| - | natOutgoing: | ||
| - | nodeSelector: | ||
| - | linuxDataplane: | ||
| - | multiInterfaceMode: | ||
| - | nodeAddressAutodetectionV4: | ||
| - | firstFound: true | ||
| - | nodeAddressAutodetectionV6: | ||
| - | firstFound: true | ||
| - | cni: | ||
| - | ipam: | ||
| - | type: Calico | ||
| - | type: Calico | ||
| - | controlPlaneReplicas: | ||
| - | flexVolumePath: | ||
| - | nodeUpdateStrategy: | ||
| - | rollingUpdate: | ||
| - | maxUnavailable: | ||
| - | type: RollingUpdate | ||
| - | nonPrivileged: | ||
| - | variant: Calico | ||
| - | mtu: 1450 | ||
| - | variant: Calico | ||
| - | kind: List | ||
| - | metadata: | ||
| - | resourceVersion: | ||
| - | selfLink: "" | ||
| - | </ | ||
| - | |||
| - | REF: https:// | ||
| - | |||
| - | ===== Testando o ping ===== | ||
| - | <code yaml ping.yml> | ||
| - | --- | ||
| - | apiVersion: v1 | ||
| - | kind: Pod | ||
| - | metadata: | ||
| - | name: ping | ||
| - | spec: | ||
| - | containers: | ||
| - | - name: ping-container | ||
| - | image: alpine: | ||
| - | command: ["/ | ||
| - | securityContext: | ||
| - | capabilities: | ||
| - | add: | ||
| - | - NET_RAW | ||
| - | drop: | ||
| - | - ALL | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl apply -f ping.yml | ||
| - | pod/ping created | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | kubectl logs -f pod/ping | ||
| - | PING 8.8.8.8 (8.8.8.8): 56 data bytes | ||
| - | </ | ||
| - | |||
| - | ===== Testando o traceroute ===== | ||
| - | <code yaml traceroute.yml> | ||
| - | --- | ||
| - | apiVersion: v1 | ||
| - | kind: Pod | ||
| - | metadata: | ||
| - | name: traceroute | ||
| - | spec: | ||
| - | containers: | ||
| - | - name: traceroute-container | ||
| - | image: alpine: | ||
| - | command: ["/ | ||
| - | securityContext: | ||
| - | capabilities: | ||
| - | add: | ||
| - | - NET_RAW | ||
| - | drop: | ||
| - | - ALL | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl apply -f traceroute.yml | ||
| - | pod/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl logs -f pod/ | ||
| - | traceroute to 2804: | ||
| - | | ||
| - | </ | ||
| - | |||
| - | ===== Troubleshooting pod ===== | ||
| - | <file bash> | ||
| - | kubectl logs <POD> --all-containers | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | kubectl logs <POD> -c < | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | kubectl get events -n < | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | kubectl get events --sort-by=.metadata.creationTimestamp -n < | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | kubectl logs -n --previous <POD> -n < | ||
| - | </ | ||
| - | ===== Referências ===== | ||
| - | - [[https:// | ||
| - | - [[https:// | ||
kube_troucleshooting.1753560544.txt.gz · Last modified: by wikiadm
