Differences between revisions 1 and 5 (spanning 4 versions)
Revision 1 as of 2019-07-15 20:41:05
Size: 137
Editor: PieterSmit
Comment:
Revision 5 as of 2019-07-17 21:12:44
Size: 797
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:

kubectl -n kube-system get events -w
Line 6: Line 9:

 * Node cpu and memory utilization {{{

alias util='kubectl get nodes | grep node | awk '\''{print $1}'\'' | xargs -I {} sh -c '\''echo {} ; kubectl describe node {} | grep Allocated -A 5 | grep -ve Event -ve Allocated -ve percent -ve -- ; echo '\'''

}}}


 * Watch node events (& puts it in background on terminal) {{{
kubectl get pods -A -o wide &
}}}

 * Get cpu metrics {{{
# Get the metrics for all nodes
kubectl get --raw /apis/metrics.k8s.io/v1beta1/nodes | jq

# Get the metrics for all pods
kubectl get --raw /apis/metrics.k8s.io/v1beta1/pods | jq

}}}

----
CategoryK8sKubernetes

Kubernetes K8s/Monitoring

  • Events happening in cluser

    kubectl -n kube-system get events --sort-by='{.lastTimestamp}'
    
    kubectl -n kube-system get events -w
  • Node cpu and memory utilization

    alias util='kubectl get nodes | grep node | awk '\''{print $1}'\'' | xargs -I {} sh -c '\''echo   {} ; kubectl describe node {} | grep Allocated -A 5 | grep -ve Event -ve Allocated -ve percent -ve -- ; echo '\'''
  • Watch node events (& puts it in background on terminal)

    kubectl get pods -A -o wide &
  • Get cpu metrics

    # Get the metrics for all nodes
    kubectl get --raw /apis/metrics.k8s.io/v1beta1/nodes | jq
    
    # Get the metrics for all pods
    kubectl get --raw /apis/metrics.k8s.io/v1beta1/pods | jq


CategoryK8sKubernetes

k8s/Monitoring (last edited 2022-10-21 00:19:58 by PieterSmit)