Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Metrics ports must be exposed so prometheus operator can match endpoints #289

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

f84anton
Copy link

Prometheus operator creates scrape job with relabel_config which check if pod has exposed port.

For example, prometheus operator service monitor spec:

  endpoints:
  - targetPort: 8080
    scheme: http
  jobLabel: mysql-cluster
  selector:
    matchLabels:
      v1alpha1.mysql.oracle.com/cluster: mysql-cluster
  namespaceSelector:
    matchNames:
      - infra

creates scrape job with kubernetes_sd_configs:

  - role: endpoints
    namespaces:
      names:
      - infra
  relabel_configs:
  - source_labels: [__meta_kubernetes_service_label_v1alpha1_mysql_oracle_com_cluster]
    separator: ;
    regex: mysql-cluster
    replacement: $1
    action: keep
  - source_labels: [__meta_kubernetes_pod_container_port_number]
    separator: ;
    regex: "8080"
    replacement: $1
    action: keep

Because container ports cannot be updated statefulsets must be patched before upgrading mysql operator:

kubectl patch statefulsets.apps mysql-cluster --type=json -p='[{"op": "add", "path": "/spec/template/spec/containers/1/ports", "value": [{"containerPort":8080}] }]' 

…nts.

Prometheus operator creates scrape job with relabel_config which check if pod has exposed port.
@f84anton f84anton marked this pull request as ready for review August 30, 2019 13:46
Signed-off-by: Anton Fayzrahmanov <f84anton@gmail.com>
@f84anton
Copy link
Author

There is errors in e2e tests with "helm output: Error: could not find a ready tiller pod".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant