Answers: <p>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.</p>
  <pre class="lang-yml prettyprint-override"><code>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
  </code></pre>
  <p>Just keep in mind that the metadata.name must be `spec.version+&quot;.&quot;+spec.group.
  I hope this helps, good luck!</p>
  
Answers: CC BY-SA 4.0
Answers: 2023-07-30T01:22:01.240Z
Answers: 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?
Answers: Vaccano
Answers: CC BY-SA 4.0
Answers: 2023-07-28T23:50:20.903Z
Answers: 2023-12-30T21:00:03.503Z
Answers: 2023-12-30T21:00:03.503Z
Answers: Freddy
Body: <p>I am trying to install <a href="https://github.com/kubernetes-sigs/metrics-server" rel="nofollow noreferrer">Metrics Server</a>, but it needs to create a resource that already exists from an installation of Prometheus.  They both want to make <code>v1beta1.metrics.k8s.io</code>.</p>
  <p>I went to see if the resource was the same, so I could just leave it.  But they are not.  They each have a <code>service:</code> section that points to their respective services (<code>prometheus-adapter</code> and <code>metrics-server</code>).</p>
  <p>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.)</p>
  <p><strong>How can I install Metrics Server without messing up Prometheus?</strong></p>
  <hr />
  <p>In case it is useful, here is the full yaml for the conflicting definitions of v1beta1.metrics.k8s.io:</p>
  <p><strong>Prometheus:</strong></p>
  <pre><code>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
  </code></pre>
  <p><strong>Metrics Server:</strong></p>
  <pre><code>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
  </code></pre>
  
Tags: <kubernetes><prometheus>
Title: Metrics Server and Prometheus have overwriting resources
UserDisplayName: Vaccano
ThreadText: # Metrics Server and Prometheus have overwriting resources
  
  (Asked by: username_0 on 2023-07-27)
  
  I am trying to install [Metrics Server](https://github.com/kubernetes-sigs/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
  
  ```
  
  **Tags:** kubernetes, prometheus
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-07-28. Score: 1
  
  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.
  
  ```yml
  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!
  
  > **Comments:**
  > **username_0**: 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?  
  
  ---
  
  