wiki.getshifting.com

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


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/10/25 18:06] – external edit 127.0.0.1cheatsheet-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>
  
cheatsheet-kubernetes.1761415596.txt.gz · Last modified: by 127.0.0.1