Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow changing cloudflared protocol #100

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions api/v1alpha1/tunnel_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ type TunnelSpec struct {
// Tolerations specifies the tolerations to apply to the cloudflared tunnel deployment
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

//+kubebuilder:validation:Optional
//+kubebuilder:validation:Enum={"auto","quic","http2"}
//+kubebuilder:default:="auto"
// Protocol specifies the protocol to use for the tunnel. Defaults to auto. Options are "auto", "quic" and "http2"
Protocol string `json:"protocol,omitempty"`

//+kubebuilder:validation:Optional
//+kubebuilder:default:="http_status:404"
// FallbackTarget speficies the target for requests that do not match an ingress. Defaults to http_status:404
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ spec:
certs as needed to be referred in the service annotation) of the
Root CA to be trusted when sending traffic to HTTPS endpoints
type: string
protocol:
default: auto
description: Protocol specifies the protocol to use for the tunnel.
Defaults to auto. Options are "auto", "quic" and "http2"
enum:
- auto
- quic
- http2
type: string
size:
default: 1
description: Size defines the number of Daemon pods to run for this
Expand Down
9 changes: 9 additions & 0 deletions config/crd/bases/networking.cfargotunnel.com_tunnels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ spec:
certs as needed to be referred in the service annotation) of the
Root CA to be trusted when sending traffic to HTTPS endpoints
type: string
protocol:
default: auto
description: Protocol specifies the protocol to use for the tunnel.
Defaults to auto. Options are "auto", "quic" and "http2"
enum:
- auto
- quic
- http2
type: string
size:
default: 1
description: Size defines the number of Daemon pods to run for this
Expand Down
3 changes: 2 additions & 1 deletion controllers/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,9 @@ func deploymentForTunnel(r GenericTunnelReconciler) *appsv1.Deployment {
replicas := r.GetTunnel().GetSpec().Size
nodeSelector := nodeSelectorsForTunnel(r.GetTunnel())
tolerations := r.GetTunnel().GetSpec().Tolerations
protocol := r.GetTunnel().GetSpec().Protocol

args := []string{"tunnel", "--config", "/etc/cloudflared/config/config.yaml", "--metrics", "0.0.0.0:2000", "run"}
args := []string{"tunnel", "--protocol", protocol, "--config", "/etc/cloudflared/config/config.yaml", "--metrics", "0.0.0.0:2000", "run"}
adyanth marked this conversation as resolved.
Show resolved Hide resolved
volumes := []corev1.Volume{{
Name: "creds",
VolumeSource: corev1.VolumeSource{
Expand Down
Loading