diff options
author | Christian Pointner <equinox@spreadspace.org> | 2022-05-08 01:55:09 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2022-05-08 01:55:09 +0200 |
commit | 05e65f43df9c502eb764b184a66dd1ef5a76685c (patch) | |
tree | e2d15f294b0e5016cace524cca5f1ccb9ea0d33f /roles/kubernetes/addons | |
parent | upgrade kubernetes cluster addon: metrics-server (diff) |
k8s/kubeadm: fix some minor TODOs
Diffstat (limited to 'roles/kubernetes/addons')
-rw-r--r-- | roles/kubernetes/addons/metrics-server/tasks/main.yml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/roles/kubernetes/addons/metrics-server/tasks/main.yml b/roles/kubernetes/addons/metrics-server/tasks/main.yml index 5236e4e3..87c57346 100644 --- a/roles/kubernetes/addons/metrics-server/tasks/main.yml +++ b/roles/kubernetes/addons/metrics-server/tasks/main.yml @@ -9,8 +9,13 @@ 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: check if metrics-server is already installed + check_mode: no + command: kubectl --kubeconfig /etc/kubernetes/admin.conf diff -f /etc/kubernetes/addons/metrics-server/config.yml + failed_when: false + changed_when: false + register: kube_metrics_server_diff_result + - name: install metrics-server onto the cluster + when: kube_metrics_server_diff_result.rc != 0 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 |