Get IP of application in local cluster - azure-service-fabric-mesh

I followed Microsoft's tutorial and learned that I can run this command
az mesh gateway show --resource-group Mesh --name todolistappGateway
to find the IP address I need to call to access my application in the cloud. How do I find the IP I should call to access the instance of my application running in my local service fabric mesh cluster? If I start debugging in Visual Studio, it opens a browser which contains the IP I need but what is the correct way to find this?

docker inspect on the application container (not the reverse proxy) will give you the same IP address as what's being launched by Visual Studio but I'm still not certain that's the best way.

Related

How to access the application in azure managed kubernetes service

I am very new in a kubernetes world and learning things. I have some situation where i have installed a application(SwaggerHub) in a azure kubernetes service. I follow the installation instructions from swaggerHub documentation. Everything work smoothly and now i have a wondering that how to access the UI via IP address. As per documentation it is required to setup a DNS for this but I guess it is just for production use and for a testing purpose i can access the main UI through IP address.
I tried to access the application from the external IP address which i can see in LoadBalancer service but it is not working. Any idea how i can access the service via IP address ?

How to communicate with the nodeJS server setup in the Google cloud virtual machines(Windows server) through internet?

I am developing a chat app in android using soocket.io. This app needs to communicate with one of the nodejs application listening at port 4000 in my Google cloud Virtual machine through internet.
GCP provided internal and external IP. When I run the internalIP:4000 in browser of VM, I can see it is running fine. But outside of the VM, when I run ExternalIP:4000 it is giving error. I don't know why it is not working.
This is the firewall configurations
So you already established that your service is running fine and is on a correct port (4000).
Now you have to expose to the Internet. By default this port is blocked for any traffic by GCP's Firewall. This way only ports for SSH, RDP or ICMP protocols are open to be able to connect to your VM's. If you need non-standard port you have to create apropriate firewall rule.
You can create it by running using Cloud Shell or running this in your VM's command prompt:
gcloud compute --project=my-project-name firewall-rules create my-app-port \
--direction=INGRESS --priority=1000 --network=default \
--action=ALLOW --rules=tcp:4000 --source-ranges=0.0.0.0/0 \
--target-tags=my-app-server
or create it using Cloud Console. Have a look at the documentation if you have any doubts.
In my example I used my-app-server network tag. You need to add it to your VM that runs the app server - otherwise the rule won't work. It's best to do it this way since you're only exposing one additional port on a single VM which is safest possible solution.

Azure WebApp - Get Private IP of a service connected on VNET

I have a Azure WebApp inside the VPN. When I go on networking I see the connection like this:
When I click on "Click here to configure"it appears to be up & running:
So, everything appears OK.
The VPN externally connects BUT where can I find the Internal "VPN" IP Address of this Web App?
If I go on configurations / SCM etc I can only find the "external" IP!
Thanks
If you have a normal App Service then you can't get it's IP, mainly because the application is running on a distributed environment and the exact location of the instance might change with little notice.
If you need a dedicated public (or private) IP, then I recommend you have a look at Azure App Service Enviroments.

Kubernetes DNS / Endpoint

