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

Next revision
Previous revision
cheatsheet-kubernetes [2025/06/01 11:59] – created - 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>
  
Line 283: Line 299:
 # Open the terminal (click terminal icon next to the name) # Open the terminal (click terminal icon next to the name)
 grafana cli admin reset-admin-password <admin-password> grafana cli admin reset-admin-password <admin-password>
 +</code>
 +\\ Check for kafka topics
 +<code bash>
 +# open a terminal on one of the kafka brokers (eg kafka-kafka-0)
 +./bin/kafka-topics.sh --list --bootstrap-server localhost:9092
 +</code>
 +\\ Get all resource kinds with their name from a manifest:
 +<code bash>
 +cat opentelemetry-operator.yaml | grep -i '^kind\|^  name:'
 </code> </code>
  
Line 344: 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.1748779162.txt.gz · Last modified: by 127.0.0.1