Skip to content

Commit

Permalink
fix: readwrite service redirect to all pods (#35)
Browse files Browse the repository at this point in the history
Signed-off-by: Xie Wei <[email protected]>
  • Loading branch information
waynerv authored May 14, 2024
1 parent 0662a6d commit 13d8ec7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions pkg/opengemini/constants.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package opengemini

const (
HttpPort = 8086
MaintainPort = 8091
HttpPort = 8086
HttpPortName = "readwrite"
MaintainPort = 8091
MaintainPortName = "maintain"
)
10 changes: 6 additions & 4 deletions pkg/specs/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ func CreateClusterMaintainService(cluster *opengeminiv1.OpenGeminiCluster) *core
Type: corev1.ServiceTypeClusterIP,
Ports: []corev1.ServicePort{
{
Name: "maintain",
Name: opengemini.MaintainPortName,
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromInt(opengemini.MaintainPort),
Port: opengemini.MaintainPort,
},
},
Selector: map[string]string{
opengeminiv1.LabelCluster: cluster.Name,
opengeminiv1.LabelCluster: cluster.Name,
opengeminiv1.LabelInstanceSet: naming.InstanceMeta,
},
},
}
Expand All @@ -44,14 +45,15 @@ func CreateClusterReadWriteService(cluster *opengeminiv1.OpenGeminiCluster) *cor
Type: corev1.ServiceTypeClusterIP,
Ports: []corev1.ServicePort{
{
Name: "readwrite",
Name: opengemini.HttpPortName,
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromInt(opengemini.HttpPort),
Port: opengemini.HttpPort,
},
},
Selector: map[string]string{
opengeminiv1.LabelCluster: cluster.Name,
opengeminiv1.LabelCluster: cluster.Name,
opengeminiv1.LabelInstanceSet: naming.InstanceSql,
},
},
}
Expand Down

0 comments on commit 13d8ec7

Please sign in to comment.