Metrics Server: Difference between revisions

From WilliamsNet Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:


== Installation ==
== Installation ==
There is a helm chart (untested), but the deployment is very straightforward using the [https://github.com/kubernetes-incubator/metrics-server GitHub] repository:
There is a helm chart (untested), but the deployment is very straightforward using the consolidated manifest from the [https://github.com/kubernetes-incubator/metrics-server GitHub] repository:
  git clone https://github.com/kubernetes-incubator/metrics-server.git
  wget https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.4.0/components.yaml


Due to the fact that the default '''kubeadm''' installation uses self-signed certificates for the kubelets (not certificated signed by the main CA for the cluster), one minor change needs to be made to the deployment if this is being applied to an existing cluster.  Modify the file '''metrics-server/deploy/1.8+/metrics-server-deployment.yaml''', adding the '''--kubelet-insecure-tls''' argument to the containers spec so that it looks like this<ref>https://github.com/kubernetes-incubator/metrics-server/issues/146#issuecomment-430483619</ref>:
Due to the fact that the default '''kubeadm''' installation uses self-signed certificates for the kubelets (not certificated signed by the main CA for the cluster), one minor change needs to be made to the deployment if this is being applied to an existing cluster.  Modify the file '''metrics-server/manifests/base/deployment.yaml''', adding the '''--kubelet-insecure-tls''' argument to the containers spec so that it looks like this<ref>https://github.com/kubernetes-incubator/metrics-server/issues/146#issuecomment-430483619</ref>:
<pre>      containers:
<pre>      containers:
       - name: metrics-server
       - name: metrics-server
Line 19: Line 19:


This tells the metrics server to ignore the fact that the certificates are self-signed -- in general, not the best solution, but as it is totally within the cluster, the exposure is minimal.   
This tells the metrics server to ignore the fact that the certificates are self-signed -- in general, not the best solution, but as it is totally within the cluster, the exposure is minimal.   
Also in this file, you need to change the 'MaxUnavailable' parameter from '0' to '1' -- otherwise, this deployment cannot be evicted and will hang up a cluster upgrade.


Deploy the metrics server:
Deploy the metrics server:
  kubectl apply -f metrics-server/manifests/base/
  kubectl apply -f components.yaml
 
Note that the manifest is also in the k8s-admin/metrics-server directory in the GitLab repository ...


----
----


<references/>
<references/>

Latest revision as of 23:37, 7 November 2020

Kubernetes provides for metrics collection on performance/capacity of nodes, pods, etc. Previously, this was done by the Heapster application, but that is now deprecated in favor of an internal metrics server. This capability is still in kubernetes incubator status, but it provides a significant capability at this time.

Installation[edit]

There is a helm chart (untested), but the deployment is very straightforward using the consolidated manifest from the GitHub repository:

wget https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.4.0/components.yaml

Due to the fact that the default kubeadm installation uses self-signed certificates for the kubelets (not certificated signed by the main CA for the cluster), one minor change needs to be made to the deployment if this is being applied to an existing cluster. Modify the file metrics-server/manifests/base/deployment.yaml, adding the --kubelet-insecure-tls argument to the containers spec so that it looks like this<ref>https://github.com/kubernetes-incubator/metrics-server/issues/146#issuecomment-430483619</ref>:

      containers:
      - name: metrics-server
        image: k8s.gcr.io/metrics-server-amd64:v0.x.x
        imagePullPolicy: Always
        args:
          - --cert-dir=/tmp
          - --secure-port=4443
          - --kubelet-insecure-tls
        volumeMounts:
        - name: tmp-dir
          mountPath: /tmp

This tells the metrics server to ignore the fact that the certificates are self-signed -- in general, not the best solution, but as it is totally within the cluster, the exposure is minimal.

Also in this file, you need to change the 'MaxUnavailable' parameter from '0' to '1' -- otherwise, this deployment cannot be evicted and will hang up a cluster upgrade.

Deploy the metrics server:

kubectl apply -f components.yaml

Note that the manifest is also in the k8s-admin/metrics-server directory in the GitLab repository ...


<references/>