So I am fairly new to Kubernetes. I am a Windows user (sorry) and have installed Minikube. I am trying to learn Kubenetes using MiniKube. I have created very simple REST API that should work with port 5000 exposed where there is a simple route /Hello/{somestring}
I have created a POD/Deployment and Service for this successfully in MiniKube like this
minikube.exe start --kubernetes-version="v1.9.0" --vm-driver="hyperv" --memory=1024 --hyperv-virtual-switch="Minikube Switch" --v=7 --alsologtostderr
kubectl run simple-sswebapi-pod-v1 --replicas=1 --labels="run=sswebapi-pod-v1" --image=sachabarber/sswebapp:v1 --port=5000
kubectl expose deployment simple-sswebapi-pod-v1 --type=NodePort --name=simple-sswebapi-service
kubectl get services simple-sswebapi-service
Which I can then grab the url from and paste into my browser like so
minikube service simple-sswebapi-service --url
Which gives me this URL
http://192.168.0.29:32246
Which I then try in the browser on my host, all is good my REST API is running as expected
But from what I have read, I believe I should be able to ALSO use a DNS name for the service rather than this url returned above.
In fact I am not sure what this IP address returned as part of the --url command is trying to tell me above. It is not one of the ones listed for the service endpoints for is it for the POD from what I can tell from the Dashboard.
This is the service
This is the POD
Shouldn't there be a DNS name available for the service that I should be able to use instead of this fairly hacky way of grabbing the url from the service I just created. Someone please let me know what this --url even represents. I am lost here
I have checked that the DNS add on is enabled in MiniKube it is, see kube-dns in list below
As I say this is also what I see for the service inside of the MiniKube Dashboard
This confused me even more as I cant seem to tie any of that back to the ONLY IP address that seems to actually work for me, which is the one I grabbed using this line from the service
.\minikube.exe service simple-sswebapi-service --url
This Ip Address is not shown in the dashboard at all.
I thought the service should be available at DNS name something like:
simple-sswebapi-service.default.svc.cluster.local
Which is the
The name of the service
The namespace
svc to tell its a service
Just for completeness this is me describing the service in command line
What am I missing?
Is my mental mode wrong. I should be able to see this service using a DNS in the host too? Or is the DNS name ONLY available inside the PODS?
kube-dns is internal DNS. You can only use the DNS name for a service from inside the cluster.
Since your service type is Nodeport, you can connect to the service using the IP of the machine (minikube) on that port.

How to use NEST/elasticsearch with Azure?

I got a website (Web App) running on Azure (example.azurewebsites.net) and I want to use NEST (http://nest.azurewebsites.net) in my Asp.Net MVC solution. Locally it works fine, but when publishing it to Azure, I can't get a connection to elasticsearch. Because I did not found any useful tutorial, I mixed three together.
First I created a virtual network like described here in Step 1: http://www.kerrb.com/ecAzureVms101/day4-creating-point-to-site-vpn-to-azure-virtual-machines
I called it VirtualNetwork and got a Gateway-IP-Adress. It shows me that 1 Client is connected.
Then I created a virtual machine like described here: http://code972.com/blog/2014/07/74-the-definitive-guide-for-elasticsearch-on-windows-azure
I already had the virtual network, so I skipped the first step here. The cloud service got the name example-elastic-search (example-elastic-search.cloudapp.net) I called the virtual machine elasticsearchvm. I connected via putty, configured elasticsearch like described and I it works fine.
The last step with Azure was to connect the Web App with the virtual network. I did it like this: http://blogs.technet.com/b/canitpro/archive/2015/04/07/step-by-step-connect-an-azure-web-app-to-an-existing-virtual-network.aspx
Finally I changed my code to use the elasticsearchvm.
new ElasticClient(new ConnectionSettings(new Uri("http://example-elastic-search.cloudapp.net")))
Instead of example-elastic-search.cloudapp.net I also tried the name of the virtual machine (elasticsearchvm), the internal and public IPs of the VM, the IP of the cloud service and the IP of the gateway. All of these with http, https, the port and without the port (9200). Nothing worked.
Any ideas, what I have missed? If more informations are needed, feel free to ask :)
I realise that this is not directly answering your question, but I think this is useful to mention for those finding this question in future. The easiest way to get up and running with Elasticsearch on Azure is to use Elastic's ARM template; I wrote a blog post about some of the features available within the template.
The template can be deployed from within the portal UI or using the Azure CLI; the former is good for getting started and playing around, and the latter is useful to integrate the template into your automation environment of choice. You can of course clone/fork the repository and make changes to the template to suit your requirements.
When adding Elasticsearch to an existing web application, the deployed cluster can be attached to an existing virtual network in the same location; you just need to specify
the name of the network
the name of the subnet
the name of the resource group containing the network
An available IP address to use for the internal load balancer
You'll need enough available IP addresses on the network for the cluster you're deploying.

Resources