c12s-kubespray/roles/kubernetes-apps/efk/fluentd/tasks/main.yml
Matthew Mosesohn 3c713a3f53 Fix upgrade for all daemonset type resources
Daemonsets cannot be simply upgraded through a single API call,
regardless of any kubectl documentation. The resource must be
purged and then recreated in order to make any changes.
2017-02-08 18:16:00 +03:00

28 lines
943 B
YAML

---
- name: "Fluentd | Write fluentd daemonset"
template:
src: fluentd-ds.yml.j2
dest: "{{ kube_config_dir }}/fluentd-ds.yaml"
register: fluentd_ds_manifest
#FIXME: remove if kubernetes/features#124 is implemented
- name: "Fluentd | Purge old fluentd daemonset"
kube:
filename: "{{kube_config_dir}}/fluentd-ds.yaml"
kubectl: "{{bin_dir}}/kubectl"
name: "fluentd-es-v{{ fluentd_version }}"
namespace: "{{system_namespace}}"
resource: "ds"
state: absent
when: inventory_hostname == groups['kube-master'][0] and fluentd_ds_manifest.changed
- name: "Fluentd | Create fluentd daemonset"
kube:
filename: "{{kube_config_dir}}/fluentd-ds.yaml"
kubectl: "{{bin_dir}}/kubectl"
name: "fluentd-es-v{{ fluentd_version }}"
namespace: "{{system_namespace}}"
resource: "ds"
state: "{{ item | ternary('latest','present') }}"
with_items: "{{ fluentd_ds_manifest.changed }}"
run_once: true