Auto-detect if metrics server is already installed so this package can be always on
Right now, if the cluster already has a metrics server, there are problems installing the package. To make it easier on the end user, we could use {{- if or (not .Capabilities.APIVersions.Has "metrics.k8s.io/v1beta1") (lookup "helm.toolkit.fluxcd.io/v2beta1" "HelmRelease" "bigbang" "metrics-server") -}}
(or similar) as a prerequisite to installing this package. This should install if there is no metrics server OR if there is a metrics server and a HelmRelease (upgrading this package).
The conditional should be placed on the GitRepository / HelmRelease / Secrets in Big Bang, not necessarily in this chart. This is because there isn't a unique resource created by this package that wouldn't also be created if someone installed a metric server (via the distro, or manually from a helm chart).
Acceptance criteria:
- If cluster already has a metrics server installed from outside of Big Bang, Big Bang does not install metrics server package
- If cluster does not have a metrics server installed, Big Bang installs this package
- If cluster has a metrics server installed from Big Bang, Big Bang upgrades the metrics server package.
- Package's
enabled
flag defaults totrue
.enabled: false
will turn off the package regardless of the above rules.