Skip to content

Commit 913ede9

Browse files
authored
METAL-3262 fix in proxy svc for scrape (#129)
* METAL-3262 fix in proxy svc for scrape * METAL-3262 increase version
1 parent a3f7b80 commit 913ede9

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

charts/db-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
type: application
33
kubeVersion: ">= 1.19-prerelease <= 1.22-prerelease"
4-
appVersion: "1.3.0"
4+
appVersion: "1.3.1"
55
description: A Database Operator
66
name: db-operator
7-
version: 1.1.2
7+
version: 1.1.3

pkg/utils/proxy/cloudproxy.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
v1apps "k8s.io/api/apps/v1"
2626
v1 "k8s.io/api/core/v1"
2727
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
28+
"k8s.io/apimachinery/pkg/util/intstr"
2829
)
2930

3031
// CloudProxy for google sql instance
@@ -56,9 +57,16 @@ func (cp *CloudProxy) buildService() (*v1.Service, error) {
5657
Spec: v1.ServiceSpec{
5758
Ports: []v1.ServicePort{
5859
{
59-
Name: cp.Engine,
60-
Protocol: v1.ProtocolTCP,
61-
Port: cp.Port,
60+
Name: cp.Engine,
61+
Port: cp.Port,
62+
TargetPort: intstr.FromString("sqlport"),
63+
Protocol: v1.ProtocolTCP,
64+
},
65+
{
66+
Name: "metrics",
67+
Port: int32(cp.Conf.Instances.Google.ProxyConfig.MetricsPort),
68+
TargetPort: intstr.FromString("metrics"),
69+
Protocol: v1.ProtocolTCP,
6270
},
6371
},
6472
Selector: cp.Labels,
@@ -162,6 +170,11 @@ func (cp *CloudProxy) container() (v1.Container, error) {
162170
ContainerPort: cp.Port,
163171
Protocol: v1.ProtocolTCP,
164172
},
173+
{
174+
Name: "metrics",
175+
ContainerPort: int32(cp.Conf.Instances.Google.ProxyConfig.MetricsPort),
176+
Protocol: v1.ProtocolTCP,
177+
},
165178
},
166179
VolumeMounts: []v1.VolumeMount{
167180
{

0 commit comments

Comments
 (0)