cheatsheet-kubernetes
Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cheatsheet-kubernetes [2025/07/20 05:47] – [MISC] sjoerdcheatsheet-kubernetes [2025/10/26 19:59] (current) sjoerd
Line 70: Line 70:
 kubectl top nodes --sort-by=cpu --no-headers | sort -k3 -n kubectl top nodes --sort-by=cpu --no-headers | sort -k3 -n
 kubectl top nodes --sort-by=memory --no-headers | sort -k3 -n kubectl top nodes --sort-by=memory --no-headers | sort -k3 -n
 +</code>
 +\\
 +> Connect to nodes in a private aks cluster
 +<code bash>
 +# Based on https://learn.microsoft.com/en-us/azure/aks/node-access where is explained on how to connect to aks nodes. However, this does not work for a private cluster as the container is not available. You can, assuming that you've added the container to your private container registry, use that one:
 +# Get all the nodes
 +kubectl get nodes -o wide
 +# Start the debug command to connect to the node using an image from a private container registry
 +kubectl debug node/aks-npuser001-34232393-vmss000001 -it --image=acreuwprd.azurecr.io/docker/docker/library/busybox:1.37
 </code> </code>
  
Line 113: Line 122:
 kubectl delete ns dev1 kubectl delete ns dev1
 kubectl delete ns dev2 kubectl delete ns dev2
 +</code>
 +
 +> Set a default namespace
 +<code bash>
 +# Set the default namespace and expected output
 +kubectl config set-context --current --namespace=ops
 +Context "aks-cluster" modified.
 </code> </code>
  
Line 353: Line 369:
     --set controller.service.loadBalancerIP="172.205.120.177"     --set controller.service.loadBalancerIP="172.205.120.177"
 </code> </code>
 +
 +//This wiki has been made possible by://
 +
 +<HTML>
 +<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8613096447910897"
 +     crossorigin="anonymous"></script>
 +<!-- Wiki End of Page -->
 +<ins class="adsbygoogle"
 +     style="display:block"
 +     data-ad-client="ca-pub-8613096447910897"
 +     data-ad-slot="6221699236"
 +     data-ad-format="auto"
 +     data-full-width-responsive="true"></ins>
 +<script>
 +     (adsbygoogle = window.adsbygoogle || []).push({});
 +</script>
 +</HTML>
 +
 +
  
cheatsheet-kubernetes.1752990463.txt.gz · Last modified: by sjoerd