ECS - Images using localhost - amazon-ecs

I have services, one for frontend and one for backend.
I have created 2 images for these services and I would like to deploy them on AWS ECS. Currently, the frontend service communicate with the backend with localhost since it was used locally.
Will it cause issues if I deploy it on AWS on 2 different tasks/instances?
Or is it a way to somehow route localhost from the frontend container to the backend server?

If you deploy the services on 2 different tasks/instances, they could not communicate using localhost. Consider using ECS Service Discovery to manage HTTP and DNS namespaces for your Amazon ECS services, you could refer to the following tutorials:
[1] Tutorial: Creating an Amazon ECS Service That Uses Service Discovery Using the Amazon ECS CLI - https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-cli-tutorial-servicediscovery.html
[2] https://ecsworkshop.com/microservices/

Related

API gateway for services running with Kubernetes?

We have all our services running with Kubernetes. We want to know what is the best practice to deploy our own API gateway, we thought of 2 solutions:
Deploy API gateways outside the Kubernetes cluster(s), i.e. with Kong. This means the clusters' ingress will connect to the external gateways. The gateway is either VM or physical machines, and you can scale by replicating many gateway instances
Deploy gateway from within Kubernetes (then maybe connect to external L4 load balancer), i.e. Ambassador. However, with this approach, each cluster can only have 1 gateway. The only way to prevent fault-tolerance is to actually replicate the entire K8s cluster
What is the typical setup and what is better?
The typical setup for an api gateway in kubernetes is either using a load balancer service, if the cloud provider that you are using support dynamic provision of load balancers (all major cloud vendors like gcp, aws or azure support it), or even more common to use an ingress controller.
Both of these options can scale horizontally so you have fault tolerance, in fact there is already a solution for ingress controller using kong
https://github.com/Kong/kubernetes-ingress-controller

CodeDeploy Blue/Green Deployment listener port at API gateway?

I am working on a complicated structure on AWS, which includes an API gateway for users connecting the website located inside a VPC. In this VPC, I have planned to use ALB to load balancing the traffic from outside to different ECS Fargate tasks.
For own purpose, I have planned to use Blue/Green Deployment in CodeDeploy session for deploying the services located in ECS fargate. From the documentations of AWS, I understand the listener port of production and test environment can be set up at load balancer.
I would like to know whether the listener port can be set up at API gateway. As I hope to use CloudFormation for this approach, it would be better related to it. Thanks!

How to use spring cloud kubernetes discovery on localhost?

I replaced Eureka service with Spring Cloud Kubernetes Discovery to run in kubernetes cluster (microk8s) and it's work fine in k8s without eurika. But how can i use Spring Cloud Kubernetes Discovery for local debug? For example, when i'm starting my microservices local without kubernetes, how can I resolve them by name? Is't necessary to use any local discovery service like Eurika in that case? or is there some other way?
simple way can be to create a network of services via docker-compose file and run docker containers for the applications those need to be communicate with and the main services those you need to debug can be opened in the VSCode like editors.
The service discovery can happen by help of docker-compose and eureka or spring-cloud won't be required.

How to access the Kubernetes external IP as HTTPS

I've deployed a Django app on Azure Kubernetes service using a load balancer service. So far accessing the external IP of the load balancer I'm able to access my application but I need to expose the app for HTTPS requests.
I'm new to Kubernetes and unable to find any article which provides these steps. So please help me with the steps/action I need to perform to make this work.
You need to expose your application using ingress.Here is the doc on how to do it in azure kubernetes service.

Accessing API from outside the on-premises Service Fabric cluster

I am very new to Service Fabric. We are developing an API to run inside a Service Fabric cluster. In production we have a 3 virtual machine cluster. In DEV & UAT, we connect the API directly with the server name, as it is a single PC server. I want to run the API in all 3 nodes, and introduce a API gateway running on top. The gateway will do a bit of load balancing as well. Again, the gateway API will run in a single node and from outside I don't know which node it is running on. How should I communicate to the gateway?
Thank you in advance.
Regards,
Zubi Rabbi
Introduce an external Load Balancer (like Azure Load Balancer) on top of your cluster, to receive and forward traffic to (healthy) cluster services.
I do recommend to run your gateway on all nodes, so it doesn't matter which node you talk to. This increases availability and performance.