|
@@ -20,9 +20,14 @@
|
|
|
include_tasks: install_hosa.yaml
|
|
|
when: openshift_metrics_install_hawkular_agent | default(false) | bool
|
|
|
|
|
|
+- name: Generate metrics-server deployment
|
|
|
+ template:
|
|
|
+ src: metrics-server-deployment.j2
|
|
|
+ dest: "{{ mktemp.stdout }}/templates/metrics-server-deployment.yaml"
|
|
|
+
|
|
|
- find:
|
|
|
paths: "{{ mktemp.stdout }}/templates"
|
|
|
- patterns: "^(?!metrics-hawkular-openshift-agent).*.yaml"
|
|
|
+ patterns: "^(?!metrics-hawkular-openshift-agent|metrics-server-|extension-apiserver-authentication-reader-metrics-server-).*.yaml"
|
|
|
use_regex: true
|
|
|
register: object_def_files
|
|
|
changed_when: no
|
|
@@ -67,6 +72,50 @@
|
|
|
with_items: "{{ hawkular_agent_object_defs.results }}"
|
|
|
when: openshift_metrics_install_hawkular_agent | bool
|
|
|
|
|
|
+- find:
|
|
|
+ paths: "{{ mktemp.stdout }}/templates"
|
|
|
+ patterns: "^metrics-server-.*.yaml"
|
|
|
+ use_regex: true
|
|
|
+ register: metrics_server_object_def_files
|
|
|
+ changed_when: no
|
|
|
+
|
|
|
+- slurp:
|
|
|
+ src: "{{item.path}}"
|
|
|
+ register: metrics_server_object_defs
|
|
|
+ with_items: "{{ metrics_server_object_def_files.files }}"
|
|
|
+ changed_when: no
|
|
|
+
|
|
|
+- name: Create Metrics Server objects
|
|
|
+ include_tasks: oc_apply.yaml
|
|
|
+ vars:
|
|
|
+ kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
|
|
|
+ namespace: "{{ openshift_metrics_server_project }}"
|
|
|
+ file_name: "{{ item.source }}"
|
|
|
+ file_content: "{{ item.content | b64decode | from_yaml }}"
|
|
|
+ with_items: "{{ metrics_server_object_defs.results }}"
|
|
|
+
|
|
|
+- find:
|
|
|
+ paths: "{{ mktemp.stdout }}/templates"
|
|
|
+ patterns: "^extension-apiserver-authentication-reader-metrics-server-rolebinding.yaml"
|
|
|
+ use_regex: true
|
|
|
+ register: apiextension_object_def_files
|
|
|
+ changed_when: no
|
|
|
+
|
|
|
+- slurp:
|
|
|
+ src: "{{item.path}}"
|
|
|
+ register: apiextension_object_defs
|
|
|
+ with_items: "{{ apiextension_object_def_files.files }}"
|
|
|
+ changed_when: no
|
|
|
+
|
|
|
+- name: Create Metrics Server kube-system objects
|
|
|
+ include_tasks: oc_apply.yaml
|
|
|
+ vars:
|
|
|
+ kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
|
|
|
+ namespace: kube-system
|
|
|
+ file_name: "{{ item.source }}"
|
|
|
+ file_content: "{{ item.content | b64decode | from_yaml }}"
|
|
|
+ with_items: "{{ apiextension_object_defs.results }}"
|
|
|
+
|
|
|
- include_tasks: update_master_config.yaml
|
|
|
when: not openshift_version_gte_3_9
|
|
|
|