Posts

k8s pod level resource limit definitions for all containers to use

This is an example of a yaml that shows k8s pod level resource limit defintions where containers will shared among themselves.  Yaml can be shown here :- apiVersion : apps/v1 kind : Deployment metadata :   name : my-app   namespace : default   labels :     app : my-app spec :   replicas : 2   revisionHistoryLimit : 5   selector :     matchLabels :       app : my-app   strategy :     type : RollingUpdate     rollingUpdate :       maxSurge : 1       maxUnavailable : 0   template :     metadata :       labels :         app : my-app     spec :       # Pod-level resources: shared by all containers in the pod.       # Stable in Kubernetes 1.37; on older versions it needs the       # PodLevelResources feature gate (beta/on by default from 1.34).       r...

gcp metric explorer using promql

Image
GCP metric explorer supports PromQL. Ideally we should use the UI to help us build our PromQL.  All we need to do is to click on the "Add query" and then we can select the metric that is relevant to us. In this case it is " dns_request_count ". Here is the sample PromQL that is generated.  { "__name__" = "kubernetes_io:pod_volume_utilization" } Memory request utilization over time  avg_over_time ({ "__name__" = "kubernetes.io/container/memory/request_utilization" , "monitored_resource" = "k8s_container" , "pod_name" = "autoscaling-metrics-adapter-857f68dbcd-kmvw8" }[ ${ __interval } ]) Dns request count over time  sum ( rate ({ "__name__" = "kubernetes.io/networking/dns/kubedns/dns_request_count" , "monitored_resource" = "k8s_container" }[ ${ __interval } ])) Add additional criteria  sum ( rate ({ "__name__" = "kubernetes.io/networki...

gcp getting started with LQL

Image
When working with GCP LQL, we need to work with fields and the log query language itself. To identify what fields that is available we can always check it here. There are the field that is available for us to query. If you expand that, you can discover more fields. Next we can also use SEARCH to all a full search (non case sensitive) of all the fields for example. This will retrieve log entry that contains "simple" or "Simple". SEARCH ( "Simple" ) gcloud logging write my - test - log "A simple entry." gcloud logging write my - test - log "A simple entry. There are the operator that you can use to refine your query with fields We can also write to our log using gclod command.  gcloud logging write my-test-log "A simple entry." Quick Summary Cheat Sheet Goal Operator / Syntax Example Starts with ( abc* ) =~ "^abc.*" protoPayload.methodName =~ "^v1.instances.*" Ends with ( *xyz ) =~ ".*xyz$" htt...