Commit graph

382 commits

Author SHA1 Message Date
Abhishek K 5a561b3835
Net 1440 batchpeerupdate (#3042)
* NET-1440 scale test changes

* fix UT error and add error info

* load metric data into cacha in startup

* remove debug info for metric

* add server telemetry and hasSuperAdmin to cache

* fix user UT case

* update sqlite connection string for performance

* update check-in TS in cache only if cache enabled

* update metric data in cache only if cache enabled and write to DB once in stop

* update server status in mq topic

* add failover existed to server status update

* only send mq messsage when there is server status change

* batch peerUpdate

* code changes for scale for review

* update UT case

* update mq client check

* mq connection code change

* revert server status update changes

* revert batch peerUpdate

* remove server status update info

* batch peerUpdate

* code changes based on review and setupmqtt in keepalive

* set the mq message order to false for PIN

* remove setupmqtt in keepalive

* add peerUpdate batch size to config

* update batch peerUpdate

* recycle ip in node deletion

* update ip allocation logic

* remove ip addr cap

* remove ippool file

* update get extClient func

* remove ip from cache map when extClient is removed

* add batch peerUpdate switch

* set batch peerUpdate to true by default

---------

Co-authored-by: Max Ma <mayabin@gmail.com>
2024-08-16 15:35:43 +05:30
Max Ma 46b8fd21c8
NET-1440: scale test changes (#3014)
* NET-1440 scale test changes

* fix UT error and add error info

* load metric data into cacha in startup

* remove debug info for metric

* add server telemetry and hasSuperAdmin to cache

* fix user UT case

* update sqlite connection string for performance

* update check-in TS in cache only if cache enabled

* update metric data in cache only if cache enabled and write to DB once in stop

* update server status in mq topic

* add failover existed to server status update

* only send mq messsage when there is server status change

* batch peerUpdate

* code changes for scale for review

* update UT case

* update mq client check

* mq connection code change

* revert server status update changes

* revert batch peerUpdate

* remove server status update info

* code changes based on review and setupmqtt in keepalive

* set the mq message order to false for PIN

* remove setupmqtt in keepalive

* recycle ip in node deletion

* update ip allocation logic

* remove ip addr cap

* remove ippool file

* update get extClient func

* remove ip from cache map when extClient is removed
2024-08-15 11:59:00 +05:30
Max Ma 65faf73fe9
NET-1226: Scalability Improvements (#2987)
* add api to check if failover node existed

* remove 5 minute peerUpdate

* update peerUpdate to trigger pull

* update Action name to SignalPull

* revert the peerUpdate from SignalPull

* fix getfailover error issue

* rm acls creation for on-prem emqx

* remove use of acls

* add additional broker status field on status api

* NET-1165: Remove creation of acls on emqx (#2996)

* rm acls creation for on-prem emqx

* remove use of acls

* add additional broker status field on status api

* comment out mq reconnect logic

* configure mq conn params

* add metric_interval in ENV for publishing metrics

* add metric_interval in ENV for publishing metrics

* update PUBLISH_METRIC_INTERVAL env name

* revert the mq setttings back

* fix error nil issue

---------

Co-authored-by: abhishek9686 <abhi281342@gmail.com>
Co-authored-by: Abhishek K <32607604+abhishek9686@users.noreply.github.com>
2024-07-09 18:56:55 +05:30
Abhishek K 7ff30599ed
NET-1252: Restrict inetGws, Relays from getting failedOver (#2937)
* add additional checks to avoid failovers

* add failover defence check on signal handler

* only add check for victim node

* avoid failover reset on pull

* add relayed for failoverme

* misc changes for failover

* remove resetfailoverpeers for InetNode

* add egress route back to allowedip list if relayed is egressGW

* add extclient back to allowedip list if peer is ingressGW

* reset failover on pull

---------

Co-authored-by: Max Ma <mayabin@gmail.com>
2024-06-03 10:49:02 +04:00
abhishek9686 72577a96d9 replace peer on first peer update 2024-05-17 12:02:47 +05:30
abhishek9686 3ed183344b send peer update on startup 2024-05-17 11:28:53 +05:30
Max Ma 86fac41868
fix metric exporter mq connection issue (#2925) 2024-05-08 12:13:11 +05:30
guangwu 4a2e2190fc
fix: close resp body (#2909) 2024-04-30 09:13:08 +05:30
abhishek9686 5ff9289462 set random id 2024-04-16 10:50:31 +05:30
Max Ma 961f8eab6e
NET-1119 (#2886)
* exclude IngressGW in failover

* resetfailoverpeer when adding IngressGw if failover enabled

* exclude InetGW in failover

* get egress ranges of failedover peer

---------

Co-authored-by: abhishek9686 <abhi281342@gmail.com>
2024-04-12 18:22:03 +05:30
Abhishek K 66069fbc34
NET-1082: Scale Testing Fixes (#2894)
* add additional mutex lock on node acls func

* increase verbosity

* disable acls on cloud emqx

* add emqx creds creation to go routine

* add debug log of mq client id

* comment port check

* uncomment port check

* check for connection mq connection open

* use username for client id

* add write mutex on acl is allowed

* add mq connection lost handler on server

* spin off zombie init as go routine

* get whole api path from config

* Revert "get whole api path from config"

This reverts commit 392f5f4c5f.

* update extclient acls async

* add additional mutex lock on node acls func

(cherry picked from commit 5325f0e7d7)

* increase verbosity

(cherry picked from commit 705b3cf0bf)

* add emqx creds creation to go routine

(cherry picked from commit c8e65f4820)

* add debug log of mq client id

(cherry picked from commit 29c5d6ceca)

* comment port check

(cherry picked from commit db8d6d95ea)

* check for connection mq connection open

(cherry picked from commit 13b11033b0)

* use username for client id

(cherry picked from commit e90c7386de)

* add write mutex on acl is allowed

(cherry picked from commit 4cae1b0bb4)

* add mq connection lost handler on server

(cherry picked from commit c82918ad35)

* spin off zombie init as go routine

(cherry picked from commit 6d65c44c43)

* update extclient acls async

(cherry picked from commit 6557ef1ebe)

* additionl logs for oauth user flow

(cherry picked from commit 61703038ae)

* add more debug logs

(cherry picked from commit 5980beacd1)

* add more debug logs

(cherry picked from commit 4d001f0d27)

* add set auth secret

(cherry picked from commit f41cef5da5)

* fix fetch pass

(cherry picked from commit 825caf4b60)

* make sure auth secret is set only once

(cherry picked from commit ba33ed02aa)

* make sure auth secret is set only once

(cherry picked from commit 920ac4c507)

* comment usage of emqx acls

* replace  read lock with write lock on acls

* replace  read lock with write lock on acls

(cherry picked from commit 808d2135c8)

* use deadlock pkg for visibility

* add additional mutex locks

* remove race flag

* on mq re-connecting donot exit if failed

* on mq re-connecting donot exit if failed

* revert mutex package change

* set mq clean session

* remove debug log

* go mod tidy

* revert on prem emqx acls del
2024-04-11 21:18:57 +05:30
Max Ma 5740c3e009
Net 1115 (#2890)
* add endpointipv6 for host

* keep endpointipv6 unchanged when enable static endpoint

* handle ipv6 endpoint updates

---------

Co-authored-by: abhishek9686 <abhi281342@gmail.com>
2024-04-11 17:37:45 +05:30
Abhishek K c7e673fb9f
ACC-532: set mq clean session to true (#2865)
* set clean session

* delete emqx hosts creds api

* add emqx hosts del api to limited middleware controller

* add emqx hosts del api to limited middleware controller

* remove server creds from emqx
2024-03-20 15:03:41 +07:00
abhishek9686 a5dff67bfd delete server user on start up to re-initialize 2024-03-05 11:48:24 +07:00
abhishek9686 01592b2ecc add additional logging 2024-02-29 19:58:18 +07:00
abhishek9686 4630925182 send pull syn over old mq for emqx migration 2024-02-29 13:30:51 +07:00
abhishek9686 eb28faf669 add emqx migration func 2024-02-28 17:57:25 +07:00
abhishek9686 b5db86d1a7 format emqx urls 2024-01-26 10:45:55 +05:30
abhishek9686 fb0fead2f0 create emqx for server, get app creds from env 2024-01-26 10:24:29 +05:30
abhishek9686 b40ce30af5 implement node acls cloud api func 2024-01-26 00:19:29 +05:30
abhishek9686 6d3de8d565 node acls 2024-01-25 22:27:57 +05:30
abhishek9686 c556e9d77d add host acls and create user cloud emqx funcs 2024-01-25 18:24:43 +05:30
abhishek9686 155f2887b2 implement emqx interface methods for cloud and on-prem 2024-01-25 15:11:16 +05:30
Abhishek K 465f2bd5be
NET-896: Scale test bug fixes (#2764)
* send peer update in async

* update metrics on fallback

* return http json response
2024-01-15 23:17:36 +05:30
Abhishek K 5bf30b2c10
NET-877: Replace peers on Refreshkeys peer update (#2761)
* replace peers on key refresh

* add peer conf to metrics map only when allowed
2024-01-11 15:59:19 +05:30
Farukh Khan 1f9ef50df7
NET-655 (#2670)
* NET-655

* Updated HostPull structure to include EgressRoutes and FirewallUpdate models.

* added ServerVersion structure to hostpull model

* added ServerVersion structure to hostpull model

* removed ServerVersion structure

* removed ServerVersion structure

* added egressroute and fwupdate to hostpull handler

* add host update fallback handler

* set broker type on server cfg

* use actual host password to create emqx user

---------

Co-authored-by: Christopher Blaha <crispspiceguitar@gmail.com>
Co-authored-by: Abhishek Kondur <abhi281342@gmail.com>
2023-12-21 10:43:06 +04:00
Abhishek K 7e3bf3baea
NET-812: Deprecate Setting /etc/hosts entries (#2733)
* deprecate setting etc host dns entries, set coredns entries at neccessary places

* remove dns mq topics

* only set dns when set on

* add extcleints dns entries to coredns

* fix static checks

* run coredns with host network mode

* add bind address to coredns container
2023-12-20 10:24:53 +04:00
Abhishek K 98c01c4325
NET-814: Deprecating TURN (#2723)
* deprecate turn

* process signals through mq
2023-12-13 22:46:57 +04:00
Abhishek K b78cc0a8a1
NET-725: Failovers (#2685)
* api to  to get host relayed from client

* add auto relay to api host

* add peer nat type

* set pro field on signal

* rm net check on relay me handler

* return success response

* re-establish failover logic

* set failOver ctx

* failOver with peer pub key

* failovered peer updates

* failover handlers, reset failovered peer on deletion

* rm unused funcs

* initialize failover handler on EE

* ignore failover node on signal

* failover changes

* set host id on signal

* extend signal model to include node ids

* add backwards compatibility

* add failover as node api

* set json response on failover handers

* add failover field to api node

* fix signal data check

* initialize failover peer map

* reset failovered status when relayed or deleted

* add failover info to api node

* reset network failover

* only proceed furtuer if failover exists in the network

* set failOver node defaults

* cannot set failover node as relayed

* debug log

* debug log

* debug changes

* debug changes

* debug changes

* revert debug changes

* don't add peers to idmap when removed

* reset failed Over

* fix static checks

* rm debug log

* add check for linux host
2023-11-29 20:10:07 +04:00
Abhishek K 27378b9c52
NET-765: publish deleted node update on disconnect (#2668)
* publish deleted node update on disconnect

* delete any daemon node

* set peer update for disconnected Node

* set peer update for disconnected Node
2023-11-15 19:53:52 +04:00
Abhishek K 83e83f8392
NET-751: Send deleted node peer update on uninstall (#2665)
* send deleted node peer update, when deleted host from client

* remove duplicate peer update
2023-11-10 11:37:38 +04:00
Abhishek K 7169db78ea
NET-717: DNS Fixes (#2654)
* send dns with complete entry name

* publish dns records on adding host to network from UI

* publish node dns updates when host is removed
2023-11-08 17:43:41 +04:00
guangwu 92260170f5
fix: typo (#2624) 2023-10-24 20:52:40 +04:00
Matthew R Kasun 83f2f2ef28
publish node update on ifcace change (#2600) 2023-09-28 14:28:19 +04:00
pwillis7 fe842e0f05
feat(NET-591): allow generic DNS entries (#2568) 2023-09-20 14:20:08 +02:00
Gabriel de Souza Seibel 1a1ba1ccf4
[NET-546] Move ee code to ee package, unify ee status and terminology (#2538)
* Move ee code to ee package and unify ee status to IsPro

* Consolidate naming for paid/professional/enterprise version as "pro". Notes:

- Changes image tags
- Changes build tags
- Changes package names
- Doesn't change links to docs that mention "ee"
- Doesn't change parameters sent to PostHog that mention "ee"

* Revert docker image tag being -pro, back to -ee

* Revert go build tag being pro, back to ee

* Add build tags for some ee content

* [2] Revert go build tag being pro, back to ee

* Fix test workflow

* Add a json tag to be backwards compatible with frontend "IsEE" check

* Add a json tag for the serverconfig struct for IsEE

* Ammend json tag to Is_EE

* fix ee tags

---------

Co-authored-by: Abhishek Kondur <abhi281342@gmail.com>
2023-09-01 07:42:05 +05:30
Farukh Khan 8be0409b6a
NET-555 (#2524)
* IoT peer updates remove flag is now only triggering on relay deletion. Not triggering on extclients deletion anymore.

* Small typo fix on publish dns update for new extclient function name.
2023-08-25 14:23:01 +05:30
Abhishek K 97f21d8b45
don't reference host on err (#2493) 2023-08-02 22:01:41 +05:30
Abhishek K 645bc4c126
NET-447: Removed proxy related fields and code (#2459)
* remove related fields and code

* remover metrics collection from server code

* fw update struct

* add ext client flag to metrics data

* simply nat types

* rm proxy update from cli
2023-07-26 11:22:49 +05:30
Abhishek Kondur 086ef25ac6 remove peer update context 2023-06-29 00:17:42 +05:30
Abhishek Kondur 950a303f66 Merge branch 'develop' of https://github.com/gravitl/netmaker into NET-390-scale-latest 2023-06-28 23:10:00 +05:30
Abhishek Kondur b64cef3447 fix merge conflicts 2023-06-28 22:12:30 +05:30
Abhishek Kondur eca3a16f9a broadcast port changes 2023-06-28 22:10:25 +05:30
Abhishek K 38454ece79
IOT-66: Single Peer update for IOT client (#2424)
* send peer update to IOT client only when it is relayed

* move node check

* send relay del update for iot client

* fix relay delete logic for iot

* set relay node to true for iot peer update

* add node addrs to peer update

* revert tag
2023-06-28 22:08:49 +05:30
Abhishek Kondur 1a67b4e49b Merge branch 'NET-390-endpointdetection-config-fix' of https://github.com/gravitl/netmaker into NET-390-scale-latest 2023-06-28 21:05:38 +05:30
Abhishek Kondur 4efbe6256f stop context cancel on peer updates 2023-06-28 21:05:21 +05:30
Abhishek K 230e062c84
GRA-1298: License check changes, free tier limits for saas (#2418)
* set free tier limits through config

* add host limit to config

* check for host limit on free tier

* fix license validation, replace node limit with hosts

* add hosts to telemetry data

* debug init

* validate license every 1hr

* hook manager, api to fetch server usage

* hook manager, server usage api

* encode json server usage api

* update ngork url

* update license validation endpoint

* avoid setting limits on eer

* adding hotfix

* correct users limits env var

* add comments to exported funcs

---------

Co-authored-by: afeiszli <alex.feiszli@gmail.com>
2023-06-28 20:33:06 +05:30
Abhishek Kondur 8d874b876b set mq order matters to false 2023-06-28 08:34:14 +05:30
Abhishek Kondur 243cc74490 remove endpoint detection from host model 2023-06-27 22:36:24 +05:30
Aceix 9787ce6ae8
fix(NET-312): increase log levels for verbose logs (#2403) 2023-06-20 16:28:40 +05:30