Kubernetes Snippets

Rerun existing completed Job kubectl replace deletes the old job, if there is any error, your job definition is lost, don’t forget to save it first! Replace an existing Job with itself kubectl get job JOBNAME -o yaml | kubectl replace --force -f - Sometimes there are errors importing the job template due to auto-generated labels or selectors .. a quick and dirty hack is to filter them out using jq ...

March 1, 2010 · 10 min · 1924 words · Micha Kops

Observability Snippets

Observability Strategies USE USE stands for: Utilization - Percent time the resource is busy, such as node CPU usage Saturation - Amount of work a resource has to do, often queue length or node load Errors - Count of error events This method is best for hardware resources in infrastructure, such as CPU, memory, and network devices. For more information, refer to The USE Method. Source: https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/best-practices/ RED RED stands for: Rate - Requests per second Errors - Number of requests that are failing Duration - Amount of time these requests take, distribution of latency measurements This method is most applicable to services, especially a microservices environment. For each of your services, instrument the code to expose these metrics for each component. RED dashboards are good for alerting and SLAs. A well-designed RED dashboard is a proxy for user experience. ...

March 1, 2010 · 2 min · 231 words · Micha Kops