### Install kubectl-cost using Krew Source: https://opencost.io/docs/integrations/kubectl-cost Install the kubectl-cost plugin using the Krew plugin manager. This is the recommended installation method if Krew is already set up. ```bash kubectl krew install cost ``` -------------------------------- ### Install OpenCost using Manifest on STACKIT Source: https://opencost.io/docs/configuration/stackit Installs OpenCost on STACKIT using the Helm chart after adding and updating the repository. Assumes the opencost namespace will be created. ```bash helm install opencost opencost/opencost --namespace opencost --create-namespace ``` -------------------------------- ### Install OpenCost using Helm Chart Source: https://opencost.io/docs/configuration/otc Installs OpenCost using its Helm chart with custom settings defined in a `local.yaml` file. This is the recommended installation method. ```bash helm install opencost --repo https://opencost.github.io/opencost-helm-chart opencost \ --namespace opencost -f local.yaml ``` -------------------------------- ### Clone and Start OpenCost with MCP Server (Tilt) Source: https://opencost.io/docs/integrations/mcp Clone the OpenCost repository and start the development environment using Tilt. The MCP server is enabled by default. ```bash # Clone and start OpenCost with MCP server git clone https://github.com/opencost/opencost.git cd opencost tilt up ``` -------------------------------- ### Create and Start Diagnostics Export Controller Source: https://opencost.io/docs/developer/export-api Initializes and starts the diagnostics exporter with a specified export frequency. Includes setup for a diagnostic service and file storage. ```go package main import ( "context" "math/rand" "os" "os/signal" "syscall" "time" "github.com/opencost/opencost/core/pkg/diagnostics" "github.com/opencost/opencost/core/pkg/storage" diagexporter "github.com/opencost/opencost/core/pkg/diagnostics/exporter" ) const ( ClusterID = "MyClusterID" ApplicationName = "MyApplication" ExportFrequency time.Duration = 10 * time.Second ) // entry point for finops-agent func main() { diag := diagnostics.NewDiagnosticService() // register a faux diagnostic runner that will flip a coin diag.Register( "coin-flip", "A randomized diagnostic result", "random", func(ctx context.Context) (map[string]any, error) { result := "tails" if rand.Intn(2) == 1 { result = "heads" } return map[string]any{ "result": result, }, nil }, ) // create a file storage located in the /tmp directory (this will ultimately produce /tmp//diagnostics//