From 7f233c2cd998c8f9f827ca5b6575bb60fdd52a32 Mon Sep 17 00:00:00 2001 From: Anton Fayzrahmanov Date: Fri, 30 Aug 2019 13:02:41 +0300 Subject: [PATCH 1/4] Metrics ports must be exposed so prometheus operator can match endpoints. Prometheus operator creates scrape job with relabel_config which check if pod has exposed port. --- pkg/resources/statefulsets/statefulset.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/resources/statefulsets/statefulset.go b/pkg/resources/statefulsets/statefulset.go index b3ae46f3c..ba4154695 100644 --- a/pkg/resources/statefulsets/statefulset.go +++ b/pkg/resources/statefulsets/statefulset.go @@ -270,6 +270,11 @@ func mysqlAgentContainer(cluster *v1alpha1.Cluster, mysqlAgentImage string, root return v1.Container{ Name: MySQLAgentName, Image: fmt.Sprintf("%s:%s", mysqlAgentImage, agentVersion), + Ports: []v1.ContainerPort{ + { + ContainerPort: 8080, + }, + }, Args: []string{"--v=4"}, VolumeMounts: volumeMounts(cluster), Env: []v1.EnvVar{ From ce04b407493d241926076cdcc6d05b97599b501e Mon Sep 17 00:00:00 2001 From: Anton Fayzrahmanov Date: Fri, 30 Aug 2019 14:33:53 +0300 Subject: [PATCH 2/4] Expose metrics port --- mysql-operator/templates/03-deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-operator/templates/03-deployment.yaml b/mysql-operator/templates/03-deployment.yaml index 6fbc384d6..fe87e9762 100644 --- a/mysql-operator/templates/03-deployment.yaml +++ b/mysql-operator/templates/03-deployment.yaml @@ -27,6 +27,7 @@ spec: image: {{ .Values.image.registry }}/mysql-operator:{{ .Values.image.tag }} ports: - containerPort: 10254 + - containerPort: 8080 args: - --v=4 {{- if not .Values.operator.global }} From 836165cefe9ddc9b25cf0528b74e2ba385458b2e Mon Sep 17 00:00:00 2001 From: Anton Fayzrahmanov Date: Fri, 30 Aug 2019 17:04:09 +0300 Subject: [PATCH 3/4] gofmt fix. Signed-off-by: Anton Fayzrahmanov --- pkg/resources/statefulsets/statefulset.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/resources/statefulsets/statefulset.go b/pkg/resources/statefulsets/statefulset.go index ba4154695..b2ca840f7 100644 --- a/pkg/resources/statefulsets/statefulset.go +++ b/pkg/resources/statefulsets/statefulset.go @@ -268,8 +268,8 @@ func mysqlAgentContainer(cluster *v1alpha1.Cluster, mysqlAgentImage string, root } return v1.Container{ - Name: MySQLAgentName, - Image: fmt.Sprintf("%s:%s", mysqlAgentImage, agentVersion), + Name: MySQLAgentName, + Image: fmt.Sprintf("%s:%s", mysqlAgentImage, agentVersion), Ports: []v1.ContainerPort{ { ContainerPort: 8080, From 195cb5a24fb6a1ee54ef1492a67b0aaae3cddfb9 Mon Sep 17 00:00:00 2001 From: Anton Fayzrahmanov Date: Fri, 30 Aug 2019 17:32:41 +0300 Subject: [PATCH 4/4] Update chart version --- mysql-operator/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-operator/Chart.yaml b/mysql-operator/Chart.yaml index 6ce07d818..9e80f9a24 100644 --- a/mysql-operator/Chart.yaml +++ b/mysql-operator/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: mysql-operator -version: 0.2.1 +version: 0.3.0 description: A Helm chart for deploying the Oracle MySQL Operator maintainers: - name: Owain Lewis