Skip to content

feat: add CSIL schemas for Tailscale integration#22

Draft
Soypete wants to merge 3 commits intocatalystcommunity:mainfrom
Soypete:feat/tailscale-schemas
Draft

feat: add CSIL schemas for Tailscale integration#22
Soypete wants to merge 3 commits intocatalystcommunity:mainfrom
Soypete:feat/tailscale-schemas

Conversation

@Soypete
Copy link
Copy Markdown
Contributor

@Soypete Soypete commented Mar 27, 2026

Summary

  • Add tailscale.csil schema for Tailscale component configuration
  • Add allow_cgnat_vip field to k3s and network-simple configs
  • Add VIP validation support for RFC6598 (100.64.0.0/10) CGNAT range used by Tailscale
  • Fix bug: ParseConfig now properly parses allow_cgnat_vip field

Soypete and others added 3 commits February 10, 2026 21:01
Add optional `allow_cgnat_vip` configuration flag to enable VIP addresses
in the CGNAT range (100.64.0.0/10, RFC 6598) used by Tailscale and similar
overlay networks.

Background:
- Foundry previously only accepted RFC 1918 private IPs for VIP
- Tailscale uses RFC 6598 Shared Address Space (100.64.0.0/10)
- This prevented users from deploying clusters exclusively on Tailscale

Changes:
- Add `allow_cgnat_vip` field to ClusterConfig and K3s Config (CSIL schemas)
- Update VIP validation to accept CGNAT range when flag is true
- Wire flag through all validation paths (init, worker, vip)
- Maintain backward compatibility (defaults to false)
- Use *bool for optional field (CSIL generation constraint)

Usage:
```yaml
cluster:
  vip: 100.81.89.100
  allow_cgnat_vip: true
```

Helpful error message suggests the flag when CGNAT IP is rejected.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add comprehensive documentation for deploying Foundry clusters on Tailscale
overlay networks using CGNAT IP addresses.

Covers:
- Required Tailscale ACL configuration
- Single control plane setup (simple approach)
- HA multi-control-plane setup with subnet routes
- Network routing considerations for overlay networks
- Troubleshooting VIP reachability issues
- Validation checklist
- Future roadmap for Tailscale operator integration
Add use_tailscale flag to ClusterConfig and create Tailscale component
configuration schema to enable automated Tailscale operator integration.

Changes:
- Add use_tailscale field to ClusterConfig (network-simple.csil)
- Create new tailscale.csil component schema with OAuth credentials,
  operator image, advertise routes, and tags configuration
- Regenerate Go types for config and tailscale component
- Add comprehensive unit tests for Tailscale component types

Testing Strategy:
1. CSIL Validation: Both schemas validated with csilgen validate ✓
2. Type Generation: Go types correctly generated with proper pointer types
3. Compilation: Code builds successfully without errors
4. Unit Tests: 5 test cases covering:
   - YAML marshaling/unmarshaling with various configurations
   - Pointer type behavior (nil defaults for optional fields)
   - Secret reference support (${secret:path:key} format)
   - Round-trip YAML serialization
   - Empty/minimal configuration handling

All tests passing (5/5).

Part of stacked PR series for Tailscale integration (PR #2a).
Builds on PR #1 (CGNAT VIP support).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Soypete Soypete marked this pull request as draft March 27, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant