Archives mensuelles : avril 2023

Prometheus with Docker or Kubernetes

Prometheus config Example Here is a sample configuration that defines several jobs. All don’t require credentials but workers that require it. # my global config global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

ELK with Kubernetes

Configuration sample Kubernetes fields added by the kubernetes processor kubernetes.pod.name type: keyword   kubernetes.pod.uid type: keyword   kubernetes.pod.ip type: ip   kubernetes.namespace type: keyword   kubernetes.node.name type: keyword   kubernetes.node.hostname (Kubernetes hostname as reported by the node’s kernel) type: keyword … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Docker and K8s Logs

Docker logging drivers How to know the default Logging driver ? docker info –format ‘{{.LoggingDriver}}’ The default : the json-file logging driver Each Docker daemon has a default logging driver, which each container uses unless you configure it to use … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Kubernetes configuration/administration common issues and questions

kubelet GC deletes very frequently unused docker images/containers Symptoms : kubelet logs show messages such as : kubelet[5105]: I0428 15:55:45.440934 5105 image_gc_manager.go:305] [imageGCManager]: Disk usage on image filesystem is at 86% which is over the high threshold (85%). Trying to free … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Kubernetes : Daemonset

What is a DaemonSet ? A DaemonSet is a resource that ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Calico and Kubernetes

yml manifest or operator ? Operator is a specific program dedicated to calico lifecyle management in k8s yml manifest is the « old » way. It relies on deploying the calico resources on kubernetes via kubctl and a k8s yml. yml manifest … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Kubernetes Resources management

Node Allocatable The general idea : Node Capacity ————————— | kube-reserved | |————————-| | system-reserved | |————————-| | eviction-threshold | |————————-| | | | allocatable | | (available for pods) | | | | | Node resource information : – … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Thread-safety in Python

queue module – A synchronized queue class queue module overview It implements multi-producer, multi-consumer queues. It is useful when information must be exchanged safely between multiple threads. The Queue class in this module implements all the required locking semantics. The … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Logging with Python

Import import logging Basic configuration for the logging system logging.basicConfig() Practical for simple scripts to do one-shot configuration of the logging package. The default behaviour is to create a StreamHandler which writes to sys.stderr, set a formatter using the BASIC_FORMAT … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Reflection built-in functions and Inspect module in python

Reflection built-in functions Return the type of an object: def type(object) The return value is a type object and generally the same object as returned by object.__class__: Get the attribute value by its name from an object: getattr(x, ‘y’) is … Continuer la lecture

Publié dans Non classé | Laisser un commentaire