summaryrefslogtreecommitdiff
path: root/roles/kubernetes/addons/metrics-server/tasks/main.yml
blob: 5236e4e3859ec098c7654a746b436fcf0f4de7f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
---
- name: create base directory for metrics-server addon
  file:
    path: /etc/kubernetes/addons/metrics-server
    state: directory

- name: copy config for metrics-server
  template:
    src: "components.{{ kubernetes_metrics_server_version }}.yml.j2"
    dest: /etc/kubernetes/addons/metrics-server/config.yml

  ## TODO: move to server-side apply (GA since 1.22)
- name: install metrics-server onto the cluster
  command: kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/addons/metrics-server/config.yml
  register: kube_metrics_server_apply_result
  changed_when: (kube_metrics_server_apply_result.stdout_lines | reject("regex", " unchanged$") | list | length) > 0