0

I am trying to install Metrics Server, but it needs to create a resource that already exists from an installation of Prometheus. They both want to make v1beta1.metrics.k8s.io.

I went to see if the resource was the same, so I could just leave it. But they are not. They each have a service: section that points to their respective services (prometheus-adapter and metrics-server).

If I install the Metrics Server version, then I lose the settings for Prometheus. I am hoping that these are not mutually exclusive tools. (They do not fill the same function. Prometheus is for monitoring and the Metrics Server is for Horizontal Pod Scaling.)

How can I install Metrics Server without messing up Prometheus?


In case it is useful, here is the full yaml for the conflicting definitions of v1beta1.metrics.k8s.io:

Prometheus:

apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
  labels:
    app.kubernetes.io/component: metrics-adapter
    app.kubernetes.io/name: prometheus-adapter
    app.kubernetes.io/part-of: kube-prometheus
    app.kubernetes.io/version: v0.10.0
  name: v1beta1.metrics.k8s.io
spec:
  group: metrics.k8s.io
  groupPriorityMinimum: 100
  insecureSkipTLSVerify: true
  service:
    name: prometheus-adapter
    namespace: ntnx-system
    port: 443
  version: v1beta1
  versionPriority: 100

Metrics Server:

apiVersion: apiregistration.k8s.io/v1   
kind: APIService    
metadata:   
  labels:   
    k8s-app: metrics-server 
  name: v1beta1.metrics.k8s.io  
spec:   
  group: metrics.k8s.io 
  groupPriorityMinimum: 100 
  insecureSkipTLSVerify: true   
  service:  
    name: metrics-server    
    namespace: kube-system  
  version: v1beta1  
  versionPriority: 100

1 Answer 1

0

A way around this issue is to just change the name of each APISerice..Or better yet just change the metric servers name for example.

apiVersion: apiregistration.k8s.io/v1 kind: APIService metadata: labels: app.kubernetes.io/component: metrics-adapter app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: kube-prometheus app.kubernetes.io/version: v0.10.0 name: v1beta1.metrics-server.k8s.io spec: group: metrics-server.k8s.io # Change the group to something unique groupPriorityMinimum: 100 insecureSkipTLSVerify: true service: name: prometheus-adapter namespace: ntnx-system port: 443 version: v1beta1 versionPriority: 100

Just keep in mind that the metadata.name must be `spec.version+"."+spec.group. I hope this helps, good luck!

1
  • Thanks for the answer!! I thought about doing this, but I don’t know if there will be side effects. For example, will Metrics Server go looking for the APIService under the original (expected) name?
    – Vaccano
    Jul 30 at 1:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.