I have a question about assigning a static ip address to your service/task that you define on ECS cluster , we're aware that for each task created there is a private and public ip address assigned to it but the problem here is that in case you want to update your task ( or simply if you shut down your task and turn it back on) it will automatically change the ip address, which is not good in prod mode. So how can I set a static ip address and allocate it to each task i create ? I used Network load balancer and network interfaces but it did not work ( the network with the assigned ip address is awlays on "available" status) ?
Thank you
You can use an application load balancer (ALB) over your service, you'll get a URL something like this:
after that, you can use route 53 to redirect this URL to your domain/sub-domain
Related
I have got an authentication service. This service is behind an ingress (GKE in my case) for external API calls. When the signup function of the authentication service is called, it will send an email for email verification purpose. The link in this email has to point to the IP of ingress. In order to achieve that, my authentication service has to know the IP of the ingress. How can this be configured dynamically in k8s without storing the ingress IP[ address in a config file?
Many thanks in advance
Regards
Since by default GKE allocates ephemeral external IP address the simplest solution is to reserve static ip address. This can be done with new one or you can promote existing ephemeral IP to static one. With this solution the IP address is known in advance but the drawback of that the IP would have to be hardcoded into the application.
To avoid hardcoding this you could use nslookup to find ip address for this specific host. With this you should update your dns records with an address type record to point to you reserved static IP address. Please refer to your DNS service`s documentation on setting DNS A records to configure your domain name.
For more reading check how to configure static ip address.
The alternative way would be also to access the Kubernetes REST API directly and fetch the IP address from there. This depending on your architecture and application design will required appropriate authentication towards API.
I built simple cluster in GKE with two services using this tutorial
https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app
After finishing that I'm able to access my service using external IP address. So I bought domain for using this IP address. After setup A record in DNS settings to that IP address, domain doesn't work, it still loads and then show ERR_CONNECTION_TIMED_OUT. Do I need to do something in google console, or how I can make this IP public and accessed through domain?
Please refer to official documentation, which describes steps you need to take to configure domain names with static IP.
There are steps that you need to cover:
Go to NETWORKING section at GCP console, than VPC Network -> External IP addresses to ensure that you are running static IP address, not ephemeral one.
Go to Network services -> Cloud DNS. You need to create DNS zone, where at DNS name line you have to wright your domain name. After creation you will see Add record set, where you need to paste your external IP address.
There is also a good tutorial at YouTube with setting up custom domain on GCP. Let me know if it works for you.
I deployed a service on DC/OS with the following config
when I access this address (http://eureka.marathon.l4lb.thisdcos.directory:8761/) it says the site can't be reached, although all services are healthy on my dashboard.
How can I access the public IP of the service?
I don't know if it is related or not but when I look into the load balancing config of my public slaves, I get 0 of 2 instances in service
<vip-name>.marathon.l4lb.thisdcos.directory:<vip-port> is the internal named virtual IP, configured with the VIP_0 env var in your example.
VIPs are not externally exposed. They are made possible via layer 4 name and IP mapping performed by DC/OS components on each node.
In order to expose a public address you have a few options:
Deploy your app on a public node
Deploy Marathon_LB on a public node and configure your app to be exposed via a virtual host
Set up your own reverse proxy on a public node
Make all your private nodes publicly accessible and then use the host agent node IP and host port
If your app is a Mesos framework, it can register a webui_url for administrative access via the admin router.
in windows command prompt(administrator mode) type "nslookup domain of service".
In your case "nslookup eureka.marathon.l4lb.thisdcos.directory". In your case it will provide all instance ip address.
if your service deployed properly it will give you all instance ip address.
I have successfully created a scale set using (https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-windows-customimage) with one instance from the my custom image:
The custom image has microsoft server data center DS1 V2 and node.js installed in and a copy of my application.
From the new portal I can see the IP of the VM.
I have also successfully started it from the powershell.
However the RDP on that IP with port 3389 or 50000, 50001 are not working.
I tried to add some inboud rules but the situation is same (may inboud rules not correct).
Please can you let me know the steps required after the scale set is created in order to make a RDP ?
You won't be able to connect to the IP of the VM from outside the VNET as each VM has an internal IP address. You need to connect to the public IP of the load balancer (you probably meant that implicitly but being precise just in case).
You will also need to create inbound NAT rules to map a port range on the load balancer public IP address to port 3389 on the backend, and double check that RDP was enabled on the source image before uploading it.
Take a look at this template for an example of inbound NAT rules.. https://github.com/Azure/azure-quickstart-templates/blob/master/201-vmss-windows-nat/azuredeploy.json
Is it possible to get the external IP address for a POD? It doesn't appear to be populating in the environmental variables for a service, so I was wondering if there was another way to get that information.
Basically: I'm setting up a proftpd service, and it needs to send out its external ip as well as a port for passive communication. Right now, it's sending the local IP address which is causing FTP clients to fail.
The kubernetes service discovery mechanism (DNS or environment variable) doesn't populate the external IP.
One way to work around is to create a static IP first, then assign it to your service.
Or you can exec kubectl inside your cluster to get the external IP but that's nasty.