Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
Merge pull request #50 from storageos/fix-tls-metrics
Browse files Browse the repository at this point in the history
Fix tls metrics
  • Loading branch information
Angelos Perivolaropoulos authored Jun 29, 2022
2 parents 7cfdf19 + e6e499a commit c55b7b0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion controllers/etcdcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
const (
clusterNameSpecField = "spec.clusterName"
etcdClientPortName = "etcd-client"
etcdMetricsPortName = "etcd-metrics"
)

const (
Expand Down Expand Up @@ -377,6 +378,11 @@ func headlessServiceForCluster(cluster *etcdv1alpha1.EtcdCluster) *v1.Service {
Protocol: "TCP",
Port: etcdPeerPort,
},
{
Name: "etcd-metrics",
Protocol: "TCP",
Port: etcdMetricsPort,
},
},
},
}
Expand Down Expand Up @@ -596,7 +602,7 @@ func serviceMonitorForCluster(cluster *etcdv1alpha1.EtcdCluster) *monitorv1.Serv
Spec: monitorv1.ServiceMonitorSpec{
Endpoints: []monitorv1.Endpoint{
{
Port: etcdClientPortName,
Port: etcdMetricsPortName,
Interval: "10s",
}},
NamespaceSelector: monitorv1.NamespaceSelector{
Expand Down
6 changes: 6 additions & 0 deletions controllers/etcdcluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ func (s *controllerSuite) testClusterController(t *testing.T) {
Port: 2380,
TargetPort: intstr.FromInt(2380),
}, "Service did not declare peer port")
require.Contains(t, ports, v1.ServicePort{
Name: "etcd-metrics",
Protocol: "TCP",
Port: 2381,
TargetPort: intstr.FromInt(2381),
}, "Service did not declare metrics port")
})

t.Run("CreatePodDisruptionBudget", func(t *testing.T) {
Expand Down

0 comments on commit c55b7b0

Please sign in to comment.