Bug #115311 Support Metrics Sidecar to Fetch Images from Private Registry
Submitted: 13 Jun 2024 4:00 Modified: 19 Jun 2024 7:04
Reporter: Prasad Kris Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Operator Severity:S4 (Feature request)
Version:8.4.0-2.1.3 OS:Any
Assigned to: CPU Architecture:Any

[13 Jun 2024 4:00] Prasad Kris
Description:
Greetings,

The metrics sidecar currently doesn't support fetching images from a private Docker registry. This is required because it currently has another bug  (https://bugs.mysql.com/bug.php?id=113196) that necessitates the use of custom images with embedded credentials for the metrics sidecar. Therefore, we need to keep it private and not in a public repository. Thanks!

How to repeat:
Create a simple InnoDB cluster with the below spec:

apiVersion: mysql.oracle.com/v2
kind: InnoDBCluster
metadata:
  name: mycluster
spec:
  secretName: mypwds
  tlsUseSelfSigned: true
  imageRepository: registry.example.com/mysql
  imagePullSecrets:
    name: gitlab-registry
  instances: 1
  router:
    instances: 1
  metrics:
    enable: true
    image: mysqld_exporter
    monitor: true
    monitorSpec: {}
    options: []

Upon creation, this will successfully fetch the following images from the private registry: registry.example.com/mysql

community-operator:8.4.0-2.1.3
community-server:8.4.0
community-router:8.4.0

However, the metrics container will fail with ImagePullBackOff as it attempts to fetch the image from Docker Hub.

Suggested fix:
We need an option to fetch the metrics (mysqld_exporter) image from private registries.
[19 Jun 2024 7:04] MySQL Verification Team
Hi,

This is not a bug but I'll be adding it as a feature request.

Thanks for your interest in MySQL