Skip to content

Commit

Permalink
expose metrics port for prometheus operator
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanato committed Oct 14, 2020
1 parent 7294924 commit e13feaa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/mattermost/mattermost.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ func GenerateService(mattermost *mattermostv1alpha1.ClusterInstallation, service
service.Spec.Ports = []corev1.ServicePort{
{
Port: 8065,
Name: "app",
TargetPort: intstr.FromString("app"),
},
{
Port: 8067,
Name: "metrics",
TargetPort: intstr.FromString("metrics"),
},
}
service.Spec.ClusterIP = corev1.ClusterIPNone

Expand Down Expand Up @@ -500,6 +506,10 @@ func GenerateDeployment(mattermost *mattermostv1alpha1.ClusterInstallation, dbIn
ContainerPort: 8065,
Name: "app",
},
{
ContainerPort: 8067,
Name: "metrics",
},
},
ReadinessProbe: readiness,
LivenessProbe: liveness,
Expand Down
1 change: 1 addition & 0 deletions pkg/mattermost/mattermost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func TestGenerateService(t *testing.T) {
expectPort(t, service, 443)
} else {
expectPort(t, service, 8065)
expectPort(t, service, 8067)
}
})
}
Expand Down

0 comments on commit e13feaa

Please sign in to comment.