Dapr service invocation between VMs over DNS-SD/Bonjour - dapr

I have two VMs (same host machine) running Windows Server 2019. One of them is running a sample .NET server via dapr (slim init)
dapr run --app-id weather-service --app-port 5001 -- .\WeatherService.exe
Invoking some endpoint from the same VM seems to work perfectly fine
dapr invoke --app-id weather-service --method weatherforecast --verb GET
The issue is, dapr cannot find the service when issuing the exact same invoke command from the other VM:
error invoking app weather-service: app ID weather-service not found
I checked that the two VMs are in a virtual network (ping works fine), Bonjour is installed on both of them and the second VM seems to recognize the dapr service running:
dns-sd -B _services._dns-sd._udp
Browsing for _services._dns-sd._udp
Timestamp A/R Flags if Domain Service Type Instance Name
8:50:48.331 Add 2 3 . local.local. weather-service
Any ideas what I might be doing wrong here? Any hints as for how to diagnose this issue?

Related

How to add additional options to docker run on Azure Service App

I am trying to run docker run -i --rm -d --cap-add=SYS_ADMIN --name <azure-container> <azure-container-registry>/<image-name>:<tag>
By default the container is created using docker run -p port1:port2
I want to remove the -p option and add --cap-add=SYS_ADMIN , every time my container gets created from azure container registry using App Service.
Any help appreciated.
Regards,
Aarushi
Unfortunately, the docker command cannot be custom when you deploy your image to Azure Web App. It runs by Azure. You can add the environment variables in the App Setting, but not change the docker command.
You cannot run a container without exposing a port, on App Services. It needs to run a server process in order to become 'healthy'. You can use port 80 (default) or 8080.
Also, as Charles Xu said, you cannot add capabilities at this time.
In Service Fabric you have more port mapping options, but you should still expose a port for the liveness probe.
No cap-add support here either.

Can't stop my custom windows service via gitlab-runner

This is my first question on stackoverflow. Hope your eyes won't be bleeding too much from my English.
Long story short: I can't stop my custom windows service via gitlab-runner.
What I'm trying to achieve during gitlab CI\CD is:
send a signal to my service to stop doing his job
periodically check this service status to determine whether it is stopped or not
So, I've install shell gitlab-runner locally for ease and gitlab server sees my local runner.
My windows service has name in the following format: "My.Service.Name".
gitlab-ci.yml contains job <my_job_name> with following command inside script section sc.exe queryex My.Service.Name (trying to get service status).
Command execution gives me error [SC] EnumQueryServicesStatus:OpenService FAILED 1060: The specified service does not exist as an installed service.
Basically, sc.exe stop My.Service.Name also failed with error [SC] OpenService FAILED 1060: The specified service does not exist as an installed service.
My service was created this way: sc create My.Service.Name binPath= "path\to\exe\My.Service.Name.exe -service" DisplayName= My.Service.Name start= delayed-auto depend= MSMQ.
Local query result of sc.exe queryex My.Service.Name call.
I was already checked this:
my service exists and has same service and display names in services.msc (My.Service.Name)
service name didn't contain any spaces (in case of missing quotes)
simple command sc.exe queryex (via gitlab-runner) gives me not all services, that I can see in services.msc locally
alternative command also not giving me all services from services.msc Get-Service -ComputerName . (via gitlab-runner)
same commands executed locally gives me desired result via both sc.exe sc.exe queryex My.Service.Name and
Get-Service in PowerShell Get-Service | where {$_.name -like "*My.Service.Name*"} or Get-Service -ComputerName .
both services gitlab-runner and My.Service.Name are running with my local administrator account
local run gitlab-runner.exe exec shell my_job_name gives me desired result also, so I can query service information and even stop service
based on similar questions, I also checked that windows RPC services are enabled and currently running
So, why some services, including my service, are not listed in results of sc.exe and Get-Service (via gitlab-runner)? I suspect some permission issues here.
Any help will be appreciated.
I finally get what is wrong - I messed up with gitlab-ci.yml job tags and in fact, another gitlab-runner processed incoming build. Now it's working as expected.

azure kubernetes dashboard not configured

