Coreos Clustering Local and Cloud Hosts - coreos

I want to make a coreos cluster consists of local machines behind one public ip address and coreos hosts on a cloud service like digitalocean.
I am wondering whether this is possible? Since all the local machines will have the same public ip address. If this is possible please let me know how to do this setup.
Thank you
Jake He

You can achieve this using DNS since it can hold multiple records for the same domain name. look here
You can achieve this using load balancer - create a virtual IP and a pool with all the local IPs of the CoreOS servers - but take into consideration that some load balancers force you to create a single pool and virtual server for each service port you would like to balance. (Such as bigip-api for instance)

Related

How to create and manage floating IP for a local highly available cluster?

I currently have a highly available cluster for multiple services of my application. The cluster is working without any problem on AWS and now I want to replicate and adapt the whole structure within a local network.
I use Pacemaker/Corosync to share AWS Elastic IP between two HAProxy instances. But I'm not sure if it is possible to create the same flow within my local network since I don't know how to share a single local IP between two of the computers.
Is it possible to manage a single local IP as a floating IP within local network?
Have a look at the HAPROXY with VRRP and Keepalived setup. I will have to do a test in my homelab if you need configs.

DNS to ECS containers

I have an ECS cluster in which I run a task with many container. Three of them need to be reached from the internet. These container are exposed on port 80, 8080 and 8880 of the cluster's ec2 instance.
I have a DNS name registered (say example.com), and I can create a CNAME record that points to the ec2 dns name, but if I do so, the app will be reachable as
example.com:80
example.com:8080
example.com:8880
Instead what I would like to do is to reach the three container like this:
app1.example.com (instead of example.com:80)
app2.example.com (instead of example.com:8080)
app3.example.com (instead of example.com:8880)
I can't do it with the DNS CNAME because is not possible with CNAME to redirect to specific ports.
I hope the question make sense.
Any suggestion from anyone would be appreciate.
Thanks in advance!
You will need to place an AWS Application Load Balancer in front of the ECS containers in order to accomplish this. You would have 3 different target groups (one for each container) and configure the Load Balancer to use host-based routing to send the traffic to the appropriate target group/container.

How do I safely access one Azure VM from another within a Cloud Service and Availability Set

I have an Azure Cloud Service, mywebapp.cloudapp.net, that consists of two Azure VMs - mywebappvm1 and mywebappvm2. Both VMs are in the same Availability Set and have the same DNS name.
I also have a Regional Reserved IP address assigned to the Cloud Service so that I can give our clients a guaranteed IP address that our app uses.
Part of the app uses a private background process, currently only running on one of the VMs. I want to be able to make a connection to that process over TCP running on mywebappvm1 from mywebappvm2. I could use the public IP and an endpoint on mywebappvm1 but I don't want the background service to be publicly accessible.
I'm currently using the private IP address, but is that safe? Will the private IP of each VM change if it's rebooted? I can't see an easy way of fixing the private IP of each VM - that seems like something you can do with a VNET but I can't find any information on how to do it with a cloud service and an availability group as well.
Is there perhaps another way to run a web app on multiple load-balanced VMs within an availability set that would make this easier?
What you do is absolutely safe and actually a recommended best practice. You should not go out to public IP address in order to communicate between the Virtual Machines.
It is also a recommended best practice to organize your Virtual Machines into Virtual Network and sub-nets.
This excellent blog post describes how can you even use static IP addresses for the VMs, so you are always 100% sure that mywebappvm1 always get XXX.XXX.XXX.XXX IP Address andyour mywebappvm2 always get YYY.YYY.YYY.YYY IP Address.
Please note that if you do not use Static IP Address assigned to the VM, it is guaranteed that the IP Address of the VM may change.
The IP for a webRole VM instance will not change for the lifetime of the deployment regardless of reboot, update or swapping. The IP will be released only if you delete the deployment, detailed here

azure multiple public ip for a vm

I want to have three public ip addresses for my VM in azure. I got one when I created the VM and now I want to assign two reserved ip addresses to my VM. I was able to create the reserved ip address but not sure how to assign them to existing VM or assign multiple to a new VM. Any suggestions on how to do this?
In Azure, a Load Balancer is required in order to direct traffic from multiple VIP addresses to a single (or multiple) VMs.
If, for example, you want a single VM to host multiple websites, all of which need to be accessible externally via port 443, you'd need three VIP addresses assigned to the Load Balancer, with a NAT on each at least two of the VIPs; i.e.
Site a: Incoming 443-443 to VM
Site b: Incoming 443-444 to VM
Site c: Incoming 443-445 to VM
All the traffic from the Load Balancer could then be routed to one VM, where you'd direct traffic on each incoming port to the required website based. This MS article explains it really well: https://azure.microsoft.com/en-gb/documentation/articles/load-balancer-multivip/
Reserved IP addresses are a way of ensuring that your VIP is no longer dynamic, which they are by default. The following article explains it well, including how to take an existing Cloud Service's currently-running dynamic VIP and making it static (Reserved): https://azure.microsoft.com/en-gb/documentation/articles/virtual-networks-reserved-public-ip/
An Azure VM can have two public IP addresses - one is the VIP of the cloud service containing the VM (as long as there are endpoints configured for the VM) and the other is the PIP (or public instance IP address) associated with the VM. A reserved IP address is an orthogonal concept to VIPs and PIPs and its use is documented here. I did a post on VIPs, DIPs and PIPs that you may find helpful.

2 vms in one cloud service only one IP?

I created 2 vms, one for centos and another one for azure, I used the same cloud service, but both have the same public IP Address, why>? can I change it?
Or they have to be in different separate cloud services?
By default, they are behind a single IP address which load balances the private IP addresses. Until recently, there was no way to get a public IP for a virtual machine.
Now, it's possible to assign a public IP to a virtual machine:
With Instance-level Public IPs for VMs, you can now assign public IP addresses to your virtual machines, so they become directly addressable without having to map an endpoint through a VIP. This feature will enable scenarios like easily running FTP servers in Azure and monitoring virtual machines directly using their IPs.
We are making this new capability available in preview form today. This feature is available only with new deployments and new virtual networks and can be enabled via PowerShell.
Typically, the load balancer is fine, but there are options if you absolutely need access to individual machines.
Since they're in the same cloud service, they're probably behind the same load balancer, and a load balancer would only have one public IP.
So, yes, I would use different cloud services as you mentioned.

Resources