EKS FRONTEND AND BACKEND DEPLOYMENT ARCHITECTURE

1

I have an angular and spring boot application that I'd like to deploy on EKS. Angular is on port 80 with an Nginx image in front of it. spring-boot is on port 8000. The container images are on ECR. I want to use fargate class. How do I go about deploying the application as a whole?

1 Answer
0

Hello Joash, If your EKS cluster is currently not setup, here are three good resources to start with:

Regarding Kubernetes manifests, I would go for two deployment objects (one for angular and one for spring boot), services for each and Ingress with an Ingress Controller you have to setup (e.g: Nginx ingress controller or AWS Load balancer controller). Some resources for the ingress controller:

An example of what your angular deployment could look like (without using Helm or Kustomize)

apiVersion: apps/v1
kind: Deployment
metadata:
  name: angular-deployment
spec:
  selector:
    matchLabels:
      app: app.kubernetes.io/name: frontend
  template:
    metadata:
      labels:
        app.kubernetes.io/name: frontend
    spec:
      containers:
      - name: myapp
        image: YOUR_ECR_IMAGE_URI
        resources:
          limits:
            memory: "128Mi"
            cpu: "500m"
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: angular-svc
spec:
  selector:
    app.kubernetes.io/name: frontend
  ports:
  - port: 80
    targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
  labels:
    name: ingress
spec:
  rules:
  - host: example.com
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: angular-svc
            port: 
              number: 80
  - host: api.example.com
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: spring-svc
            port: 
              number: 8000

Let me know if you have any questions

profile picture
answered a year ago
profile picture
EXPERT
reviewed 2 days ago
  • Thank you. when I create a cluster and fargate class via eksctl, my Kube-system namespace, coredns pods work whereas when I use the console to create them, the coredsn pods don't work. Do you know how to set up security groups to allow communication? I look up the ones set by eksctl and got stuck

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions