ChristianTremblay / BAC0

BAC0 - Library depending on BACpypes (Python 3) to build automation script for BACnet applications
GNU Lesser General Public License v3.0
170 stars 98 forks source link

BAC0 on kubernetes #460

Open CSEGarazas opened 1 month ago

CSEGarazas commented 1 month ago

Hi, Im trying to run BAC0.lite() on kubernetes container But I cant init BAC0 device. I`m getting such log and error:

Initializing bacnet connection for worker. 2024-07-19 14:46:18,180 - INFO | Starting BAC0 version 21.02.25 (Lite) 2024-07-19 14:46:18,180 - INFO | Use BAC0.log_level to adjust verbosity of the app. 2024-07-19 14:46:18,180 - INFO | Ex. BAC0.log_level('silence') or BAC0.log_level('error') 2024-07-19 14:46:18,181 - INFO | Starting TaskManager 2024-07-19 14:46:18,181 - INFO | Using ip : x.x.x.x:47810 2024-07-19 14:46:18,182 - ERROR | an error has occurred: [Errno 99] Cannot assign requested address

Any ideas why BAC0 bind ip and port to kubernetes container?

ChristianTremblay commented 1 month ago

When ip is not provided, it tries to reach google.com and bind to the interface that gives a response.

bbartling commented 1 month ago

I don't know about kubernetes containers but aren't those meant for scaling up cloud based apps? BACnet is an "intranet" local area network protocol behind the fire wall... Do people use kubernetes for that? Or can you just run in a docker container or Linux systemd service..?

On Fri, Jul 19, 2024, 1:49 PM Christian Tremblay @.***> wrote:

When ip is not provided, it tries to reach google.com and bind to the interface that gives a response.

— Reply to this email directly, view it on GitHub https://github.com/ChristianTremblay/BAC0/issues/460#issuecomment-2239913349, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHC4BHIXRMJH6GMBMECHOR3ZNFNVPAVCNFSM6AAAAABLEN7Q4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZZHEYTGMZUHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

CSEGarazas commented 1 month ago

When ip is not provided, it tries to reach google.com and bind to the interface that gives a response.

Instead x.x.x.x Im using Kubernetes POD ip address . And I dont know why but it cant bind IP address. Priviously I was running my app in docker desktop. And BAC0 library work perfectly on container. But now we need scale our app by clients. And for this reason why would like to use Kuberntes services. I cant find any reason why it`s not working ...

bbartling commented 1 month ago

Are you running a BACnet app on the cloud and making BACnet requests across the internet through VPN service??

On Sun, Jul 21, 2024 at 2:16 PM CSEGarazas @.***> wrote:

When ip is not provided, it tries to reach google.com and bind to the interface that gives a response.

Instead x.x.x.x Im using Kubernetes POD ip address . And I dont know why but it cant bind IP address. Priviously I was running my app in docker desktop. And BAC0 library work perfectly on container. But now we need scale our app by clients. And for this reason why would like to use Kuberntes services. I cant find any reason why it`s not working ...

— Reply to this email directly, view it on GitHub https://github.com/ChristianTremblay/BAC0/issues/460#issuecomment-2241746644, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHC4BHL626ANCDQXJZLBHULZNQCJBAVCNFSM6AAAAABLEN7Q4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBRG42DMNRUGQ . You are receiving this because you commented.Message ID: @.***>

CSEGarazas commented 1 month ago

Firstly, I'm trying to initiate the BAC0 app, but I get an error during initialization. I tried to expose the port, but it didn't help. If I succeed in initiating the BAC0 app, I will send requests to the controller, which will be in a private VPN network.

ChristianTremblay commented 1 month ago

Have you tried initializing BAC0 using the IP of the VPN interface ?