I have a cluster configured on azure kubernetes . and the services are working fine.
following this article
https://learn.microsoft.com/en-us/azure/aks/kubernetes-dashboard
i am trying to view dashboard using but get the error as follows
az aks browse --resource-group DemoRG--name aksdemo2
Proxy running on http://127.0.0.1:8001/
Press CTRL+C to close the tunnel...
Error: unknown flag: --address
My cluster does not have RBAC enabled , i am unsure if this is related to network issue or something different.
Eventaully issue was resolved by author of this post by following existing github issue #8642:
I had two copies of kubectl and the one from docker was overriding the
one from azure. Found this by firing "where kubectl" from command
prompt, and deleting the docker copy.
Just run kubectl proxy then go to following URL
http://localhost:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/#!/overview?namespace=default
I used kubectl proxy to access the dashboard

Azure Hyperledger Fabric Single Member Blockchain setup

I'm starting to use Azure to host a multi node Hyperledger network. I've previously been running on a local environment, but would like to use Azure. I've deployed the 'Hyperledger Fabric Single Member Blockchain' template, which creates five VM's (one each for a CA, orderer and three peers). My local environment uses a CLI, but this doesn't seem to be in the Azure template. How do i interact with the blockchain network without the CLI?
Are there any tuturials for how to use the deployed environment after its been setup?
I've SSH'd to all of the three VM's that are hosting the peers, there seems to be an error with the docker container that has been automatically setup by deploying the Azure template. Running 'docker ps' shows that they are restarting reguarly, and i can't connect using the command docker exec -it bash (i get an error saying that its restarting). Eg:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
817bbb256e5b hyperledger/fabric-peer:x86_64-1.0.0-alpha "peer node start -..." 7 hours ago Restarting (2) 6 seconds ago sad_clarke
Does anyone have the Hyperledger Fabric Single Member Blockchain template working?
Thanks
Paul
To interact with Hyperledger on Azure, you may indeed ssh into one of the VMs. Once there, you can use docker exec -it <container-name> bash to get a prompt in the the docker image running on that VM (ca, peer or orderer). In there you can issue commands.
I got the docker restarting error you mentioned after rebooting the VMs (but not immediately after deployment). I believe there is a bug in the MS deployment script. The configure-fabric-azureuser.sh uses cacert="/etc/hyperledger/fabric-ca-server-config/${PEER_ORG_DOMAIN}-cert.pem" but after replacing with cacert="/etc/hyperledger/fabric-ca-server-config/ca.${PEER_ORG_DOMAIN}-cert.pem" all my problems with docker image restarting or running Hyperledger Composer tutorial were gone. I posted a fix on https://github.com/fabienpe/azure-hyperledger-artifacts
Have you checked the config.log files on each VM?

Unable to connect with Azure Container Services - Kubernetes

I am working on setting up environment for deploying microservices.
I have gotten as far as building my code and deploying to a registry but having problem running it in Azure Container Services.
I am following this guide to connect to ACS: https://learn.microsoft.com/en-us/azure/container-service/container-service-connect
But i fail on the step: Download Cluster Credentials
Using the given command
az acs kubernetes get-credentials --resource-group=<cluster-resource-group> --name=<cluster-name>
Ofc changing the reseource group and clustername to the correct names from my portal. I get an error:
[WinError 10049] The requested address is not valid in its context
(if i change resource group or clustername to something else I get other errors so seems it can find those at least)
When i try to search for the error it seems to be some IP adress problem but can't figure out what to do. Tried running same command from other network (from home) to make sure work firewall is not blocking something.. but I get the same error
Any help appriciated!
This command copy the cluster credentials to your machine. Background processes are ssh to your cluster VM and copy the credentials.
So, you should ensure you could ssh to the master VM manual. If you could not ssh to master VM manual, az command also could not do it. You could get your master-dns-name on Azure Portal.
ssh -i id_rsa <user>#<master-dns-name>
Notes: If az command does not work and you could ssh to master VM, you could download credentials to your machine. They are same. You could check your link about this.
You also need check your azure cli version. You could use the following commands
az --version
My version is 2.02. It works for me.

Resources