From 49e3665d96fbef8b90ec9d01da1ae14f42503263 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Fri, 13 Apr 2018 18:53:39 +0300 Subject: [PATCH] Remove prometheus operator from Kubespray (#2658) Kubespray should not install any helm charts. This is a task that a user should do on his/her own through ansible or another tool. It opens the door to wrapping installation of any helm chart. --- inventory/sample/group_vars/k8s-cluster.yml | 8 +---- roles/kubernetes-apps/meta/main.yml | 6 ---- .../kubernetes-apps/metrics/defaults/main.yml | 9 ------ roles/kubernetes-apps/metrics/tasks/main.yml | 32 ------------------- tests/files/gce_centos7-flannel-addons.yml | 2 -- 5 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 roles/kubernetes-apps/metrics/defaults/main.yml delete mode 100644 roles/kubernetes-apps/metrics/tasks/main.yml diff --git a/inventory/sample/group_vars/k8s-cluster.yml b/inventory/sample/group_vars/k8s-cluster.yml index 345d22a36..38d2ce5e5 100644 --- a/inventory/sample/group_vars/k8s-cluster.yml +++ b/inventory/sample/group_vars/k8s-cluster.yml @@ -162,15 +162,9 @@ dashboard_enabled: true # Monitoring apps for k8s efk_enabled: false -# Helm deployment. Needs for Prometheus Operator, k8s metrics. +# Helm deployment helm_enabled: false -# Prometheus Operator. Needs for k8s metrics. Installed Helm is required. -prometheus_operator_enabled: false - -# K8s cluster metrics. Installed Helm and Prometheus Operator are required. -k8s_metrics_enabled: false - # Istio deployment istio_enabled: false diff --git a/roles/kubernetes-apps/meta/main.yml b/roles/kubernetes-apps/meta/main.yml index bc05e6f8c..fca51a3b6 100644 --- a/roles/kubernetes-apps/meta/main.yml +++ b/roles/kubernetes-apps/meta/main.yml @@ -27,12 +27,6 @@ dependencies: - apps - registry - - role: kubernetes-apps/metrics - when: prometheus_operator_enabled - tags: - - apps - - metrics - # istio role should be last because it takes a long time to initialize and # will cause timeouts trying to start other addons. - role: kubernetes-apps/istio diff --git a/roles/kubernetes-apps/metrics/defaults/main.yml b/roles/kubernetes-apps/metrics/defaults/main.yml deleted file mode 100644 index 72018e6f5..000000000 --- a/roles/kubernetes-apps/metrics/defaults/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -# Prometheus Operator. Needs for k8s metrics. Installed Helm is required. -prometheus_operator_enabled: false - -# K8s cluster metrics. Installed Helm and Prometheus Operators are required. -k8s_metrics_enabled: false - -# Separate namespace for monitoring/metrics -monitoring_namespace: "monitoring" diff --git a/roles/kubernetes-apps/metrics/tasks/main.yml b/roles/kubernetes-apps/metrics/tasks/main.yml deleted file mode 100644 index e2280e98b..000000000 --- a/roles/kubernetes-apps/metrics/tasks/main.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- name: Metrics | Make sure Helm is installed - command: "{{ bin_dir }}/helm version" - register: helm_ready_result - until: helm_ready_result|succeeded - retries: 4 - delay: 5 - when: - - prometheus_operator_enabled - - inventory_hostname == groups['kube-master'][0] - -- name: Metrics | Add coreos repo - command: "{{ bin_dir }}/helm repo add coreos https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/" - when: - - prometheus_operator_enabled - - inventory_hostname == groups['kube-master'][0] - run_once: true - -- name: Metrics | Install Prometheus Operator - command: "{{ bin_dir }}/helm upgrade --install prometheus-operator coreos/prometheus-operator --namespace {{ monitoring_namespace }}" - when: - - prometheus_operator_enabled - - inventory_hostname == groups['kube-master'][0] - run_once: true - -- name: Metrics | Install K8s cluster metrics - command: "{{ bin_dir }}/helm upgrade --install kube-prometheus coreos/kube-prometheus --namespace {{ monitoring_namespace }}" - when: - - prometheus_operator_enabled - - k8s_metrics_enabled - - inventory_hostname == groups['kube-master'][0] - run_once: true diff --git a/tests/files/gce_centos7-flannel-addons.yml b/tests/files/gce_centos7-flannel-addons.yml index c12092011..9e2e1083f 100644 --- a/tests/files/gce_centos7-flannel-addons.yml +++ b/tests/files/gce_centos7-flannel-addons.yml @@ -16,7 +16,5 @@ deploy_netchecker: true kubedns_min_replicas: 1 cloud_provider: gce kube_encrypt_secret_data: true -prometheus_operator_enabled: true -k8s_metrics_enabled: true ingress_nginx_enabled: true cert_manager_enabled: true