Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

external gateway servers for GlobalVPN Devices#341

Merged
nxtcoder17 merged 10 commits into
mainfrom
feat/edge-gateway-for-vpn-device
Jun 29, 2024
Merged

external gateway servers for GlobalVPN Devices#341
nxtcoder17 merged 10 commits into
mainfrom
feat/edge-gateway-for-vpn-device

Conversation

@nxtcoder17
Copy link
Copy Markdown
Member

@nxtcoder17 nxtcoder17 commented Jun 20, 2024

Resolves kloudlite/kloudlite#254

Summary by Sourcery

This pull request adds support for external gateway servers for GlobalVPN devices, refactors device management to distinguish between cluster-local and gateway devices, and updates build tasks for multi-architecture support. It also removes unused MatchFilter resolvers and deletes obsolete GitHub workflows.

  • New Features:
    • Introduced support for external gateway servers for GlobalVPN devices, including new GraphQL types and resolvers for managing Kloudlite gateway regions and devices.
  • Enhancements:
    • Refactored existing GlobalVPN device management to distinguish between cluster-local and gateway devices.
    • Updated the Taskfile for the tenant-agent and worker-audit-logging apps to include new build and push tasks with multi-architecture support.
  • Chores:
    • Removed unused MatchFilter resolvers and related code from multiple services.
    • Deleted obsolete GitHub workflows for building and testing binaries and building the gateway.

@nxtcoder17 nxtcoder17 self-assigned this Jun 20, 2024
@nxtcoder17 nxtcoder17 requested a review from karthik1729 as a code owner June 20, 2024 14:58
@nxtcoder17 nxtcoder17 marked this pull request as draft June 20, 2024 14:58
@nxtcoder17 nxtcoder17 changed the title feat(console): allows deletion of archived ENVs external gateway servers for GlobalVPN Devices Jun 20, 2024
- observability api, updates kloudlite gateway device URI
fixes:
  - cluster CIDR allocation, (already claimed errors)
  - device IP allocation, (already claimed errors)
- we also have an internal gateway for vpn devices, which we use to
  stream logs from the vpn devices
- also adds a local DNS query `account.kloudlite.local` to allow cli
  tool to get the account for the current gateway
@nxtcoder17 nxtcoder17 force-pushed the feat/edge-gateway-for-vpn-device branch 10 times, most recently from 8efd405 to bdde77f Compare June 23, 2024 18:20
@nxtcoder17 nxtcoder17 force-pushed the feat/edge-gateway-for-vpn-device branch 4 times, most recently from d6f2053 to 4f85c92 Compare June 27, 2024 22:38
- environment cloning namespace will now be gateway enabled by default
@nxtcoder17 nxtcoder17 force-pushed the feat/edge-gateway-for-vpn-device branch from 4f85c92 to 42ee98a Compare June 27, 2024 22:40
@nxtcoder17 nxtcoder17 marked this pull request as ready for review June 29, 2024 06:07
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jun 29, 2024

Reviewer's Guide by Sourcery

This pull request implements external gateway servers for GlobalVPN Devices. The changes include adding new fields and methods to support the external gateway functionality, updating existing methods to accommodate the new gateway devices, and removing deprecated or redundant code. The changes span multiple files, primarily focusing on GraphQL schema updates, domain logic, and build configurations.

File-Level Changes

Files Changes
apps/accounts/internal/app/graph/generated/generated.go
apps/infra/internal/app/graph/generated/generated.go
apps/console/internal/app/graph/generated/generated.go
Updated GraphQL schema and resolvers to support external gateway devices and removed deprecated MatchFilter resolvers.
apps/infra/internal/domain/clusters.go
apps/infra/internal/domain/global-vpn-devices.go
Implemented logic for synchronizing external gateway devices and updated existing methods to accommodate the new gateway devices.
apps/tenant-agent/Taskfile.yml
apps/worker-audit-logging/Taskfile.yml
apps/accounts/Containerfile
Updated build and container build tasks to support multi-architecture builds.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

@nxtcoder17 nxtcoder17 merged commit 25faac6 into main Jun 29, 2024
@nxtcoder17 nxtcoder17 deleted the feat/edge-gateway-for-vpn-device branch June 29, 2024 06:08
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @nxtcoder17 - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Potential hard-coded kubeconfig found. (link)
  • Potential hard-coded kubeconfig found. (link)
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🔴 Security: 2 blocking issues, 1 other issue
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

wg-quick down wg0 || echo "[starting] wg-quick down wg0"
wg-quick up wg0
echo "allowing time for ip addr to become available"
sleep 0.25
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Sleep command in template

The addition of a sleep 0.25 command might be a workaround for a timing issue. Consider if there are more robust solutions to ensure the IP address becomes available.

Suggested change
sleep 0.25
while ! ip addr show wg0 | grep -q "inet "; do
echo "waiting for IP address to become available"
sleep 0.1
done

{{- /* - SETGID */}}
{{- /* drop: */}}
{{- /* - all */}}
securityContext:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Security context for container

The security context has been added to the container configuration. Ensure that the capabilities added (NET_BIND_SERVICE, SETGID) are necessary and do not introduce security vulnerabilities.

DisplayName string `json:"displayName"`
Region string `json:"region"`
CloudProvider string `json:"cloudProvider"`
Kubeconfig string `json:"kubeconfig"`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Potential hard-coded kubeconfig found.

Ensure that this kubeconfig is not a real secret and is appropriately managed.

DisplayName string `json:"displayName"`
Region string `json:"region"`
CloudProvider string `json:"cloudProvider"`
Kubeconfig string `json:"kubeconfig"`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Potential hard-coded kubeconfig found.

Ensure that this kubeconfig is not a real secret and is appropriately managed.

abdheshnayak pushed a commit that referenced this pull request Nov 5, 2024
external gateway servers for GlobalVPN Devices
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

edge gateways for global vpn devices

3 participants