-
Notifications
You must be signed in to change notification settings - Fork 172
Adding atunnel - networking component within ateom #559
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
base: main
Are you sure you want to change the base?
Changes from all commits
4b4e7fe
e74908c
cb65db3
6030db8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,9 @@ func NewRouterCmd() *cobra.Command { | |
| cmd.Flags().DurationVar(&cfg.HealthInterval, "health-interval", 1*time.Second, "Interval for checking health of dependent services") | ||
| cmd.Flags().IntVar(&cfg.HttpsPort, "port-https", 8443, "TCP port for HTTPS workload traffic entering through the Envoy Router") | ||
| cmd.Flags().StringVar(&cfg.EnvoyCertPath, "envoy-cert-path", "", "Path to the Envoy certificate file.") | ||
| cmd.Flags().StringVar(&cfg.UpstreamClientCertPath, "upstream-client-cert-path", "/run/podidentity.podcert.ate.dev/credential-bundle.pem", "PEM credential bundle (cert+key) the router presents as the client cert when dialing the actor's atunnel ingress server over mTLS. Empty disables upstream mTLS (legacy plaintext pod-IP:80).") | ||
| cmd.Flags().StringVar(&cfg.UpstreamTrustPath, "upstream-trust-bundle-path", "/run/podidentity.podcert.ate.dev/trust-bundle.pem", "PEM trust bundle used to validate the actor's atunnel ingress server certificate.") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use the same flag surffix as the |
||
| cmd.Flags().StringVar(&cfg.UpstreamSpiffePrefix, "upstream-spiffe-prefix", "spiffe://cluster.local/", "SPIFFE URI SAN prefix (trust domain) the actor's atunnel server cert must match. Empty falls back to default SAN check against the dialed pod IP (which SPIFFE-only certs never match).") | ||
| cmd.Flags().StringVar(&cfg.OtlpCollectorAddress, "otlp-collector-address", "", "host:port of the OTLP gRPC collector that Envoy reports tracing spans to (empty disables Envoy tracing)") | ||
| cmd.Flags().StringVar(&cfg.Auth.AteapiCAFile, "ateapi-ca-file", "", "PEM file with CAs trusted to verify the ateapi server cert. Required.") | ||
| cmd.Flags().StringVar(&cfg.Auth.AteapiClientCertPath, "ateapi-client-cert", "", "Credential bundle presented as the client certificate when dialing ateapi. Required unless --ateapi-use-token-auth is set, ignored otherwise.") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,8 +48,17 @@ type routerConfig struct { | |
| HealthInterval time.Duration | ||
| HttpsPort int | ||
| EnvoyCertPath string | ||
| LogLevel string | ||
| MetricsAddr string | ||
| // UpstreamClientCertPath is the router's podidentity credential bundle | ||
| // (cert+key) presented as the client cert when dialing the actor's atunnel | ||
| // ingress server over mTLS. UpstreamTrustPath is the CA bundle used to | ||
| // validate that server. Empty UpstreamClientCertPath disables upstream mTLS. | ||
| UpstreamClientCertPath string | ||
| UpstreamTrustPath string | ||
| // UpstreamSpiffePrefix validates the actor's atunnel server cert by its | ||
| // SPIFFE URI SAN prefix (trust domain) instead of the dialed pod IP. | ||
| UpstreamSpiffePrefix string | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: put a new line to separate this in its own block |
||
| LogLevel string | ||
| MetricsAddr string | ||
| // OtlpCollectorAddress is the host:port of the OTLP gRPC collector that | ||
| // Envoy reports tracing spans to. Empty disables Envoy-side tracing. | ||
| OtlpCollectorAddress string | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -170,14 +170,22 @@ func (s *ExtProcServer) handleRequestHeaders( | |
| "actor %s routing failed", actorRef) | ||
| } | ||
|
|
||
| // The actor is reached through the in-worker atunnel ingress server, which | ||
| // listens on :443 (mTLS) and forwards to the actor's :80. The worker no | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm thinking we should use not 443, but own port just in case we need the standard HTTPS port later. |
||
| // longer DNATs pod-IP:80 to the actor, so the router dials :443 and the | ||
| // ORIGINAL_DST cluster's upstream TLS context presents the router's | ||
| // podidentity client cert (see buildOriginalDstCluster and | ||
| // buildUpstreamTransportSocket). | ||
| // TODO(bowei) -- handle more than port 80 on the actor. | ||
| targetAddr := net.JoinHostPort(workerIP, "80") | ||
| targetAddr := net.JoinHostPort(workerIP, "443") | ||
|
|
||
| slog.InfoContext(ctx, "Route ok", slog.Any("actor", actorRef), slog.String("targetAddr", targetAddr)) | ||
|
|
||
| // Route by rewriting the :authority header. | ||
| // Route by telling the ORIGINAL_DST cluster which worker atunnel address to | ||
| // dial, without touching :authority — atunnel authorizes the actor by the | ||
| // original Host (actor DNS name). | ||
| mutation := &extprocv3.HeaderMutation{} | ||
| addAuthorityMutation(targetAddr, mutation) | ||
| addOriginalDstMutation(targetAddr, mutation) | ||
|
|
||
| return &extprocv3.HeadersResponse{ | ||
| Response: &extprocv3.CommonResponse{ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the same flag surffix as the
--atunnel-credential-bundleflag of ateom-gvisor|microvm? Consistency matters more than exactly which one you pick.