Skip to content
Closed
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
5 changes: 5 additions & 0 deletions cmd/backplane/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

"github.com/apoxy-dev/apoxy/pkg/apiserver"
bpctrl "github.com/apoxy-dev/apoxy/pkg/backplane/controllers"
"github.com/apoxy-dev/apoxy/pkg/backplane/envoy"
"github.com/apoxy-dev/apoxy/pkg/backplane/healthchecker"
"github.com/apoxy-dev/apoxy/pkg/backplane/kvstore"
"github.com/apoxy-dev/apoxy/pkg/backplane/metrics"
Expand Down Expand Up @@ -66,6 +67,7 @@ var (
proxyName = flag.String("proxy", "", "Name of the Proxy to manage. Must not be used with --proxy_path.")
replicaName = flag.String("replica", os.Getenv("HOSTNAME"), "Name of the replica to manage.")
envoyReleaseURL = flag.String("envoy_release_url", "", "URL to the Envoy release tarball.")
envoyVersion = flag.String("envoy_version", envoy.DefaultVersion, "Envoy release tag to download from GitHub (e.g. v1.35.13). Empty means latest upstream release — never use that in production. Ignored when --envoy_release_url is set.")
downloadEnvoy = flag.Bool("download_envoy_only", false, "Whether to just download Envoy from the release URL and exit.")

apiServerAddr = flag.String("apiserver_addr", "host.docker.internal:8443", "APIServer address.")
Expand Down Expand Up @@ -256,6 +258,9 @@ func main() {
if *useEnvoyContrib {
proxyOpts = append(proxyOpts, bpctrl.WithEnvoyContrib())
}
if *envoyVersion != "" {
proxyOpts = append(proxyOpts, bpctrl.WithEnvoyVersion(*envoyVersion))
}
if *overloadMaxHeapSizeBytes > 0 {
proxyOpts = append(proxyOpts, bpctrl.WithOverloadMaxHeapSizeBytes(*overloadMaxHeapSizeBytes))
}
Expand Down
20 changes: 16 additions & 4 deletions pkg/backplane/controllers/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type options struct {
apiServerTLSClientConfig *tls.Config
goPluginDir string
releaseURL string
envoyVersion string
useEnvoyContrib bool
overloadMaxHeapSizeBytes *uint64
overloadMaxActiveConnections *uint64
Expand Down Expand Up @@ -104,6 +105,15 @@ func WithEnvoyContrib() Option {
}
}

// WithEnvoyVersion pins the Envoy release tag (e.g. "v1.35.13") downloaded
// from GitHub. An empty version falls back to the latest upstream release —
// never do that in production builds; see envoy.DefaultVersion for why.
func WithEnvoyVersion(version string) Option {
return func(o *options) {
o.envoyVersion = version
}
}

// WithOverloadMaxHeapSizeBytes sets the maximum heap size in bytes for the Envoy overload manager.
func WithOverloadMaxHeapSizeBytes(size uint64) Option {
return func(o *options) {
Expand Down Expand Up @@ -240,9 +250,10 @@ func (r *ProxyReconciler) Reconcile(ctx context.Context, request reconcile.Reque
opts = append(opts, envoy.WithRelease(&envoy.URLRelease{
URL: r.options.releaseURL,
}))
} else if r.options.useEnvoyContrib {
} else if r.options.useEnvoyContrib || r.options.envoyVersion != "" {
opts = append(opts, envoy.WithRelease(&envoy.GitHubRelease{
Contrib: true,
Version: r.options.envoyVersion,
Contrib: r.options.useEnvoyContrib,
}))
}

Expand Down Expand Up @@ -335,9 +346,10 @@ func (r *ProxyReconciler) DownloadEnvoy(ctx context.Context) error {
opts = append(opts, envoy.WithRelease(&envoy.URLRelease{
URL: r.options.releaseURL,
}))
} else if r.options.useEnvoyContrib {
} else if r.options.useEnvoyContrib || r.options.envoyVersion != "" {
opts = append(opts, envoy.WithRelease(&envoy.GitHubRelease{
Contrib: true,
Version: r.options.envoyVersion,
Contrib: r.options.useEnvoyContrib,
}))
}

Expand Down
10 changes: 10 additions & 0 deletions pkg/backplane/envoy/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ import (
const (
githubURL = "github.com/envoyproxy/envoy/releases/download"

// DefaultVersion pins the Envoy release baked into backplane images and
// downloaded at runtime. Envoy versions must never float: the 1.35.3 →
// 1.38.x jump (picked up implicitly via GetLatestRelease when the
// v0.11.22/23 images were built) regressed the golang filter with a
// tcmalloc SIGSEGV on the cgo thread-adoption path (x_cgo_getstackbound
// → pthread_getattr_np → calloc). 1.35.13 is the same minor as the
// last known-good 1.35.3 plus upstream security backports. Bump only
// after soak-testing the golang filter under listener-reload churn.
DefaultVersion = "v1.35.13"

accessLogsPath = "/var/log/accesslogs"
tapsPath = "/var/log/taps"

Expand Down
Loading