Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update documentation to include installation with in-cluster prometheus in openshift #1144

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ More details and instructions on both deployment options are covered in the sect

A standard deployment of Kubecost to OpenShift is no different from deployments to other platforms with the exception of additional settings which may be required to successfully deploy to OpenShift.

Kubecost is installed with Cost Analyzer and Prometheus as a time-series database. Data is gathered by the Prometheus instance bundled with Kubecost. Kubecost then pushes and queries metrics to and from Prometheus.
Kubecost is installed with Cost Analyzer and Prometheus as a time-series database. Data is gathered by the Prometheus instance. Kubecost then pushes and queries metrics to and from Prometheus.

The standard deployment is illustrated in the following diagram.

Expand All @@ -42,7 +42,7 @@ Install Kubecost using OpenShift specific values. Note that the below command fe

```sh
helm upgrade --install kubecost kubecost/cost-analyzer -n kubecost --create-namespace \
-f https://raw.githubusercontent.com/kubecost/cost-analyzer-helm-chart/develop/cost-analyzer/values-openshift.yaml
-f https://raw.githubusercontent.com/kubecost/cost-analyzer-helm-chart/<$VERSION>/cost-analyzer/values-openshift.yaml
Copy link
Member

@thomasvn thomasvn Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The drawback to doing this is that now this link will no longer be checked by the CI's link-checker. What happens if we someday decide to rename or delete values-openshift.yaml?

Although referencing develop branch comes with drawbacks, I still think it's more valuable than putting <$VERSION> here. @mittal-ishaan @chipzoller thoughts?

Copy link
Contributor Author

@mittal-ishaan mittal-ishaan Dec 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use develop. But we can also start with having versions. like v2.5 and then update docs when every new minor or major version gets released.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomasvn, the problem here with listing files from the develop branch is we put users in a precarious and potentially unsupported position when they install a versioned release but use a values file which doesn't correspond to that release. We really need to get away from that practice entirely when we're talking about our official docs. Rather than putting in a placeholder like <$VERSION> we should make this the same as the version referenced by the docs. For example, if users are reading version 2.5 of our docs then any files that are associated with that release should be pointed to the v2.5 branch. This obviously means that any new files that get referenced are "released" in that branch.

```

Because OpenShift disallows defining certain fields in a pod's `securityContext` configuration, values specific to OpenShift must be used. The necessary values have already been defined in the OpenShift values file but may be customized to your specific needs.
Expand All @@ -60,6 +60,30 @@ If you have not opted to do so during installation, it may be necessary to creat

After installation, wait for all pods to be ready. Kubecost will begin collecting data and may take up to 15 minutes for the UI to reflect the resources in the local cluster.

### Using in-cluster Prometheus

mittal-ishaan marked this conversation as resolved.
Show resolved Hide resolved
{% hint style="warning" %}
This installation method is available, but not generally recommended. Please review the following documentation before proceeding. [Documentation](/install-and-configure/advanced-configuration/custom-prom).
{% endhint %}

If required Kubecost can leverage an existing Prometheus that exists on your cluster, as opposed to installing Kubecost's bundled Prometheus.

1. First, add the following label to the namespace where Kubecost will be deployed:

```sh
oc label namespace kubecost openshift.io/cluster-monitoring=true
```

2. Install Kubecost with the following command:

```sh
helm upgrade --install kubecost kubecost/cost-analyzer -n kubecost --create-namespace \
-f https://raw.githubusercontent.com/kubecost/cost-analyzer-helm-chart/<$VERSION>/cost-analyzer/values-openshift-cluster-prometheus.yaml
```

After installation, wait for all pods to be ready. Kubecost will begin collecting data and may take up to 15 minutes for the UI to reflect the resources in the local cluster.


## Community operator deployment guide

### Overview
Expand Down
Loading