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

[backport--v1.16.x] Cloud Run Upstreams #9472

Closed
wants to merge 6 commits into from
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
10 changes: 10 additions & 0 deletions changelog/v1.16.15/6828-cloud-run-integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
changelog:
- type: FIX
issueLink: https://github.com/solo-io/gloo/issues/6828
resolvesIssue: false
description: >-
Adds the API for a new enterprise only feature designed to allow authenticating requests using tokens from the google metadata service
before sending the requests upstreams. This feature will be exposed as a new Upstream type.



Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/data/ProtoMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,9 @@ apis:
gateway.solo.io.VirtualServiceSelectorExpressions:
relativepath: reference/api/github.com/solo-io/gloo/projects/gateway/api/v1/http_gateway.proto.sk/#VirtualServiceSelectorExpressions
package: gateway.solo.io
gcp.options.gloo.solo.io.UpstreamSpec:
relativepath: reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/enterprise/options/gcp/gcp.proto.sk/#UpstreamSpec
package: gcp.options.gloo.solo.io
gloo.solo.io.AccountCredentialsSecret:
relativepath: reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/secret.proto.sk/#AccountCredentialsSecret
package: gloo.solo.io
Expand Down
7 changes: 7 additions & 0 deletions install/helm/gloo/crds/gloo.solo.io_v1_Upstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,13 @@ spec:
type: object
type: array
type: object
gcp:
properties:
audience:
type: string
host:
type: string
type: object
healthChecks:
items:
properties:
Expand Down
19 changes: 19 additions & 0 deletions projects/gloo/api/v1/enterprise/options/gcp/gcp.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";
package gcp.options.gloo.solo.io;

option go_package = "github.com/solo-io/gloo/projects/gloo/pkg/api/v1/enterprise/options/gcp";

import "extproto/ext.proto";
option (extproto.hash_all) = true;
option (extproto.clone_all) = true;
option (extproto.equal_all) = true;

// Enterprise-only: Configuration to enable GCP authentication for upstreams.
message UpstreamSpec {
// Required. host of the GCP service to be connected to
string host = 1;

// Optional override for the audience used to fetch the token from the GCP metadata server.
// By default it will use the URL of the service
string audience = 2;
}
2 changes: 2 additions & 0 deletions projects/gloo/api/v1/upstream.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import "github.com/solo-io/gloo/projects/gloo/api/v1/options/azure/azure.proto";
import "github.com/solo-io/gloo/projects/gloo/api/v1/options/consul/consul.proto";
import "github.com/solo-io/gloo/projects/gloo/api/v1/options/aws/ec2/aws_ec2.proto";
import "github.com/solo-io/gloo/projects/gloo/api/v1/failover.proto";
import "github.com/solo-io/gloo/projects/gloo/api/v1/enterprise/options/gcp/gcp.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "validate/validate.proto";
Expand Down Expand Up @@ -78,6 +79,7 @@ message Upstream {
azure.options.gloo.solo.io.UpstreamSpec azure = 15;
consul.options.gloo.solo.io.UpstreamSpec consul = 16;
aws_ec2.options.gloo.solo.io.UpstreamSpec aws_ec2 = 17;
gcp.options.gloo.solo.io.UpstreamSpec gcp = 34;
}

// Failover endpoints for this upstream. If omitted (the default) no failovers will be applied.
Expand Down
8 changes: 8 additions & 0 deletions projects/gloo/cli/pkg/printers/upstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ func upstreamType(up *v1.Upstream) string {
return "Kubernetes"
case *v1.Upstream_Static:
return "Static"
case *v1.Upstream_Gcp:
return "GCP"
default:
return "Unknown"
}
Expand Down Expand Up @@ -169,6 +171,12 @@ func upstreamDetails(up *v1.Upstream, xdsDump *xdsinspection.XdsDump) []string {
if usType.Static.GetServiceSpec() != nil {
add(linesForServiceSpec(usType.Static.GetServiceSpec())...)
}
case *v1.Upstream_Gcp:
add(fmt.Sprintf("host: %v", usType.Gcp.GetHost()))
if usType.Gcp.GetAudience() != "" {
add(fmt.Sprintf("host: %v", usType.Gcp.GetAudience()))
}

}
add("")
return details
Expand Down
41 changes: 41 additions & 0 deletions projects/gloo/pkg/api/v1/enterprise/options/gcp/gcp.pb.clone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions projects/gloo/pkg/api/v1/enterprise/options/gcp/gcp.pb.equal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading