Skip to content

Commit

Permalink
expose port 50052 (readonly-grpc)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliezio committed Jan 31, 2024
1 parent dd54d29 commit a273e93
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
2 changes: 2 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ func (c *Config) Service() *applycorev1.ServiceApplyConfiguration {
func (c *Config) servicePorts() []*applycorev1.ServicePortApplyConfiguration {
ports := []*applycorev1.ServicePortApplyConfiguration{
applycorev1.ServicePort().WithName("grpc").WithPort(50051),
applycorev1.ServicePort().WithName("readonly-grpc").WithPort(50052),
applycorev1.ServicePort().WithName("gateway").WithPort(8443),
applycorev1.ServicePort().WithName("metrics").WithPort(9090),
}
Expand Down Expand Up @@ -694,6 +695,7 @@ func (c *Config) MigrationJob(migrationHash string) *applybatchv1.JobApplyConfig
func (c *Config) containerPorts() []*applycorev1.ContainerPortApplyConfiguration {
ports := []*applycorev1.ContainerPortApplyConfiguration{
applycorev1.ContainerPort().WithContainerPort(50051).WithName("grpc"),
applycorev1.ContainerPort().WithContainerPort(50052).WithName("readonly-grpc"),
applycorev1.ContainerPort().WithContainerPort(8443).WithName("gateway"),
applycorev1.ContainerPort().WithContainerPort(9090).WithName("metrics"),
}
Expand Down
44 changes: 23 additions & 21 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "override termination log",
Expand Down Expand Up @@ -243,7 +243,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/alt/path",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "memory",
Expand Down Expand Up @@ -320,7 +320,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=false",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 3,
wantPortCount: 4,
},
{
name: "set image with tag explicitly",
Expand Down Expand Up @@ -382,7 +382,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "set image with digest explicitly",
Expand Down Expand Up @@ -444,7 +444,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "set replicas as int",
Expand Down Expand Up @@ -525,7 +525,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "set replicas as string",
Expand Down Expand Up @@ -606,7 +606,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "set extra labels as string",
Expand Down Expand Up @@ -691,7 +691,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "set extra labels as map",
Expand Down Expand Up @@ -779,7 +779,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "skip migrations bool",
Expand Down Expand Up @@ -862,7 +862,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "skip migrations string",
Expand Down Expand Up @@ -945,7 +945,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "set extra annotations as string",
Expand Down Expand Up @@ -1030,7 +1030,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "set extra annotations as map",
Expand Down Expand Up @@ -1118,7 +1118,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "set extra service account with annotations as string",
Expand Down Expand Up @@ -1203,7 +1203,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "set extra service account with annotations as map",
Expand Down Expand Up @@ -1290,7 +1290,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "set different migration and spicedb log level",
Expand Down Expand Up @@ -1375,7 +1375,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "disable dispatch",
Expand Down Expand Up @@ -1458,7 +1458,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=false",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 3,
wantPortCount: 4,
},
{
name: "update graph pushes the current version forward",
Expand Down Expand Up @@ -1546,7 +1546,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "explicit channel and version, updates to the next in the channel",
Expand Down Expand Up @@ -1638,7 +1638,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "explicit channel and version, doesn't update past the explicit version",
Expand Down Expand Up @@ -1734,7 +1734,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
{
name: "set spanner credentials",
Expand Down Expand Up @@ -1818,7 +1818,7 @@ func TestNewConfig(t *testing.T) {
"SPICEDB_DISPATCH_CLUSTER_ENABLED=true",
"SPICEDB_TERMINATION_LOG_PATH=/dev/termination-log",
},
wantPortCount: 4,
wantPortCount: 5,
},
}
for _, tt := range tests {
Expand Down Expand Up @@ -2065,6 +2065,7 @@ spec:
})).
WithPorts(
applycorev1.ContainerPort().WithContainerPort(50051).WithName("grpc"),
applycorev1.ContainerPort().WithContainerPort(50052).WithName("readonly-grpc"),
applycorev1.ContainerPort().WithContainerPort(8443).WithName("gateway"),
applycorev1.ContainerPort().WithContainerPort(9090).WithName("metrics"),
applycorev1.ContainerPort().WithContainerPort(50053).WithName("dispatch"),
Expand Down Expand Up @@ -2197,6 +2198,7 @@ spec:
})).
WithPorts(
applycorev1.ContainerPort().WithContainerPort(50051).WithName("grpc"),
applycorev1.ContainerPort().WithContainerPort(50052).WithName("readonly-grpc"),
applycorev1.ContainerPort().WithContainerPort(8443).WithName("gateway"),
applycorev1.ContainerPort().WithContainerPort(9090).WithName("metrics"),
applycorev1.ContainerPort().WithContainerPort(50053).WithName("dispatch"),
Expand Down

0 comments on commit a273e93

Please sign in to comment.