Documentation
¶
Index ¶
- func GetTunnelURL(cfg *config.Config) (string, error)
- func Login(cfg *config.Config, opts LoginOptions) error
- func Logs(cfg *config.Config, follow bool) error
- func Provision(cfg *config.Config, opts ProvisionOptions) error
- func Restart(cfg *config.Config) error
- func Status(cfg *config.Config) error
- type LoginOptions
- type ProvisionOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTunnelURL ¶
GetTunnelURL parses cloudflared logs to extract the quick tunnel URL.
func Login ¶
func Login(cfg *config.Config, opts LoginOptions) error
Login provisions a locally-managed tunnel using `cloudflared tunnel login` (browser auth), then writes the required credentials/config into Kubernetes and upgrades the cloudflared Helm release so the in-cluster connector runs the locally-managed tunnel.
Docs: - Create a locally-managed tunnel: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/local-management/create-local-tunnel/ - Configuration file for published apps: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/local-management/configuration-file/ - `origincert` run parameter (locally-managed tunnels): https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/configure-tunnels/cloudflared-parameters/run-parameters/
func Provision ¶
func Provision(cfg *config.Config, opts ProvisionOptions) error
Provision provisions a persistent Cloudflare Tunnel routed via a proxied DNS record.
Based on Cloudflare's "Create a tunnel (API)" guide: - POST /accounts/$ACCOUNT_ID/cfd_tunnel - PUT /accounts/$ACCOUNT_ID/cfd_tunnel/$TUNNEL_ID/configurations - POST /zones/$ZONE_ID/dns_records (proxied CNAME to <tunnel-id>.cfargotunnel.com)
Types ¶
type LoginOptions ¶
type LoginOptions struct {
Hostname string
}