Categories
Mastering Development System & Network

No traffic getting to EKS pods through ALB

I’m a noob to AWS so please bear with me, but I’m hoping someone can point out where I’ve messed something up with my setup on AWS. The architecture of the application is: 1 VPC with 2 public + 2 private subnets 1 RDS MySQL database within the same VPC 1 Elasticache Redis store within […]

Categories
Mastering Development

Kubernetes: Not able to communicate within two services (different pod, same namespace)

I am not able to communicate between two services. post-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: python-data-deployment labels: spec: replicas: 1 selector: matchLabels: app: python-web-selector tier: backend template: metadata: labels: app: python-web-selector tier: backend spec: containers: – name: python-web-pod image: sakshiarora2012/python-backend:v10 ports: – containerPort: 5000 post-deployment2.yaml apiVersion: apps/v1 kind: Deployment metadata: name: python-data-deployment2 labels: spec: […]

Categories
Mastering Development

How to write nested label_replace queries in prometheus?

I have a metrics of the followinf form: kube_deployment_labels{deployment=”application1-deployment”,endpoint=”http”,instance=”10.273.78.36:8180″,job=”kube-state-metrics”,label_app=”applcation-request-adapter”,label_environment=”dev”,label_version=”dev”,namespace=”default”,pod=”kore-prom-kube-state-metrics-654d86c799-2kqzs”,service=”kore-prom-kube-state-metrics”} I need to perform label replace on namespace to dev_namespace and label_version to dev_version. How to write the nested label_replace statement? I am able to apply the same for them seperately as: label_replace(kube_deployment_labels{label_app=~”.*”,label_environment=~”dev”,label_version=~”dev”}, “dev_namespace”, “$1”, “namespace”, “(.*)”) and label_replace(kube_deployment_labels{label_app=~”.*”,label_environment=~”dev”,label_version=~”dev”}, “dev_version”, “$1”, “label_version”, “(.*)”) How to combine […]

Categories
Mastering Development

Deployment of MVC app in Azure Kubernetes Service failing with error- “Back-off restarting failed container”

I am able to deploy the web app to AKS cluster manually through commands (using kubectl to deploy YAML files) after pushing it to Docker Hub but when I try to automate the same through CI/CD pipelines, the app is not properly deployed to AKS. There is no error recorded at CI/CD level but the […]

Categories
Mastering Development

How to connect front to back in k8s cluster internal (connection refused)

Error while trying to connect React frontend web to nodejs express api server into kubernetes cluster. Can navigate in browser to http:localhost:3000 and web site is ok. But can’t navigate to http:localhost:3008 as expected (should not be exposed) My goal is to pass REACT_APP_API_URL environment variable to frontend in order to set axios baseURL and […]

Categories
Development

Kubernetes services endpoints healtcheck

I’ve created a Kubernetes Service whose backend nodes aren’t part of the Cluster but a fixed set of nodes (having fixed IPs), so I’ve also created an Endpoints resource with the same name: apiVersion: v1 kind: Service metadata: name: elk-svc spec: ports: – port: 9200 targetPort: 9200 protocol: TCP — kind: Endpoints apiVersion: v1 metadata: […]

Categories
Development

gke: ingress is not forwarding to the NodePort service: /healthz was not found on this server

I have too many LoadBalancer services consuming too many external IPs and I’d like to switch to using an Ingress controller. I did the tutorial and everything worked fine with the google provided pods. However, with my pod I am able to hit the NodePort service … ? >curl http://35.223.89.81:32607/healthz OK ? > … but […]

Categories
Development

AWS has per node Pod IP restrictions, pods are stuck at ContainerCreating state

As we all know, AWS has per node Pod IP restriction and kubernetes doesn’t care this while scheduling, pods get scheduled in nodes where no pod IPs can be allocated and pods get stuck at ContainerCreating state as following: Normal Scheduled 114s default-scheduler Successfully assigned default/whoami-deployment-9f9c86c4f-r4flx to ip-192-168-15-248.ec2.internal Warning FailedCreatePodSandBox 111s kubelet, ip-192-168-15-248.ec2.internal Failed create […]

Categories
Development

Can’t get response from Express API in k8s-Skaffold setup

Trying to do something that should be pretty simple: starting up an Express pod and fetch the localhost:5000/ which should respond with Hello World!. I’ve installed ingress-nginx for Docker for Mac and minikube Mandatory: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml Docker for Mac: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml minikube: minikube addons enable ingress I run skaffold dev –tail […]