Difference between ClusterIP, NodePort and LoadBalancer service types in Kubernetes?

A ClusterIP exposes the following: spec.clusterIp:spec.ports[*].port You can only access this service while inside the cluster. It is accessible from its spec.clusterIp port. If a spec.ports[*].targetPort is set it will route from the port to the targetPort. The CLUSTER-IP you get when calling kubectl get services is the IP assigned to this service within the … Read more

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

Getting container/parent object from within contained object

Pass a reference to the Bar object, like so: class Foo(object): def __init__(self): self.text = “Hello World” # has to be created first, so Bar.__init__ can reference it self.bar = Bar(self) class Bar(object): def __init__(self, parent): self.parent = parent self.newText = parent.text foo = Foo() Edit: as pointed out by @thomleo, this can cause problems … Read more

How to run amd64 docker image on arm64 host platform?

Using –platform is correct. On my M1 Mac I’m able to run both arm64 and amd64 versions of the Ubuntu image from Docker Hub. The machine hardware name provided by uname proves it. # docker run –rm -ti –platform linux/arm/v7 ubuntu:latest uname -m armv7l # docker run –rm -ti –platform linux/amd64 ubuntu:latest uname -m x86_64 … Read more

“Container is not defined” Google chart

I’m not a jquery fan, but I think that $(‘#pie_today_div’) returns a set of matched elements. The attribute computation works because (from jquery documentation) it “gets the value of an attribute for the first element in the set of matched elements”. So try chart = new google.visualization.PieChart($(‘#pie_today_div’)[0]); or directly chart = new google.visualization.PieChart(document.getElementById(‘pie_today_div’));