Monitor custom kubernetes pod metrics using Prometheus

You have to add this three annotation to your pods: prometheus.io/scrape: ‘true’ prometheus.io/path: ‘/data/metrics’ prometheus.io/port: ’80’ How it will work? Look at the kubernetes-pods job of config-map.yaml you are using to configure prometheus, – job_name: ‘kubernetes-pods’ kubernetes_sd_configs: – role: pod relabel_configs: – source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] action: keep regex: true – source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path] action: replace target_label: __metrics_path__ … Read more

Namespace “stucked” as Terminating, How I removed it

Assuming you’ve already tried to force-delete resources like: Pods stuck at terminating status, and your at your wits’ end trying to recover the namespace… You can force-delete the namespace (perhaps leaving dangling resources): ( NAMESPACE=your-rogue-namespace kubectl proxy & kubectl get namespace $NAMESPACE -o json |jq ‘.spec = {“finalizers”:[]}’ >temp.json curl -k -H “Content-Type: application/json” -X … Read more

How can I check what ingress controller I have on my kube and what is the default

You can check for pods implementing ingress controllers (actually with ingress in the name) with: kubectl get pods –all-namespaces | grep ingress And services exposing them with: kubectl get service –all-namespaces | grep ingress As @Prafull Ladha says, you won’t have an ingress controller by default. The documentation states that in “environments other than GCE/Google … Read more

helm error when updating: UPGRADE FAILED: The order in patch list

I’ve found that the reason of this problem was that I had some envVars duplicated. In my deployment I had: … spec: template: spec: container: env: – name: ENV_VAR_NAME value: “test” – name: ENV_VAR_NAME value: “test” … After removing the duplicated variable: … spec: template: spec: container: env: – name: ENV_VAR_NAME value: “test” … The … Read more

Get total and free disk space using Prometheus

According to my Grafana dashboard, the following metrics work nicely for alerting for available space, 100 – ((node_filesystem_avail_bytes{mountpoint=”https://stackoverflow.com/”,fstype!=”rootfs”} * 100) / node_filesystem_size_bytes{mountpoint=”https://stackoverflow.com/”,fstype!=”rootfs”}) The formula gives out the percentage of available space on the pointed disk. Make sure you include the mountpoint and fstype within the metrics.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)