Kubernetes Namespaces stuck in Terminating status

I did something similar to rahul.tripathi except the curl did not work for me – I followed https://medium.com/@craignewtondev/how-to-fix-kubernetes-namespace-deleting-stuck-in-terminating-state-5ed75792647e which does the following: NAMESPACE= kubectl get namespace $NAMESPACE -o json > $NAMESPACE.json sed -i -e ‘s/”kubernetes”//’ $NAMESPACE.json kubectl replace –raw “/api/v1/namespaces/$NAMESPACE/finalize” -f ./$NAMESPACE.json Voila! Namespace is deleted Update: One-liner version of this solution (requires jq) NAMESPACE= … Read more

Kubernetes config map symlinks (..data/) : is there a way to avoid them?

I think this solution is satisfactory : specifying exact file path in mountPath, will get rid of the symlinks to ..data and ..2018_06_04_19_31_41.860238952 So if I apply such a manifest : apiVersion: v1 kind: Pod metadata: name: my-lamp-site spec: containers: – name: php image: php:7.0-apache volumeMounts: – mountPath: /var/www/html/users.xml name: site-data subPath: users.xml volumes: – … Read more

Failed create pod sandbox: rpc error: code = Unknown desc = NetworkPlugin cni failed to set up pod network [closed]

When I used calico as CNI and I faced a similar issue. The container remained in creating state, I checked for /etc/cni/net.d and /opt/cni/bin on master both are present but not sure if this is required on worker node as well. root@KubernetesMaster:/opt/cni/bin# kubectl get pods NAME READY STATUS RESTARTS AGE nginx-5c7588df-5zds6 0/1 ContainerCreating 0 21m … Read more

Ingress controller vs api gateway

Ingress controller allows single ip-port to access all services running in k8s through ingress rules. The ingress controller service is set to load balancer so it is accessible from public internet. An api gateway is used for application routing, rate limiting, security, request and response handling and other application related tasks. Say, you have a … Read more

Simple ingress from host with microk8s?

TLDR Update the annotation to be kubernetes.io/ingress.class: public Why For MicroK8s v1.21, running microk8s enable ingress Will create a DaemonSet called nginx-ingress-microk8s-controller in the ingress namespace. If you inspect that, there is a flag to set the ingress class: – args: … omitted … – –ingress-class=public … omitted … Therefore in order to work with … Read more

Is there a way to monitor kube cron jobs using prometheus

I’m using these rules with kube-state-metrics: groups: – name: job.rules rules: – alert: CronJobRunning expr: time() -kube_cronjob_next_schedule_time > 3600 for: 1h labels: severity: warning annotations: description: CronJob {{$labels.namespaces}}/{{$labels.cronjob}} is taking more than 1h to complete summary: CronJob didn’t finish after 1h – alert: JobCompletion expr: kube_job_spec_completions – kube_job_status_succeeded > 0 for: 1h labels: severity: warning … Read more

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