chartmuseum / charts

ChartMuseum Project Helm Charts
https://artifacthub.io/packages/search?repo=chartmuseum
54 stars 57 forks source link

Deprecated use of `targetPort` in ServiceMonitor #57

Open AndersBennedsgaard opened 1 year ago

AndersBennedsgaard commented 1 year ago

The Prometheus operator have deprecated the .spec.endpoints.targetPort in ServiceMonitors in favor of port.

Atm. the Service in the Helm chart points directly to service.targetPort if used (https://github.com/chartmuseum/charts/blob/main/src/chartmuseum/templates/service.yaml#L38), otherwise directly to the named http port of the main Chartmuseum container.

If the ServiceMonitor should still point towards the http port, an additional port should be opened when using service.targetPort. Such that the Service goes from

  ports:
  - port: 8080
    targetPort: sidecar-http
    name: sidecar-http
    protocol: TCP

to

  ports:
  - port: 8080
    targetPort: http
    name: http
    protocol: TCP
  - port: 8080 # opening two ports with the same port number is probably not allowed
    targetPort: sidecar-http
    name: sidecar-http
    protocol: TCP

The Ingress resource should be changed accordingly, such as https://github.com/chartmuseum/charts/blob/main/src/chartmuseum/templates/ingress.yaml#L43

If what i propose above would be the preferred solution, I could take a look at it.