Commit c8a530a3 authored by Peter Leitzen's avatar Peter Leitzen Committed by Bob Van Landuyt

Show health graphs on group-level

Tweak cluster helper and refactor its specs.
parent 4ebbfb9f
...@@ -20,9 +20,4 @@ module ClustersHelper ...@@ -20,9 +20,4 @@ module ClustersHelper
!cluster.provider.legacy_abac? !cluster.provider.legacy_abac?
end end
# EE overrides this
def show_cluster_health_graphs?(cluster)
false
end
end end
...@@ -10,14 +10,14 @@ module Clusters ...@@ -10,14 +10,14 @@ module Clusters
PROJECT_ONLY_APPLICATIONS = { PROJECT_ONLY_APPLICATIONS = {
Applications::Jupyter.application_name => Applications::Jupyter, Applications::Jupyter.application_name => Applications::Jupyter,
Applications::Knative.application_name => Applications::Knative, Applications::Knative.application_name => Applications::Knative
Applications::Prometheus.application_name => Applications::Prometheus
}.freeze }.freeze
APPLICATIONS = { APPLICATIONS = {
Applications::Helm.application_name => Applications::Helm, Applications::Helm.application_name => Applications::Helm,
Applications::Ingress.application_name => Applications::Ingress, Applications::Ingress.application_name => Applications::Ingress,
Applications::CertManager.application_name => Applications::CertManager, Applications::CertManager.application_name => Applications::CertManager,
Applications::Runner.application_name => Applications::Runner Applications::Runner.application_name => Applications::Runner,
Applications::Prometheus.application_name => Applications::Prometheus
}.merge(PROJECT_ONLY_APPLICATIONS).freeze }.merge(PROJECT_ONLY_APPLICATIONS).freeze
DEFAULT_ENVIRONMENT = '*'.freeze DEFAULT_ENVIRONMENT = '*'.freeze
KUBE_INGRESS_BASE_DOMAIN = 'KUBE_INGRESS_BASE_DOMAIN'.freeze KUBE_INGRESS_BASE_DOMAIN = 'KUBE_INGRESS_BASE_DOMAIN'.freeze
......
...@@ -52,6 +52,10 @@ class ClusterablePresenter < Gitlab::View::Presenter::Delegated ...@@ -52,6 +52,10 @@ class ClusterablePresenter < Gitlab::View::Presenter::Delegated
raise NotImplementedError raise NotImplementedError
end end
def clusters_path(params = {})
raise NotImplementedError
end
def empty_state_help_text def empty_state_help_text
nil nil
end end
......
...@@ -24,6 +24,11 @@ class GroupClusterablePresenter < ClusterablePresenter ...@@ -24,6 +24,11 @@ class GroupClusterablePresenter < ClusterablePresenter
group_cluster_path(clusterable, cluster, params) group_cluster_path(clusterable, cluster, params)
end end
override :clusters_path
def clusters_path(params = {})
group_clusters_path(clusterable, params)
end
override :empty_state_help_text override :empty_state_help_text
def empty_state_help_text def empty_state_help_text
s_('ClusterIntegration|Adding an integration to your group will share the cluster across all your projects.') s_('ClusterIntegration|Adding an integration to your group will share the cluster across all your projects.')
......
...@@ -24,6 +24,11 @@ class ProjectClusterablePresenter < ClusterablePresenter ...@@ -24,6 +24,11 @@ class ProjectClusterablePresenter < ClusterablePresenter
project_cluster_path(clusterable, cluster, params) project_cluster_path(clusterable, cluster, params)
end end
override :clusters_path
def clusters_path(params = {})
project_clusters_path(clusterable, params)
end
override :sidebar_text override :sidebar_text
def sidebar_text def sidebar_text
s_('ClusterIntegration|With a Kubernetes cluster associated to this project, you can use review apps, deploy your applications, run your pipelines, and much more in an easy way.') s_('ClusterIntegration|With a Kubernetes cluster associated to this project, you can use review apps, deploy your applications, run your pipelines, and much more in an easy way.')
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
= render 'banner' = render 'banner'
= render 'form' = render 'form'
= render_if_exists 'projects/clusters/prometheus_graphs' if show_cluster_health_graphs?(@cluster) = render_if_exists 'projects/clusters/prometheus_graphs'
.cluster-applications-table#js-cluster-applications .cluster-applications-table#js-cluster-applications
......
...@@ -28,6 +28,7 @@ deployments. ...@@ -28,6 +28,7 @@ deployments.
| [Helm Tiller](https://docs.helm.sh) | 11.6+ | Helm is a package manager for Kubernetes and is required to install all the other applications. It is installed in its own pod inside the cluster which can run the `helm` CLI in a safe environment. | n/a | | [Helm Tiller](https://docs.helm.sh) | 11.6+ | Helm is a package manager for Kubernetes and is required to install all the other applications. It is installed in its own pod inside the cluster which can run the `helm` CLI in a safe environment. | n/a |
| [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress) | 11.6+ | Ingress can provide load balancing, SSL termination, and name-based virtual hosting. It acts as a web proxy for your applications and is useful if you want to use [Auto DevOps](../../../topics/autodevops/index.md) or deploy your own web apps. | [stable/nginx-ingress](https://github.com/helm/charts/tree/master/stable/nginx-ingress) | | [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress) | 11.6+ | Ingress can provide load balancing, SSL termination, and name-based virtual hosting. It acts as a web proxy for your applications and is useful if you want to use [Auto DevOps](../../../topics/autodevops/index.md) or deploy your own web apps. | [stable/nginx-ingress](https://github.com/helm/charts/tree/master/stable/nginx-ingress) |
| [Cert-Manager](https://docs.cert-manager.io/en/latest/) | 11.6+ | Cert-Manager is a native Kubernetes certificate management controller that helps with issuing certificates. Installing Cert-Manager on your cluster will issue a certificate by [Let's Encrypt](https://letsencrypt.org/) and ensure that certificates are valid and up-to-date. | [stable/cert-manager](https://github.com/helm/charts/tree/master/stable/cert-manager) | | [Cert-Manager](https://docs.cert-manager.io/en/latest/) | 11.6+ | Cert-Manager is a native Kubernetes certificate management controller that helps with issuing certificates. Installing Cert-Manager on your cluster will issue a certificate by [Let's Encrypt](https://letsencrypt.org/) and ensure that certificates are valid and up-to-date. | [stable/cert-manager](https://github.com/helm/charts/tree/master/stable/cert-manager) |
| [Prometheus](https://prometheus.io/docs/introduction/overview/) | 11.11+ | Prometheus is an open-source monitoring and alerting system useful to supervise your deployed applications. | [stable/prometheus](https://github.com/helm/charts/tree/master/stable/prometheus) |
| [GitLab Runner](https://docs.gitlab.com/runner/) | 11.10+ | GitLab Runner is the open source project that is used to run your jobs and send the results back to GitLab. It is used in conjunction with [GitLab CI/CD](../../../ci/README.md), the open-source continuous integration service included with GitLab that coordinates the jobs. When installing the GitLab Runner via the applications, it will run in **privileged mode** by default. Make sure you read the [security implications](../../project/clusters/index.md#security-implications) before doing so. | [runner/gitlab-runner](https://gitlab.com/charts/gitlab-runner) | | [GitLab Runner](https://docs.gitlab.com/runner/) | 11.10+ | GitLab Runner is the open source project that is used to run your jobs and send the results back to GitLab. It is used in conjunction with [GitLab CI/CD](../../../ci/README.md), the open-source continuous integration service included with GitLab that coordinates the jobs. When installing the GitLab Runner via the applications, it will run in **privileged mode** by default. Make sure you read the [security implications](../../project/clusters/index.md#security-implications) before doing so. | [runner/gitlab-runner](https://gitlab.com/charts/gitlab-runner) |
NOTE: **Note:** NOTE: **Note:**
...@@ -38,8 +39,6 @@ applications in a group-level cluster is planned for future releases. For update ...@@ -38,8 +39,6 @@ applications in a group-level cluster is planned for future releases. For update
- Support installing [JupyterHub in group-level - Support installing [JupyterHub in group-level
clusters](https://gitlab.com/gitlab-org/gitlab-ce/issues/51989) clusters](https://gitlab.com/gitlab-org/gitlab-ce/issues/51989)
- Support installing [Prometheus in group-level
clusters](https://gitlab.com/gitlab-org/gitlab-ce/issues/51963)
## RBAC compatibility ## RBAC compatibility
......
...@@ -82,4 +82,10 @@ describe GroupClusterablePresenter do ...@@ -82,4 +82,10 @@ describe GroupClusterablePresenter do
it { is_expected.to eq(group_cluster_path(group, cluster)) } it { is_expected.to eq(group_cluster_path(group, cluster)) }
end end
describe '#clusters_path' do
subject { presenter.clusters_path }
it { is_expected.to eq(group_clusters_path(group)) }
end
end end
...@@ -82,4 +82,10 @@ describe ProjectClusterablePresenter do ...@@ -82,4 +82,10 @@ describe ProjectClusterablePresenter do
it { is_expected.to eq(project_cluster_path(project, cluster)) } it { is_expected.to eq(project_cluster_path(project, cluster)) }
end end
describe '#clusters_path' do
subject { presenter.clusters_path }
it { is_expected.to eq(project_clusters_path(project)) }
end
end end
...@@ -151,8 +151,8 @@ describe Clusters::Applications::CreateService do ...@@ -151,8 +151,8 @@ describe Clusters::Applications::CreateService do
'helm' | :application_helm | true | false 'helm' | :application_helm | true | false
'ingress' | :application_ingress | true | true 'ingress' | :application_ingress | true | true
'runner' | :application_runner | true | true 'runner' | :application_runner | true | true
'prometheus' | :application_prometheus | true | true
'jupyter' | :application_jupyter | false | true 'jupyter' | :application_jupyter | false | true
'prometheus' | :application_prometheus | false | true
end end
with_them do with_them do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment