EKS cluster troubleshooting...
Published: 2024-04-15 17:36:00

Dear fellas,

I have created a EKS cluster for deploying 4 microservices. Using jenkins CICD, i just dockerized them as images and pushed to ECR. From ECR to EKS cluster i deployed using k8s manifest.
But my pods are not up in the clusters.

The error i am facing.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ulxykvguawjbcaz0o6lc.png)



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aisf7e5ny9wqi1uicgao.png)

This is the error when i check logs shown.
E0415 13:59:07.620717  463492 memcache.go:265] couldn't get current server API group list: <html><head><meta http-equiv='refresh' content='1;url=/login?from=%2Fapi%3Ftimeout%3D32s'/><script id='redirect' data-redirect-url='/login?from=%2Fapi%3Ftimeout%3D32s' src='/static/f70bf32a/scripts/redirect.js'></script></head><body style='background-color:white; color:white;'>
Authentication required

Frontend-deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
  labels:
    service: frontend
spec:
  replicas: 2
  selector:
    matchLabels:
      service: frontend
  template:
    metadata:
      labels:
        service: frontend
    spec:
      serviceAccountName: jenkins
      containers:
      - name: frontend
        image: 399600302704.dkr.ecr.ap-south-1.amazonaws.com/placementx:placementx_cicd_frontend_latest
        imagePullPolicy: Always
        ports:
        - containerPort: 5173
        livenessProbe:
          httpGet:
            path: /healthz
            port: 80
          periodSeconds: 60
          timeoutSeconds: 40
        resources:
          limits:
            cpu: 200m
            memory: 100Mi
          requests:
            cpu: 100m
            memory: 50Mi
        env:
        - name: REACT_APP_VITE_CLERK_PUBLISHABLE_KEY
          value: "pk_test_d2VsY29tZWQtbGFtcHJleS05MC5jbGVyay5hY2NvdW50cy5kZXYk"
      restartPolicy: Always

Frontend-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: frontend
  namespace: placementx
spec:
  ports:
  - port: 5173
    protocol: TCP
  type: LoadBalancer
  selector:
   role: frontend


Backend-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: backend
  labels:
    service: backend
spec:
  replicas: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 25%
  selector:
    matchLabels:
      service: backend
  template:
    metadata:
      labels:
        service: backend
    spec:
      serviceAccountName: jenkins
      containers:
      - name: backend
        image: 399600302704.dkr.ecr.ap-south-1.amazonaws.com/placementx:placementx_cicd_backend_latest
        imagePullPolicy: Always
        ports:
        - containerPort: 8001
        livenessProbe:
          httpGet:
            path: /healthz
            port: 80
          periodSeconds: 50
          timeoutSeconds: 20
        env:
        - name: DB_ENGINE # Set environment variables as needed for Django
          value: "django.db.backends.mysql"
        - name: DB_NAME
          value: "placementx"
        - name: DB_USER
          value: "heycampus"
        - name: DB_HOST
          value: "43.205.144.116"
        - name: DB_PORT
          value: "3306"
        - name: DB_PASSWORD
          value: "Hbs001@#"
        - name: SECRET_KEY
          value: "django-insecure-3%d46*bcm#6qe1p-pq6xvwpg*5r(itl2(0-cj&1@po8^gz-8ug"
        resources:
          limits:
            cpu: 200m
            memory: 100Mi
          requests:
            cpu: 100m
            memory: 50Mi
      restartPolicy: Always

Backend-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: backend
  namespace: placementx
spec:
  ports:
  - port: 8001
    protocol: TCP
  type: ClusterIP
  selector:
    role: backend

Please help me on this.