{"id":37874835,"url":"https://github.com/platformbuilds/cosmolet","last_synced_at":"2026-01-16T16:43:54.614Z","repository":{"id":300438797,"uuid":"1006091174","full_name":"platformbuilds/cosmolet","owner":"platformbuilds","description":"BareMetal Kubernetes BGP Service Controller","archived":false,"fork":false,"pushed_at":"2025-08-18T08:10:23.000Z","size":24027,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-29T13:54:49.135Z","etag":null,"topics":["bgp","kubernetes","platform-engineering"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/platformbuilds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"Code-of-Conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-21T13:25:07.000Z","updated_at":"2025-08-15T18:25:49.000Z","dependencies_parsed_at":"2025-08-02T13:12:50.170Z","dependency_job_id":"94c80364-4ac1-4c6c-8c3a-b2bb98449e1e","html_url":"https://github.com/platformbuilds/cosmolet","commit_stats":null,"previous_names":["platformbuilds/cosmolet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/platformbuilds/cosmolet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platformbuilds%2Fcosmolet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platformbuilds%2Fcosmolet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platformbuilds%2Fcosmolet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platformbuilds%2Fcosmolet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/platformbuilds","download_url":"https://codeload.github.com/platformbuilds/cosmolet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platformbuilds%2Fcosmolet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bgp","kubernetes","platform-engineering"],"created_at":"2026-01-16T16:43:54.533Z","updated_at":"2026-01-16T16:43:54.600Z","avatar_url":"https://github.com/platformbuilds.png","language":"Go","readme":"# Cosmolet - BareMetal Kubernetes Services BGP Advertiser\n\n## Release Version: beta\nCosmolet has been functionally tested and deemed working. \nTesting at scale is in progress.\n\nCosmolet is a Kubernetes controller that automatically advertises Kubernetes service IPs via BGP. It runs as a privileged DaemonSet with direct FRR (Free Range Routing) integration to enable bare-metal Kubernetes clusters to announce service IPs to network infrastructure.\n\n## 🚀 Features\n\nReference Network Architecture\n![Reference Network Architecture - HLD](./cosmolet.png)\n\n- **Automatic Service Discovery**: Monitors all Kubernetes services across the cluster\n- **BGP Route Advertisement**: Integrates with FRR to advertise ClusterIP and LoadBalancer service IPs\n- **Health-based Routing**: Only advertises routes for healthy services with ready endpoints\n- **Leader Election**: Ensures only one instance manages BGP routes while maintaining monitoring on all nodes\n- **High Availability**: DaemonSet deployment with graceful failover\n- **Comprehensive Monitoring**: Prometheus metrics and health checks\n- **Security Hardened**: Minimal privileges with proper RBAC configuration\n\n## 📋 Prerequisites\n\n- Kubernetes 1.20+ cluster\n- FRR (Free Range Routing) installed on nodes\n- BGP-capable network infrastructure (switches/routers)\n- Cluster admin permissions for installation\n\n## Code Flowchart\n![High Level Algorithm/Flowchart](./flowchart/flowchart-1.png)\n\n# Build \u0026 Release Instructuction\n## Clone the repository\n```\ngit clone https://github.com/platformbuilds/cosmolet.git\ncd cosmolet\n```\n\n## Download dependencies\n```\ngo mod download\n```\n\n## Build the binary\n\n### Simple build (dev only)\n```\ngo build -o ./bin/cosmolet ./cmd/cosmolet\n```\n\n### Production Build (Optimized)\n```\n#Build with optimizations (same as used in Dockerfile)\nCGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \\\n    -ldflags='-w -s -extldflags \"-static\"' \\\n    -a -installsuffix cgo \\\n    -o ./bin/cosmolet \\\n    ./cmd/cosmolet\n```\n\n### Cross-Platform Compilation\n\n```\n# Linux (default)\nCGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \\\n  -ldflags='-w -s -extldflags \"-static\"' \\\n  -a -installsuffix cgo \\\n  -o ./bin/cosmolet-linux-amd64 \\\n  ./cmd/cosmolet\n\n# macOS\nCGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build \\\n  -ldflags='-w -s -extldflags \"-static\"' \\\n  -a -installsuffix cgo \\\n  -o ./bin/cosmolet-linux-darwin-amd64 \\\n  ./cmd/cosmolet\n\n# Windows\nCGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build \\\n  -ldflags='-w -s -extldflags \"-static\"' \\\n  -a -installsuffix cgo \\\n  -o ./bin/cosmolet-windows-amd64 \\\n  ./cmd/cosmolet\n\n# ARM64 (for ARM-based systems)\nCGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build \\\n  -ldflags='-w -s -extldflags \"-static\"' \\\n  -a -installsuffix cgo \\\n  -o ./bin/cosmolet-linux-arm64 \\\n  ./cmd/cosmolet\n```\n\n### Using the Makefile\nThe project includes a comprehensive Makefile with various build targets:\n```\n# Download dependencies\nmake deps\n\n# Build binary\nmake build\n\n# Build with all checks (fmt, vet, test)\nmake check\n\n# Clean build\nmake clean \u0026\u0026 make build\n```\n\n\n### Multi-Architecture Build Script\n```\n#!/bin/bash\n# build-all.sh\n\nplatforms=(\"linux/amd64\" \"linux/arm64\" \"darwin/amd64\" \"windows/amd64\")\n\nfor platform in \"${platforms[@]}\"\ndo\n    platform_split=(${platform//\\// })\n    GOOS=${platform_split[0]}\n    GOARCH=${platform_split[1]}\n    output_name='./bin/cosmolet-'$GOOS'-'$GOARCH\n    if [ $GOOS = \"windows\" ]; then\n        output_name+='.exe'\n    fi\n\n    env GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=0 go build \\\n        -ldflags='-w -s' \\\n        -o bin/$output_name ./cmd/cosmolet\n        \n    if [ $? -ne 0 ]; then\n        echo 'An error has occurred! Aborting the script execution...'\n        exit 1\n    fi\ndone\n```\n\n### Development Build\n```\n# Build with debug info\ngo build -gcflags=\"all=-N -l\" -o ./bin/cosmolet-debug ./cmd/cosmolet\n```\n\n\n### Build Flags Explanation\n\n* `-ldflags='-w -s'`: Remove debug info and symbol table (reduces binary size)\n* `-extldflags \"-static\"`: Create statically linked binary\n* `CGO_ENABLED=0`: Disable CGO for pure Go binary\n* `-a`: Force rebuilding of packages\n* `-installsuffix cgo`: Use different install suffix for CGO\n\n### Environment Variables for Build\n```\n# Set common build environment\nexport CGO_ENABLED=0\nexport GOOS=linux\nexport GOARCH=amd64\n\n# Build with environment\ngo build -ldflags='-w -s' -o cosmolet ./cmd/main.go\n```\n\n## Verification\nAfter building, verify the binary:\n```\n# Check binary info\nfile cosmolet\nldd cosmolet  # Should show \"not a dynamic executable\" for static build\n\n# Test binary\n./cosmolet --help\n./cosmolet --version\n```\n\n## Common Build Issues\n* Dependency Issues:\n```\ngo mod tidy\ngo mod verify\n```\n\n* CGO Dependencies:\n```\n# If you encounter CGO issues, try:\nCGO_ENABLED=0 go build ./cmd/main.go\n```\n\n* Module Path Issues:\n```\n# Ensure you're in the correct directory\ngo mod init github.com/platformcosmo/cosmolet  # if starting fresh\n```\n\nThe resulting binary will be statically linked and suitable for deployment in containers or bare-metal systems without external dependencies.\n\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n## 📄 License\n\nThis project is licensed under the GNU Affero General Public License v3.0 - see the [LICENSE](LICENSE) file for details.\n\n---\n\n⭐ If this project helps you, please consider giving it a star on GitHub!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatformbuilds%2Fcosmolet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplatformbuilds%2Fcosmolet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatformbuilds%2Fcosmolet/lists"}