Преглед на файлове

Merge branch 'develop' into opencost-docs

Elena Lape преди 4 години
родител
ревизия
fd7d087aa9
променени са 100 файла, в които са добавени 340 реда и са изтрити 315 реда
  1. 33 3
      CONTRIBUTING.md
  2. 2 2
      README.md
  3. 2 2
      cmd/costmodel/main.go
  4. 2 2
      deploying-as-a-pod.md
  5. 1 1
      go.mod
  6. 7 9
      pkg/cloud/awsprovider.go
  7. 7 7
      pkg/cloud/azureprovider.go
  8. 3 3
      pkg/cloud/csvprovider.go
  9. 3 3
      pkg/cloud/customprovider.go
  10. 7 7
      pkg/cloud/gcpprovider.go
  11. 6 6
      pkg/cloud/provider.go
  12. 4 4
      pkg/cloud/providerconfig.go
  13. 2 2
      pkg/clustercache/clustercache.go
  14. 4 4
      pkg/clustercache/clusterexporter.go
  15. 3 3
      pkg/clustercache/clusterimporter.go
  16. 1 1
      pkg/clustercache/watchcontroller.go
  17. 16 13
      pkg/cmd/agent/agent.go
  18. 3 3
      pkg/cmd/commands.go
  19. 3 3
      pkg/cmd/costmodel/costmodel.go
  20. 3 3
      pkg/config/configfile.go
  21. 2 2
      pkg/config/configmanager.go
  22. 11 11
      pkg/costmodel/aggregation.go
  23. 1 1
      pkg/costmodel/aggregation_test.go
  24. 6 6
      pkg/costmodel/allocation.go
  25. 6 6
      pkg/costmodel/cluster.go
  26. 4 4
      pkg/costmodel/cluster_helpers.go
  27. 4 4
      pkg/costmodel/cluster_helpers_test.go
  28. 7 7
      pkg/costmodel/clusterinfo.go
  29. 4 4
      pkg/costmodel/clusters/clustermap.go
  30. 2 2
      pkg/costmodel/containerkeys.go
  31. 8 8
      pkg/costmodel/costmodel.go
  32. 1 1
      pkg/costmodel/intervals.go
  33. 1 1
      pkg/costmodel/intervals_test.go
  34. 2 2
      pkg/costmodel/key.go
  35. 11 11
      pkg/costmodel/metrics.go
  36. 5 5
      pkg/costmodel/networkcosts.go
  37. 6 6
      pkg/costmodel/promparsers.go
  38. 23 20
      pkg/costmodel/router.go
  39. 2 2
      pkg/costmodel/settings.go
  40. 5 5
      pkg/costmodel/sql.go
  41. 2 2
      pkg/env/costmodelenv.go
  42. 1 1
      pkg/env/env.go
  43. 3 3
      pkg/kubecost/allocation.go
  44. 2 2
      pkg/kubecost/allocation_test.go
  45. 1 1
      pkg/kubecost/allocationfilter.go
  46. 2 2
      pkg/kubecost/allocationprops.go
  47. 2 2
      pkg/kubecost/asset.go
  48. 1 1
      pkg/kubecost/asset_test.go
  49. 1 1
      pkg/kubecost/asset_unmarshal.go
  50. 1 1
      pkg/kubecost/asset_unmarshal_test.go
  51. 1 1
      pkg/kubecost/bingen.go
  52. 2 2
      pkg/kubecost/config.go
  53. 1 1
      pkg/kubecost/config_test.go
  54. 1 1
      pkg/kubecost/json.go
  55. 2 1
      pkg/kubecost/kubecost_codecs.go
  56. 1 1
      pkg/kubecost/summaryallocation.go
  57. 1 1
      pkg/kubecost/summaryallocation_test.go
  58. 1 1
      pkg/kubecost/totals.go
  59. 3 3
      pkg/kubecost/window.go
  60. 1 1
      pkg/kubecost/window_test.go
  61. 2 2
      pkg/metrics/deploymentmetrics.go
  62. 1 1
      pkg/metrics/jobmetrics.go
  63. 2 2
      pkg/metrics/kubemetrics.go
  64. 9 5
      pkg/metrics/metricsconfig.go
  65. 2 2
      pkg/metrics/namespacemetrics.go
  66. 3 3
      pkg/metrics/nodemetrics.go
  67. 2 2
      pkg/metrics/podlabelmetrics.go
  68. 3 3
      pkg/metrics/podmetrics.go
  69. 1 1
      pkg/metrics/pvcmetrics.go
  70. 1 1
      pkg/metrics/pvmetrics.go
  71. 2 2
      pkg/metrics/servicemetrics.go
  72. 2 2
      pkg/metrics/statefulsetmetrics.go
  73. 2 2
      pkg/prom/diagnostics.go
  74. 1 1
      pkg/prom/error.go
  75. 1 1
      pkg/prom/metrics.go
  76. 5 5
      pkg/prom/prom.go
  77. 5 5
      pkg/prom/query.go
  78. 2 2
      pkg/prom/ratelimitedclient_test.go
  79. 2 2
      pkg/prom/result.go
  80. 1 1
      pkg/prom/validate.go
  81. 3 3
      pkg/services/clusters/clustermanager.go
  82. 2 2
      pkg/services/clusters/clustersendpoints.go
  83. 7 22
      pkg/services/clusterservice.go
  84. 1 1
      pkg/services/services.go
  85. 1 1
      pkg/storage/azurestorage.go
  86. 1 1
      pkg/storage/filestorage.go
  87. 1 1
      pkg/storage/gcsstorage.go
  88. 1 1
      pkg/storage/s3storage.go
  89. 1 1
      pkg/storage/storagetypes.go
  90. 1 1
      pkg/storage/storagetypes_test.go
  91. 2 2
      pkg/thanos/thanos.go
  92. 1 1
      pkg/util/atomic/example_intervalrunner_test.go
  93. 1 1
      pkg/util/buffer.go
  94. 2 2
      pkg/util/cache/cachegroup.go
  95. 5 5
      pkg/util/filterutil/allocationfilters.go
  96. 3 3
      pkg/util/filterutil/allocationfilters_test.go
  97. 1 1
      pkg/util/httputil/httputil.go
  98. 1 1
      pkg/util/interval/intervalrunner.go
  99. 2 1
      pkg/util/mapper/mapper.go
  100. 1 1
      pkg/util/retry/retry.go

+ 33 - 3
CONTRIBUTING.md

@@ -20,8 +20,8 @@ This repository's contribution workflow follows a typical open-source model:
 Follow these steps to build from source and deploy:
 Follow these steps to build from source and deploy:
 
 
 1. `docker build --rm -f "Dockerfile" -t <repo>/kubecost-cost-model:<tag> .`
 1. `docker build --rm -f "Dockerfile" -t <repo>/kubecost-cost-model:<tag> .`
-2. Edit the [pulled image](https://github.com/kubecost/cost-model/blob/master/kubernetes/deployment.yaml#L25) in the deployment.yaml to <repo>/kubecost-cost-model:<tag>
-3. Set [this environment variable](https://github.com/kubecost/cost-model/blob/master/kubernetes/deployment.yaml#L33) to the address of your prometheus server
+2. Edit the [pulled image](https://github.com/kubecost/opencost/blob/master/kubernetes/deployment.yaml#L25) in the deployment.yaml to <repo>/kubecost-cost-model:<tag>
+3. Set [this environment variable](https://github.com/kubecost/opencost/blob/master/kubernetes/deployment.yaml#L33) to the address of your prometheus server
 4. `kubectl create namespace cost-model`
 4. `kubectl create namespace cost-model`
 5. `kubectl apply -f kubernetes/ --namespace cost-model`
 5. `kubectl apply -f kubernetes/ --namespace cost-model`
 6. `kubectl port-forward --namespace cost-model service/cost-model 9003`
 6. `kubectl port-forward --namespace cost-model service/cost-model 9003`
@@ -32,7 +32,24 @@ To confirm that the server is running, you can hit [http://localhost:9003/costDa
 
 
 ## Running locally
 ## Running locally
 
 
-In order to run cost-model locally, or outside of the runtime of a Kubernetes cluster, you can set the environment variable `KUBECONFIG_PATH`.
+To run locally cd into `cmd/costmodel` and `go run main.go`
+
+cost-model requires a connection to Prometheus in order to operate so setting the environment variable `PROMETHEUS_SERVER_ENDPOINT` is required.
+In order to expose Prometheus to cost-model it may be required to port-forward using kubectl to your Prometheus endpoint.
+
+For example:
+
+```bash
+kubectl port-forward svc/kubecost-prometheus-server 9080:80
+```
+
+This would expose Prometheus on port 9080 and allow setting the environment variable as so:
+
+```bash
+PROMETHEUS_SERVER_ENDPOINT="http://127.0.0.1:9080"
+```
+
+If you want to run with a specific kubeconfig the environment variable `KUBECONFIG_PATH` can be used. cost-model will attempt to connect to your Kubernetes cluster in a similar fashion as kubectl so the env is not required. The order of precedence is `KUBECONFIG_PATH` > default kubeconfig file location ($HOME/.kube/config) > in cluster config
 
 
 Example:
 Example:
 
 
@@ -40,6 +57,19 @@ Example:
 export KUBECONFIG_PATH=~/.kube/config
 export KUBECONFIG_PATH=~/.kube/config
 ```
 ```
 
 
+There are two more environement variabes recommended to run locally. These should be set as the default file location used is `/var/` which usually requires more permissions than kubecost actually needs to run. They do not need to match but keeping everything together can help cleanup when no longer needed.
+
+```bash
+ETL_PATH_PREFIX="/my/cool/path/kubecost/var/config"
+CONFIG_PATH="/my/cool/path/kubecost/var/config"
+```
+
+An example of the full command:
+
+```bash
+ETL_PATH_PREFIX="/my/cool/path/kubecost/var/config" CONFIG_PATH="/my/cool/path/kubecost/var/config" PROMETHEUS_SERVER_ENDPOINT="http://127.0.0.1:9090" go run main.go
+```
+
 ## Running the integration tests
 ## Running the integration tests
 
 
 To run these tests:
 To run these tests:

+ 2 - 2
README.md

@@ -4,11 +4,11 @@
 
 
 OpenCost models give teams visibility into current and historical Kubernetes spend and resource allocation. These models provide cost transparency in Kubernetes environments that support multiple applications, teams, departments, etc.
 OpenCost models give teams visibility into current and historical Kubernetes spend and resource allocation. These models provide cost transparency in Kubernetes environments that support multiple applications, teams, departments, etc.
 
 
-OpenCost is developed by [Kubecost](https://kubecost.com).
+OpenCost is developed and [open sourced](https://github.com/kubecost/opencost/issues/1224) by [Kubecost](https://kubecost.com).
 
 
 ![OpenCost allocation UI](/allocation-drilldown.gif)
 ![OpenCost allocation UI](/allocation-drilldown.gif)
 
 
-To see more on the functionality of OpenCost, as well as the full Kubecost product, please visit the [features page](https://kubecost.com/#features) on our website.
+To see the full functionality of OpenCost, as well as learn more about the full Kubecost product, see [OpenCost features](https://opencost.io) and [Kubecost features](https://kubecost.com/#features).
 
 
 Here is a summary of features enabled by this cost model:
 Here is a summary of features enabled by this cost model:
 
 

+ 2 - 2
cmd/costmodel/main.go

@@ -1,13 +1,13 @@
 package main
 package main
 
 
 import (
 import (
-	"github.com/kubecost/cost-model/pkg/cmd"
+	"github.com/kubecost/opencost/pkg/cmd"
 	"github.com/rs/zerolog/log"
 	"github.com/rs/zerolog/log"
 )
 )
 
 
 func main() {
 func main() {
 	// runs the appropriate application mode using the default cost-model command
 	// runs the appropriate application mode using the default cost-model command
-	// see: github.com/kubecost/cost-model/pkg/cmd package for details
+	// see: github.com/kubecost/opencost/pkg/cmd package for details
 	if err := cmd.Execute(nil); err != nil {
 	if err := cmd.Execute(nil); err != nil {
 		log.Fatal().Err(err)
 		log.Fatal().Err(err)
 	}
 	}

+ 2 - 2
deploying-as-a-pod.md

@@ -2,9 +2,9 @@
 
 
 See this page for all [Kubecost install options](http://docs.kubecost.com/install).
 See this page for all [Kubecost install options](http://docs.kubecost.com/install).
 
 
-If you would like to deploy the cost model (w/o dashboards) directly a pod on your cluster, complete the steps listed below. 
+If you would like to deploy the cost model (w/o dashboards) directly a pod on your cluster, complete the steps listed below.
 
 
-1. Set [this environment variable](https://github.com/kubecost/cost-model/blob/c211fbc1244a9da9667c7180a9e4c7f988d7978a/kubernetes/deployment.yaml#L33) to the address of your prometheus server
+1. Set [this environment variable](https://github.com/kubecost/opencost/blob/c211fbc1244a9da9667c7180a9e4c7f988d7978a/kubernetes/deployment.yaml#L33) to the address of your prometheus server
 2. `kubectl create namespace cost-model`
 2. `kubectl create namespace cost-model`
 3. `kubectl apply -f kubernetes/ --namespace cost-model`
 3. `kubectl apply -f kubernetes/ --namespace cost-model`
 4. `kubectl port-forward --namespace cost-model service/cost-model 9003`
 4. `kubectl port-forward --namespace cost-model service/cost-model 9003`

+ 1 - 1
go.mod

@@ -1,4 +1,4 @@
-module github.com/kubecost/cost-model
+module github.com/kubecost/opencost
 
 
 replace github.com/golang/lint => golang.org/x/lint v0.0.0-20180702182130-06c8688daad7
 replace github.com/golang/lint => golang.org/x/lint v0.0.0-20180702182130-06c8688daad7
 
 

+ 7 - 9
pkg/cloud/awsprovider.go

@@ -15,13 +15,13 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/errors"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util"
-	"github.com/kubecost/cost-model/pkg/util/fileutil"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/errors"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util"
+	"github.com/kubecost/opencost/pkg/util/fileutil"
+	"github.com/kubecost/opencost/pkg/util/json"
 
 
 	awsSDK "github.com/aws/aws-sdk-go-v2/aws"
 	awsSDK "github.com/aws/aws-sdk-go-v2/aws"
 	"github.com/aws/aws-sdk-go-v2/config"
 	"github.com/aws/aws-sdk-go-v2/config"
@@ -97,8 +97,6 @@ func (aws *AWS) PricingSourceStatus() map[string]*PricingSource {
 // How often spot data is refreshed
 // How often spot data is refreshed
 const SpotRefreshDuration = 15 * time.Minute
 const SpotRefreshDuration = 15 * time.Minute
 
 
-const defaultConfigPath = "/var/configs/"
-
 var awsRegions = []string{
 var awsRegions = []string{
 	"us-east-2",
 	"us-east-2",
 	"us-east-1",
 	"us-east-1",

+ 7 - 7
pkg/cloud/azureprovider.go

@@ -13,12 +13,12 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util"
-	"github.com/kubecost/cost-model/pkg/util/fileutil"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util"
+	"github.com/kubecost/opencost/pkg/util/fileutil"
+	"github.com/kubecost/opencost/pkg/util/json"
 
 
 	"github.com/Azure/azure-sdk-for-go/services/preview/commerce/mgmt/2015-06-01-preview/commerce"
 	"github.com/Azure/azure-sdk-for-go/services/preview/commerce/mgmt/2015-06-01-preview/commerce"
 	"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions"
 	"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions"
@@ -906,7 +906,7 @@ func (az *Azure) DownloadPricingData() error {
 
 
 	// There is no easy way of supporting Standard Azure-File, because it's billed per used GB
 	// There is no easy way of supporting Standard Azure-File, because it's billed per used GB
 	// this will set the price to "0" as a workaround to not spam with `Persistent Volume pricing not found for` error
 	// this will set the price to "0" as a workaround to not spam with `Persistent Volume pricing not found for` error
-	// check https://github.com/kubecost/cost-model/issues/159 for more information (same problem on AWS)
+	// check https://github.com/kubecost/opencost/issues/159 for more information (same problem on AWS)
 	zeroPrice := "0.0"
 	zeroPrice := "0.0"
 	for region := range regions {
 	for region := range regions {
 		key := region + "," + AzureFileStandardStorageClass
 		key := region + "," + AzureFileStandardStorageClass

+ 3 - 3
pkg/cloud/csvprovider.go

@@ -11,13 +11,13 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/util"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/util"
 
 
 	"github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/s3"
 	"github.com/aws/aws-sdk-go/service/s3"
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/log"
 	v1 "k8s.io/api/core/v1"
 	v1 "k8s.io/api/core/v1"
 
 
 	"github.com/jszwec/csvutil"
 	"github.com/jszwec/csvutil"

+ 3 - 3
pkg/cloud/customprovider.go

@@ -8,9 +8,9 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/util/json"
 
 
 	v1 "k8s.io/api/core/v1"
 	v1 "k8s.io/api/core/v1"
 )
 )

+ 7 - 7
pkg/cloud/gcpprovider.go

@@ -13,13 +13,13 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util"
-	"github.com/kubecost/cost-model/pkg/util/fileutil"
-	"github.com/kubecost/cost-model/pkg/util/json"
-	"github.com/kubecost/cost-model/pkg/util/timeutil"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util"
+	"github.com/kubecost/opencost/pkg/util/fileutil"
+	"github.com/kubecost/opencost/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/util/timeutil"
 	"github.com/rs/zerolog"
 	"github.com/rs/zerolog"
 
 
 	"cloud.google.com/go/bigquery"
 	"cloud.google.com/go/bigquery"

+ 6 - 6
pkg/cloud/provider.go

@@ -11,15 +11,15 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util"
+	"github.com/kubecost/opencost/pkg/util"
 
 
 	"cloud.google.com/go/compute/metadata"
 	"cloud.google.com/go/compute/metadata"
 
 
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/config"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util/watcher"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/config"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util/watcher"
 
 
 	v1 "k8s.io/api/core/v1"
 	v1 "k8s.io/api/core/v1"
 )
 )

+ 4 - 4
pkg/cloud/providerconfig.go

@@ -8,10 +8,10 @@ import (
 	"strings"
 	"strings"
 	"sync"
 	"sync"
 
 
-	"github.com/kubecost/cost-model/pkg/config"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/config"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util/json"
 	"github.com/microcosm-cc/bluemonday"
 	"github.com/microcosm-cc/bluemonday"
 )
 )
 
 

+ 2 - 2
pkg/clustercache/clustercache.go

@@ -3,8 +3,8 @@ package clustercache
 import (
 import (
 	"sync"
 	"sync"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
 
 
 	appsv1 "k8s.io/api/apps/v1"
 	appsv1 "k8s.io/api/apps/v1"
 	autoscaling "k8s.io/api/autoscaling/v2beta1"
 	autoscaling "k8s.io/api/autoscaling/v2beta1"

+ 4 - 4
pkg/clustercache/clusterexporter.go

@@ -3,10 +3,10 @@ package clustercache
 import (
 import (
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/config"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util/atomic"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/config"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util/atomic"
+	"github.com/kubecost/opencost/pkg/util/json"
 
 
 	appsv1 "k8s.io/api/apps/v1"
 	appsv1 "k8s.io/api/apps/v1"
 	autoscaling "k8s.io/api/autoscaling/v2beta1"
 	autoscaling "k8s.io/api/autoscaling/v2beta1"

+ 3 - 3
pkg/clustercache/clusterimporter.go

@@ -3,9 +3,9 @@ package clustercache
 import (
 import (
 	"sync"
 	"sync"
 
 
-	"github.com/kubecost/cost-model/pkg/config"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/config"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util/json"
 	appsv1 "k8s.io/api/apps/v1"
 	appsv1 "k8s.io/api/apps/v1"
 	autoscaling "k8s.io/api/autoscaling/v2beta1"
 	autoscaling "k8s.io/api/autoscaling/v2beta1"
 	batchv1 "k8s.io/api/batch/v1"
 	batchv1 "k8s.io/api/batch/v1"

+ 1 - 1
pkg/clustercache/watchcontroller.go

@@ -5,7 +5,7 @@ import (
 	"reflect"
 	"reflect"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/log"
 
 
 	"k8s.io/apimachinery/pkg/fields"
 	"k8s.io/apimachinery/pkg/fields"
 	rt "k8s.io/apimachinery/pkg/runtime"
 	rt "k8s.io/apimachinery/pkg/runtime"

+ 16 - 13
pkg/cmd/agent/agent.go

@@ -4,19 +4,20 @@ import (
 	"context"
 	"context"
 	"fmt"
 	"fmt"
 	"net/http"
 	"net/http"
+	"path"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/config"
-	"github.com/kubecost/cost-model/pkg/costmodel"
-	"github.com/kubecost/cost-model/pkg/costmodel/clusters"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/kubeconfig"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/metrics"
-	"github.com/kubecost/cost-model/pkg/prom"
-	"github.com/kubecost/cost-model/pkg/util/watcher"
+	"github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/config"
+	"github.com/kubecost/opencost/pkg/costmodel"
+	"github.com/kubecost/opencost/pkg/costmodel/clusters"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/kubeconfig"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/metrics"
+	"github.com/kubecost/opencost/pkg/prom"
+	"github.com/kubecost/opencost/pkg/util/watcher"
 
 
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheusAPI "github.com/prometheus/client_golang/api/prometheus/v1"
 	prometheusAPI "github.com/prometheus/client_golang/api/prometheus/v1"
@@ -179,9 +180,11 @@ func Execute(opts *AgentOpts) error {
 
 
 	clusterCache.SetConfigMapUpdateFunc(watchConfigFunc)
 	clusterCache.SetConfigMapUpdateFunc(watchConfigFunc)
 
 
+	configPrefix := env.GetConfigPathWithDefault("/var/configs/")
+
 	// Initialize cluster exporting if it's enabled
 	// Initialize cluster exporting if it's enabled
 	if env.IsExportClusterCacheEnabled() {
 	if env.IsExportClusterCacheEnabled() {
-		cacheLocation := confManager.ConfigFileAt("/var/configs/cluster-cache.json")
+		cacheLocation := confManager.ConfigFileAt(path.Join(configPrefix, "cluster-cache.json"))
 		clusterExporter = clustercache.NewClusterExporter(clusterCache, cacheLocation, ClusterExportInterval)
 		clusterExporter = clustercache.NewClusterExporter(clusterCache, cacheLocation, ClusterExportInterval)
 		clusterExporter.Run()
 		clusterExporter.Run()
 	}
 	}
@@ -191,7 +194,7 @@ func Execute(opts *AgentOpts) error {
 
 
 	var clusterInfoProvider clusters.ClusterInfoProvider
 	var clusterInfoProvider clusters.ClusterInfoProvider
 	if env.IsExportClusterInfoEnabled() {
 	if env.IsExportClusterInfoEnabled() {
-		clusterInfoConf := confManager.ConfigFileAt("/var/configs/cluster-info.json")
+		clusterInfoConf := confManager.ConfigFileAt(path.Join(configPrefix, " cluster-info.json"))
 		clusterInfoProvider = costmodel.NewClusterInfoWriteOnRequest(localClusterInfo, clusterInfoConf)
 		clusterInfoProvider = costmodel.NewClusterInfoWriteOnRequest(localClusterInfo, clusterInfoConf)
 	} else {
 	} else {
 		clusterInfoProvider = localClusterInfo
 		clusterInfoProvider = localClusterInfo

+ 3 - 3
pkg/cmd/commands.go

@@ -5,9 +5,9 @@ import (
 	"os"
 	"os"
 	"strings"
 	"strings"
 
 
-	"github.com/kubecost/cost-model/pkg/cmd/agent"
-	"github.com/kubecost/cost-model/pkg/cmd/costmodel"
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/cmd/agent"
+	"github.com/kubecost/opencost/pkg/cmd/costmodel"
+	"github.com/kubecost/opencost/pkg/log"
 	"github.com/spf13/cobra"
 	"github.com/spf13/cobra"
 	"github.com/spf13/viper"
 	"github.com/spf13/viper"
 )
 )

+ 3 - 3
pkg/cmd/costmodel/costmodel.go

@@ -4,9 +4,9 @@ import (
 	"net/http"
 	"net/http"
 
 
 	"github.com/julienschmidt/httprouter"
 	"github.com/julienschmidt/httprouter"
-	"github.com/kubecost/cost-model/pkg/costmodel"
-	"github.com/kubecost/cost-model/pkg/errors"
-	"github.com/kubecost/cost-model/pkg/metrics"
+	"github.com/kubecost/opencost/pkg/costmodel"
+	"github.com/kubecost/opencost/pkg/errors"
+	"github.com/kubecost/opencost/pkg/metrics"
 	"github.com/prometheus/client_golang/prometheus/promhttp"
 	"github.com/prometheus/client_golang/prometheus/promhttp"
 	"github.com/rs/cors"
 	"github.com/rs/cors"
 )
 )

+ 3 - 3
pkg/config/configfile.go

@@ -8,9 +8,9 @@ import (
 	"time"
 	"time"
 
 
 	"github.com/google/uuid"
 	"github.com/google/uuid"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/storage"
-	"github.com/kubecost/cost-model/pkg/util/atomic"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/storage"
+	"github.com/kubecost/opencost/pkg/util/atomic"
 )
 )
 
 
 // HandlerID is a unique identifier assigned to a provided ConfigChangedHandler. This is used to remove a handler
 // HandlerID is a unique identifier assigned to a provided ConfigChangedHandler. This is used to remove a handler

+ 2 - 2
pkg/config/configmanager.go

@@ -4,8 +4,8 @@ import (
 	"io/ioutil"
 	"io/ioutil"
 	"sync"
 	"sync"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/storage"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/storage"
 )
 )
 
 
 //--------------------------------------------------------------------------
 //--------------------------------------------------------------------------

+ 11 - 11
pkg/costmodel/aggregation.go

@@ -10,19 +10,19 @@ import (
 	"strings"
 	"strings"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util/httputil"
-	"github.com/kubecost/cost-model/pkg/util/timeutil"
+	"github.com/kubecost/opencost/pkg/util/httputil"
+	"github.com/kubecost/opencost/pkg/util/timeutil"
 
 
 	"github.com/julienschmidt/httprouter"
 	"github.com/julienschmidt/httprouter"
-	"github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/errors"
-	"github.com/kubecost/cost-model/pkg/kubecost"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
-	"github.com/kubecost/cost-model/pkg/thanos"
-	"github.com/kubecost/cost-model/pkg/util"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/errors"
+	"github.com/kubecost/opencost/pkg/kubecost"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
+	"github.com/kubecost/opencost/pkg/thanos"
+	"github.com/kubecost/opencost/pkg/util"
+	"github.com/kubecost/opencost/pkg/util/json"
 	"github.com/patrickmn/go-cache"
 	"github.com/patrickmn/go-cache"
 	prometheusClient "github.com/prometheus/client_golang/api"
 	prometheusClient "github.com/prometheus/client_golang/api"
 )
 )

+ 1 - 1
pkg/costmodel/aggregation_test.go

@@ -3,7 +3,7 @@ package costmodel
 import (
 import (
 	"testing"
 	"testing"
 
 
-	"github.com/kubecost/cost-model/pkg/util"
+	"github.com/kubecost/opencost/pkg/util"
 )
 )
 
 
 func TestScaleHourlyCostData(t *testing.T) {
 func TestScaleHourlyCostData(t *testing.T) {

+ 6 - 6
pkg/costmodel/allocation.go

@@ -7,13 +7,13 @@ import (
 	"strings"
 	"strings"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util/timeutil"
+	"github.com/kubecost/opencost/pkg/util/timeutil"
 
 
-	"github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/kubecost"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/kubecost"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
 	"k8s.io/apimachinery/pkg/labels"
 	"k8s.io/apimachinery/pkg/labels"
 )
 )
 
 

+ 6 - 6
pkg/costmodel/cluster.go

@@ -5,13 +5,13 @@ import (
 	"strconv"
 	"strconv"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/kubecost"
-	"github.com/kubecost/cost-model/pkg/util/timeutil"
+	"github.com/kubecost/opencost/pkg/kubecost"
+	"github.com/kubecost/opencost/pkg/util/timeutil"
 
 
-	"github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
 
 
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheus "github.com/prometheus/client_golang/api"
 )
 )

+ 4 - 4
pkg/costmodel/cluster_helpers.go

@@ -4,11 +4,11 @@ import (
 	"strconv"
 	"strconv"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/cloud"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
 )
 )
 
 
 // mergeTypeMaps takes two maps of (cluster name, node name) -> node type
 // mergeTypeMaps takes two maps of (cluster name, node name) -> node type

+ 4 - 4
pkg/costmodel/cluster_helpers_test.go

@@ -5,10 +5,10 @@ import (
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/config"
-	"github.com/kubecost/cost-model/pkg/prom"
-	"github.com/kubecost/cost-model/pkg/util"
+	"github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/config"
+	"github.com/kubecost/opencost/pkg/prom"
+	"github.com/kubecost/opencost/pkg/util"
 
 
 	"github.com/davecgh/go-spew/spew"
 	"github.com/davecgh/go-spew/spew"
 )
 )

+ 7 - 7
pkg/costmodel/clusterinfo.go

@@ -3,13 +3,13 @@ package costmodel
 import (
 import (
 	"fmt"
 	"fmt"
 
 
-	cloudProvider "github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/config"
-	"github.com/kubecost/cost-model/pkg/costmodel/clusters"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/thanos"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	cloudProvider "github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/config"
+	"github.com/kubecost/opencost/pkg/costmodel/clusters"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/thanos"
+	"github.com/kubecost/opencost/pkg/util/json"
 
 
 	"k8s.io/client-go/kubernetes"
 	"k8s.io/client-go/kubernetes"
 )
 )

+ 4 - 4
pkg/costmodel/clusters/clustermap.go

@@ -7,10 +7,10 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
-	"github.com/kubecost/cost-model/pkg/thanos"
-	"github.com/kubecost/cost-model/pkg/util/retry"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
+	"github.com/kubecost/opencost/pkg/thanos"
+	"github.com/kubecost/opencost/pkg/util/retry"
 
 
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheus "github.com/prometheus/client_golang/api"
 )
 )

+ 2 - 2
pkg/costmodel/containerkeys.go

@@ -4,8 +4,8 @@ import (
 	"errors"
 	"errors"
 	"strings"
 	"strings"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
 	v1 "k8s.io/api/core/v1"
 	v1 "k8s.io/api/core/v1"
 )
 )
 
 

+ 8 - 8
pkg/costmodel/costmodel.go

@@ -8,14 +8,14 @@ import (
 	"strings"
 	"strings"
 	"time"
 	"time"
 
 
-	costAnalyzerCloud "github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/costmodel/clusters"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/kubecost"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
-	"github.com/kubecost/cost-model/pkg/util"
+	costAnalyzerCloud "github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/costmodel/clusters"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/kubecost"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
+	"github.com/kubecost/opencost/pkg/util"
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheusClient "github.com/prometheus/client_golang/api"
 	prometheusClient "github.com/prometheus/client_golang/api"
 	v1 "k8s.io/api/core/v1"
 	v1 "k8s.io/api/core/v1"

+ 1 - 1
pkg/costmodel/intervals.go

@@ -4,7 +4,7 @@ import (
 	"sort"
 	"sort"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/kubecost"
+	"github.com/kubecost/opencost/pkg/kubecost"
 )
 )
 
 
 // IntervalPoint describes a start or end of a window of time
 // IntervalPoint describes a start or end of a window of time

+ 1 - 1
pkg/costmodel/intervals_test.go

@@ -5,7 +5,7 @@ import (
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/kubecost"
+	"github.com/kubecost/opencost/pkg/kubecost"
 )
 )
 
 
 func TestGetIntervalPointsFromWindows(t *testing.T) {
 func TestGetIntervalPointsFromWindows(t *testing.T) {

+ 2 - 2
pkg/costmodel/key.go

@@ -3,8 +3,8 @@ package costmodel
 import (
 import (
 	"fmt"
 	"fmt"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/prom"
 )
 )
 
 
 type containerKey struct {
 type containerKey struct {

+ 11 - 11
pkg/costmodel/metrics.go

@@ -7,16 +7,16 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/costmodel/clusters"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/errors"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/metrics"
-	"github.com/kubecost/cost-model/pkg/prom"
-	"github.com/kubecost/cost-model/pkg/util"
-	"github.com/kubecost/cost-model/pkg/util/atomic"
+	"github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/costmodel/clusters"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/errors"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/metrics"
+	"github.com/kubecost/opencost/pkg/prom"
+	"github.com/kubecost/opencost/pkg/util"
+	"github.com/kubecost/opencost/pkg/util/atomic"
 
 
 	promclient "github.com/prometheus/client_golang/api"
 	promclient "github.com/prometheus/client_golang/api"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
@@ -534,7 +534,7 @@ func (cmme *CostModelMetricsEmitter) Start() bool {
 				const outlierFactor float64 = 30
 				const outlierFactor float64 = 30
 				// don't record cpuCost, ramCost, or gpuCost in the case of wild outliers
 				// don't record cpuCost, ramCost, or gpuCost in the case of wild outliers
 				// k8s api sometimes causes cost spikes as described here:
 				// k8s api sometimes causes cost spikes as described here:
-				// https://github.com/kubecost/cost-model/issues/927
+				// https://github.com/kubecost/opencost/issues/927
 				if cpuCost < outlierFactor*avgCosts.CpuCostAverage {
 				if cpuCost < outlierFactor*avgCosts.CpuCostAverage {
 					cmme.CPUPriceRecorder.WithLabelValues(nodeName, nodeName, nodeType, nodeRegion, node.ProviderID).Set(cpuCost)
 					cmme.CPUPriceRecorder.WithLabelValues(nodeName, nodeName, nodeType, nodeRegion, node.ProviderID).Set(cpuCost)
 					avgCosts.CpuCostAverage = (avgCosts.CpuCostAverage*avgCosts.NumCpuDataPoints + cpuCost) / (avgCosts.NumCpuDataPoints + 1)
 					avgCosts.CpuCostAverage = (avgCosts.CpuCostAverage*avgCosts.NumCpuDataPoints + cpuCost) / (avgCosts.NumCpuDataPoints + 1)

+ 5 - 5
pkg/costmodel/networkcosts.go

@@ -1,11 +1,11 @@
 package costmodel
 package costmodel
 
 
 import (
 import (
-	costAnalyzerCloud "github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
-	"github.com/kubecost/cost-model/pkg/util"
+	costAnalyzerCloud "github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
+	"github.com/kubecost/opencost/pkg/util"
 )
 )
 
 
 // NetworkUsageVNetworkUsageDataector contains the network usage values for egress network traffic
 // NetworkUsageVNetworkUsageDataector contains the network usage values for egress network traffic

+ 6 - 6
pkg/costmodel/promparsers.go

@@ -5,12 +5,12 @@ import (
 	"fmt"
 	"fmt"
 	"time"
 	"time"
 
 
-	costAnalyzerCloud "github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
-	"github.com/kubecost/cost-model/pkg/util"
+	costAnalyzerCloud "github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
+	"github.com/kubecost/opencost/pkg/util"
 )
 )
 
 
 func GetPVInfoLocal(cache clustercache.ClusterCache, defaultClusterID string) (map[string]*PersistentVolumeClaimData, error) {
 func GetPVInfoLocal(cache clustercache.ClusterCache, defaultClusterID string) (map[string]*PersistentVolumeClaimData, error) {

+ 23 - 20
pkg/costmodel/router.go

@@ -6,6 +6,7 @@ import (
 	"fmt"
 	"fmt"
 	"io/ioutil"
 	"io/ioutil"
 	"net/http"
 	"net/http"
+	"path"
 	"reflect"
 	"reflect"
 	"regexp"
 	"regexp"
 	"strconv"
 	"strconv"
@@ -13,13 +14,13 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/config"
-	"github.com/kubecost/cost-model/pkg/kubeconfig"
-	"github.com/kubecost/cost-model/pkg/metrics"
-	"github.com/kubecost/cost-model/pkg/services"
-	"github.com/kubecost/cost-model/pkg/util/httputil"
-	"github.com/kubecost/cost-model/pkg/util/timeutil"
-	"github.com/kubecost/cost-model/pkg/util/watcher"
+	"github.com/kubecost/opencost/pkg/config"
+	"github.com/kubecost/opencost/pkg/kubeconfig"
+	"github.com/kubecost/opencost/pkg/metrics"
+	"github.com/kubecost/opencost/pkg/services"
+	"github.com/kubecost/opencost/pkg/util/httputil"
+	"github.com/kubecost/opencost/pkg/util/timeutil"
+	"github.com/kubecost/opencost/pkg/util/watcher"
 	"github.com/microcosm-cc/bluemonday"
 	"github.com/microcosm-cc/bluemonday"
 	"github.com/spf13/viper"
 	"github.com/spf13/viper"
 
 
@@ -29,16 +30,16 @@ import (
 
 
 	sentry "github.com/getsentry/sentry-go"
 	sentry "github.com/getsentry/sentry-go"
 
 
-	"github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/costmodel/clusters"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/errors"
-	"github.com/kubecost/cost-model/pkg/kubecost"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
-	"github.com/kubecost/cost-model/pkg/thanos"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/costmodel/clusters"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/errors"
+	"github.com/kubecost/opencost/pkg/kubecost"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
+	"github.com/kubecost/opencost/pkg/thanos"
+	"github.com/kubecost/opencost/pkg/util/json"
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheusAPI "github.com/prometheus/client_golang/api/prometheus/v1"
 	prometheusAPI "github.com/prometheus/client_golang/api/prometheus/v1"
 	appsv1 "k8s.io/api/apps/v1"
 	appsv1 "k8s.io/api/apps/v1"
@@ -1275,7 +1276,7 @@ func (a *Accesses) AddServiceKey(w http.ResponseWriter, r *http.Request, ps http
 
 
 	key := r.PostForm.Get("key")
 	key := r.PostForm.Get("key")
 	k := []byte(key)
 	k := []byte(key)
-	err := ioutil.WriteFile("/var/configs/key.json", k, 0644)
+	err := ioutil.WriteFile(path.Join(env.GetConfigPathWithDefault("/var/configs/"), "key.json"), k, 0644)
 	if err != nil {
 	if err != nil {
 		fmt.Fprintf(w, "Error writing service key: "+err.Error())
 		fmt.Fprintf(w, "Error writing service key: "+err.Error())
 	}
 	}
@@ -1444,10 +1445,12 @@ func Initialize(additionalConfigWatchers ...*watcher.ConfigMapWatcher) *Accesses
 		LocalConfigPath:   "/",
 		LocalConfigPath:   "/",
 	})
 	})
 
 
+	configPrefix := env.GetConfigPathWithDefault("/var/configs/")
+
 	// Create Kubernetes Cluster Cache + Watchers
 	// Create Kubernetes Cluster Cache + Watchers
 	var k8sCache clustercache.ClusterCache
 	var k8sCache clustercache.ClusterCache
 	if env.IsClusterCacheFileEnabled() {
 	if env.IsClusterCacheFileEnabled() {
-		importLocation := confManager.ConfigFileAt("/var/configs/cluster-cache.json")
+		importLocation := confManager.ConfigFileAt(path.Join(configPrefix, "cluster-cache.json"))
 		k8sCache = clustercache.NewClusterImporter(importLocation)
 		k8sCache = clustercache.NewClusterImporter(importLocation)
 	} else {
 	} else {
 		k8sCache = clustercache.NewKubernetesClusterCache(kubeClientset)
 		k8sCache = clustercache.NewKubernetesClusterCache(kubeClientset)
@@ -1533,7 +1536,7 @@ func Initialize(additionalConfigWatchers ...*watcher.ConfigMapWatcher) *Accesses
 	// ClusterInfo Provider to provide the cluster map with local and remote cluster data
 	// ClusterInfo Provider to provide the cluster map with local and remote cluster data
 	var clusterInfoProvider clusters.ClusterInfoProvider
 	var clusterInfoProvider clusters.ClusterInfoProvider
 	if env.IsClusterInfoFileEnabled() {
 	if env.IsClusterInfoFileEnabled() {
-		clusterInfoFile := confManager.ConfigFileAt("/var/configs/cluster-info.json")
+		clusterInfoFile := confManager.ConfigFileAt(path.Join(configPrefix, " cluster-info.json"))
 		clusterInfoProvider = NewConfiguredClusterInfoProvider(clusterInfoFile)
 		clusterInfoProvider = NewConfiguredClusterInfoProvider(clusterInfoFile)
 	} else {
 	} else {
 		clusterInfoProvider = NewLocalClusterInfoProvider(kubeClientset, cloudProvider)
 		clusterInfoProvider = NewLocalClusterInfoProvider(kubeClientset, cloudProvider)

+ 2 - 2
pkg/costmodel/settings.go

@@ -4,8 +4,8 @@ import (
 	"fmt"
 	"fmt"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/log"
 	"github.com/patrickmn/go-cache"
 	"github.com/patrickmn/go-cache"
 )
 )
 
 

+ 5 - 5
pkg/costmodel/sql.go

@@ -5,11 +5,11 @@ import (
 	"fmt"
 	"fmt"
 	"time"
 	"time"
 
 
-	costAnalyzerCloud "github.com/kubecost/cost-model/pkg/cloud"
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	costAnalyzerCloud "github.com/kubecost/opencost/pkg/cloud"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util"
+	"github.com/kubecost/opencost/pkg/util/json"
 
 
 	_ "github.com/lib/pq"
 	_ "github.com/lib/pq"
 )
 )

+ 2 - 2
pkg/env/costmodelenv.go

@@ -5,8 +5,8 @@ import (
 	"strconv"
 	"strconv"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util/timeutil"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util/timeutil"
 )
 )
 
 
 const (
 const (

+ 1 - 1
pkg/env/env.go

@@ -4,7 +4,7 @@ import (
 	"os"
 	"os"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util/mapper"
+	"github.com/kubecost/opencost/pkg/util/mapper"
 )
 )
 
 
 //--------------------------------------------------------------------------
 //--------------------------------------------------------------------------

+ 3 - 3
pkg/kubecost/allocation.go

@@ -8,9 +8,9 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util"
+	"github.com/kubecost/opencost/pkg/util/json"
 )
 )
 
 
 // TODO Clean-up use of IsEmpty; nil checks should be separated for safety.
 // TODO Clean-up use of IsEmpty; nil checks should be separated for safety.

+ 2 - 2
pkg/kubecost/allocation_test.go

@@ -6,8 +6,8 @@ import (
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/util"
+	"github.com/kubecost/opencost/pkg/util/json"
 )
 )
 
 
 func TestAllocation_Add(t *testing.T) {
 func TestAllocation_Add(t *testing.T) {

+ 1 - 1
pkg/kubecost/allocationfilter.go

@@ -3,7 +3,7 @@ package kubecost
 import (
 import (
 	"strings"
 	"strings"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/log"
 )
 )
 
 
 // FilterField is an enum that represents Allocation-specific fields that can be
 // FilterField is an enum that represents Allocation-specific fields that can be

+ 2 - 2
pkg/kubecost/allocationprops.go

@@ -5,8 +5,8 @@ import (
 	"sort"
 	"sort"
 	"strings"
 	"strings"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
 )
 )
 
 
 const (
 const (

+ 2 - 2
pkg/kubecost/asset.go

@@ -7,8 +7,8 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util/json"
 )
 )
 
 
 // UndefinedKey is used in composing Asset group keys if the group does not have that property defined.
 // UndefinedKey is used in composing Asset group keys if the group does not have that property defined.

+ 1 - 1
pkg/kubecost/asset_test.go

@@ -7,7 +7,7 @@ import (
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util"
+	"github.com/kubecost/opencost/pkg/util"
 )
 )
 
 
 var start1 = time.Date(2020, time.January, 1, 0, 0, 0, 0, time.UTC)
 var start1 = time.Date(2020, time.January, 1, 0, 0, 0, 0, time.UTC)

+ 1 - 1
pkg/kubecost/asset_unmarshal.go

@@ -6,7 +6,7 @@ import (
 	"reflect"
 	"reflect"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/util/json"
 )
 )
 
 
 // Encoding and decoding logic for Asset types
 // Encoding and decoding logic for Asset types

+ 1 - 1
pkg/kubecost/asset_unmarshal_test.go

@@ -1,7 +1,7 @@
 package kubecost
 package kubecost
 
 
 import (
 import (
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/util/json"
 
 
 	"testing"
 	"testing"
 	"time"
 	"time"

+ 1 - 1
pkg/kubecost/bingen.go

@@ -57,4 +57,4 @@ package kubecost
 // @bingen:generate:PVAllocation
 // @bingen:generate:PVAllocation
 // @bingen:end
 // @bingen:end
 
 
-//go:generate bingen -package=kubecost -version=15 -buffer=github.com/kubecost/cost-model/pkg/util
+//go:generate bingen -package=kubecost -version=15 -buffer=github.com/kubecost/opencost/pkg/util

+ 2 - 2
pkg/kubecost/config.go

@@ -4,8 +4,8 @@ import (
 	"fmt"
 	"fmt"
 	"strings"
 	"strings"
 
 
-	"github.com/kubecost/cost-model/pkg/prom"
-	"github.com/kubecost/cost-model/pkg/util/cloudutil"
+	"github.com/kubecost/opencost/pkg/prom"
+	"github.com/kubecost/opencost/pkg/util/cloudutil"
 )
 )
 
 
 // LabelConfig is a port of type AnalyzerConfig. We need to be more thoughtful
 // LabelConfig is a port of type AnalyzerConfig. We need to be more thoughtful

+ 1 - 1
pkg/kubecost/config_test.go

@@ -3,7 +3,7 @@ package kubecost
 import (
 import (
 	"testing"
 	"testing"
 
 
-	"github.com/kubecost/cost-model/pkg/util/cloudutil"
+	"github.com/kubecost/opencost/pkg/util/cloudutil"
 )
 )
 
 
 func TestLabelConfig_Map(t *testing.T) {
 func TestLabelConfig_Map(t *testing.T) {

+ 1 - 1
pkg/kubecost/json.go

@@ -5,7 +5,7 @@ import (
 	"fmt"
 	"fmt"
 	"math"
 	"math"
 
 
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/util/json"
 )
 )
 
 
 // TODO move everything below to a separate package
 // TODO move everything below to a separate package

+ 2 - 1
pkg/kubecost/kubecost_codecs.go

@@ -13,11 +13,12 @@ package kubecost
 
 
 import (
 import (
 	"fmt"
 	"fmt"
-	util "github.com/kubecost/cost-model/pkg/util"
 	"reflect"
 	"reflect"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
 	"time"
 	"time"
+
+	util "github.com/kubecost/opencost/pkg/util"
 )
 )
 
 
 const (
 const (

+ 1 - 1
pkg/kubecost/summaryallocation.go

@@ -7,7 +7,7 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/log"
 )
 )
 
 
 // SummaryAllocation summarizes an Allocation, keeping only fields necessary
 // SummaryAllocation summarizes an Allocation, keeping only fields necessary

+ 1 - 1
pkg/kubecost/summaryallocation_test.go

@@ -4,7 +4,7 @@ import (
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util"
+	"github.com/kubecost/opencost/pkg/util"
 )
 )
 
 
 func TestSummaryAllocation_Add(t *testing.T) {
 func TestSummaryAllocation_Add(t *testing.T) {

+ 1 - 1
pkg/kubecost/totals.go

@@ -6,7 +6,7 @@ import (
 	"strconv"
 	"strconv"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/log"
 	"github.com/patrickmn/go-cache"
 	"github.com/patrickmn/go-cache"
 )
 )
 
 

+ 3 - 3
pkg/kubecost/window.go

@@ -8,10 +8,10 @@ import (
 	"strconv"
 	"strconv"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util/timeutil"
+	"github.com/kubecost/opencost/pkg/util/timeutil"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/thanos"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/thanos"
 )
 )
 
 
 const (
 const (

+ 1 - 1
pkg/kubecost/window_test.go

@@ -6,7 +6,7 @@ import (
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
+	"github.com/kubecost/opencost/pkg/env"
 )
 )
 
 
 func TestRoundBack(t *testing.T) {
 func TestRoundBack(t *testing.T) {

+ 2 - 2
pkg/metrics/deploymentmetrics.go

@@ -1,8 +1,8 @@
 package metrics
 package metrics
 
 
 import (
 import (
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/prom"
 
 
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	dto "github.com/prometheus/client_model/go"

+ 1 - 1
pkg/metrics/jobmetrics.go

@@ -1,7 +1,7 @@
 package metrics
 package metrics
 
 
 import (
 import (
-	"github.com/kubecost/cost-model/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/clustercache"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	dto "github.com/prometheus/client_model/go"
 	batchv1 "k8s.io/api/batch/v1"
 	batchv1 "k8s.io/api/batch/v1"

+ 2 - 2
pkg/metrics/kubemetrics.go

@@ -5,8 +5,8 @@ import (
 	"strings"
 	"strings"
 	"sync"
 	"sync"
 
 
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/prom"
 
 
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
 	batchv1 "k8s.io/api/batch/v1"
 	batchv1 "k8s.io/api/batch/v1"

+ 9 - 5
pkg/metrics/metricsconfig.go

@@ -5,13 +5,17 @@ import (
 	"fmt"
 	"fmt"
 	"io/ioutil"
 	"io/ioutil"
 	"os"
 	"os"
+	"path"
 	"sync"
 	"sync"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/util/watcher"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/util/watcher"
 )
 )
 
 
-var metricsConfigLock = new(sync.Mutex)
+var (
+	metricsConfigLock = new(sync.Mutex)
+	metricsFilePath   = path.Join(env.GetConfigPathWithDefault("/var/configs/"), "metrics.json")
+)
 
 
 type MetricsConfig struct {
 type MetricsConfig struct {
 	DisabledMetrics []string `json:"disabledMetrics"`
 	DisabledMetrics []string `json:"disabledMetrics"`
@@ -33,7 +37,7 @@ func GetMetricsConfig() (*MetricsConfig, error) {
 	metricsConfigLock.Lock()
 	metricsConfigLock.Lock()
 	defer metricsConfigLock.Unlock()
 	defer metricsConfigLock.Unlock()
 	mc := &MetricsConfig{}
 	mc := &MetricsConfig{}
-	body, err := ioutil.ReadFile("/var/configs/metrics.json")
+	body, err := ioutil.ReadFile(metricsFilePath)
 	if os.IsNotExist(err) {
 	if os.IsNotExist(err) {
 
 
 		return mc, nil
 		return mc, nil
@@ -59,7 +63,7 @@ func UpdateMetricsConfig(mc *MetricsConfig) (*MetricsConfig, error) {
 		return nil, fmt.Errorf("error encoding metrics config struct: %s", err)
 		return nil, fmt.Errorf("error encoding metrics config struct: %s", err)
 	}
 	}
 
 
-	err = ioutil.WriteFile("/var/configs/metrics.json", mcb, 0644)
+	err = ioutil.WriteFile(metricsFilePath, mcb, 0644)
 	if err != nil {
 	if err != nil {
 		return nil, fmt.Errorf("error writing to metrics config file: %s", err)
 		return nil, fmt.Errorf("error writing to metrics config file: %s", err)
 	}
 	}

+ 2 - 2
pkg/metrics/namespacemetrics.go

@@ -1,8 +1,8 @@
 package metrics
 package metrics
 
 
 import (
 import (
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/prom"
 
 
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	dto "github.com/prometheus/client_model/go"

+ 3 - 3
pkg/metrics/nodemetrics.go

@@ -3,9 +3,9 @@ package metrics
 import (
 import (
 	"strings"
 	"strings"
 
 
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	dto "github.com/prometheus/client_model/go"
 	v1 "k8s.io/api/core/v1"
 	v1 "k8s.io/api/core/v1"

+ 2 - 2
pkg/metrics/podlabelmetrics.go

@@ -1,8 +1,8 @@
 package metrics
 package metrics
 
 
 import (
 import (
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/prom"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
 )
 )
 
 

+ 3 - 3
pkg/metrics/podmetrics.go

@@ -3,9 +3,9 @@ package metrics
 import (
 import (
 	"fmt"
 	"fmt"
 
 
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	dto "github.com/prometheus/client_model/go"
 	v1 "k8s.io/api/core/v1"
 	v1 "k8s.io/api/core/v1"

+ 1 - 1
pkg/metrics/pvcmetrics.go

@@ -1,7 +1,7 @@
 package metrics
 package metrics
 
 
 import (
 import (
-	"github.com/kubecost/cost-model/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/clustercache"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	dto "github.com/prometheus/client_model/go"
 	v1 "k8s.io/api/core/v1"
 	v1 "k8s.io/api/core/v1"

+ 1 - 1
pkg/metrics/pvmetrics.go

@@ -1,7 +1,7 @@
 package metrics
 package metrics
 
 
 import (
 import (
-	"github.com/kubecost/cost-model/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/clustercache"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	dto "github.com/prometheus/client_model/go"
 	v1 "k8s.io/api/core/v1"
 	v1 "k8s.io/api/core/v1"

+ 2 - 2
pkg/metrics/servicemetrics.go

@@ -1,8 +1,8 @@
 package metrics
 package metrics
 
 
 import (
 import (
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/prom"
 
 
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	dto "github.com/prometheus/client_model/go"

+ 2 - 2
pkg/metrics/statefulsetmetrics.go

@@ -1,8 +1,8 @@
 package metrics
 package metrics
 
 
 import (
 import (
-	"github.com/kubecost/cost-model/pkg/clustercache"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/clustercache"
+	"github.com/kubecost/opencost/pkg/prom"
 
 
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	dto "github.com/prometheus/client_model/go"

+ 2 - 2
pkg/prom/diagnostics.go

@@ -4,8 +4,8 @@ import (
 	"fmt"
 	"fmt"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/log"
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheus "github.com/prometheus/client_golang/api"
 )
 )
 
 

+ 1 - 1
pkg/prom/error.go

@@ -6,7 +6,7 @@ import (
 	"strings"
 	"strings"
 	"sync"
 	"sync"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/log"
 )
 )
 
 
 // errorType used to check HasError
 // errorType used to check HasError

+ 1 - 1
pkg/prom/metrics.go

@@ -7,7 +7,7 @@ import (
 	"sort"
 	"sort"
 	"strings"
 	"strings"
 
 
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/util/json"
 )
 )
 
 
 var invalidLabelCharRE = regexp.MustCompile(`[^a-zA-Z0-9_]`)
 var invalidLabelCharRE = regexp.MustCompile(`[^a-zA-Z0-9_]`)

+ 5 - 5
pkg/prom/prom.go

@@ -11,11 +11,11 @@ import (
 	"strings"
 	"strings"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/collections"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util/atomic"
-	"github.com/kubecost/cost-model/pkg/util/fileutil"
-	"github.com/kubecost/cost-model/pkg/util/httputil"
+	"github.com/kubecost/opencost/pkg/collections"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util/atomic"
+	"github.com/kubecost/opencost/pkg/util/fileutil"
+	"github.com/kubecost/opencost/pkg/util/httputil"
 
 
 	golog "log"
 	golog "log"
 
 

+ 5 - 5
pkg/prom/query.go

@@ -8,11 +8,11 @@ import (
 	"strconv"
 	"strconv"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/errors"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util/httputil"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/errors"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util/httputil"
+	"github.com/kubecost/opencost/pkg/util/json"
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheus "github.com/prometheus/client_golang/api"
 )
 )
 
 

+ 2 - 2
pkg/prom/ratelimitedclient_test.go

@@ -12,8 +12,8 @@ import (
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util"
-	"github.com/kubecost/cost-model/pkg/util/httputil"
+	"github.com/kubecost/opencost/pkg/util"
+	"github.com/kubecost/opencost/pkg/util/httputil"
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheus "github.com/prometheus/client_golang/api"
 )
 )
 
 

+ 2 - 2
pkg/prom/result.go

@@ -6,8 +6,8 @@ import (
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util"
 )
 )
 
 
 var (
 var (

+ 1 - 1
pkg/prom/validate.go

@@ -3,7 +3,7 @@ package prom
 import (
 import (
 	"fmt"
 	"fmt"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
+	"github.com/kubecost/opencost/pkg/env"
 
 
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheus "github.com/prometheus/client_golang/api"
 )
 )

+ 3 - 3
pkg/services/clusters/clustermanager.go

@@ -8,9 +8,9 @@ import (
 
 
 	"github.com/google/uuid"
 	"github.com/google/uuid"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util/fileutil"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util/fileutil"
+	"github.com/kubecost/opencost/pkg/util/json"
 
 
 	"sigs.k8s.io/yaml"
 	"sigs.k8s.io/yaml"
 )
 )

+ 2 - 2
pkg/services/clusters/clustersendpoints.go

@@ -7,8 +7,8 @@ import (
 
 
 	"github.com/julienschmidt/httprouter"
 	"github.com/julienschmidt/httprouter"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/util/json"
 )
 )
 
 
 // DataEnvelope is a generic wrapper struct for http response data
 // DataEnvelope is a generic wrapper struct for http response data

+ 7 - 22
pkg/services/clusterservice.go

@@ -1,6 +1,11 @@
 package services
 package services
 
 
-import "github.com/kubecost/cost-model/pkg/services/clusters"
+import (
+	"path"
+
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/services/clusters"
+)
 
 
 // NewClusterManagerService creates a new HTTPService implementation driving cluster definition management
 // NewClusterManagerService creates a new HTTPService implementation driving cluster definition management
 // for the frontend
 // for the frontend
@@ -10,28 +15,8 @@ func NewClusterManagerService() HTTPService {
 
 
 // newClusterManager creates a new cluster manager instance for use in the service
 // newClusterManager creates a new cluster manager instance for use in the service
 func newClusterManager() *clusters.ClusterManager {
 func newClusterManager() *clusters.ClusterManager {
-	clustersConfigFile := "/var/configs/clusters/default-clusters.yaml"
+	clustersConfigFile := path.Join(env.GetConfigPathWithDefault("/var/configs/"), "clusters/default-clusters.yaml")
 
 
 	// Return a memory-backed cluster manager populated by configmap
 	// Return a memory-backed cluster manager populated by configmap
 	return clusters.NewConfiguredClusterManager(clusters.NewMapDBClusterStorage(), clustersConfigFile)
 	return clusters.NewConfiguredClusterManager(clusters.NewMapDBClusterStorage(), clustersConfigFile)
-
-	// NOTE: The following should be used with a persistent disk store. Since the
-	// NOTE: configmap approach is currently the "persistent" source (entries are read-only
-	// NOTE: on the backend), we don't currently need to store on disk.
-	/*
-		path := env.GetConfigPath()
-		db, err := bolt.Open(path+"costmodel.db", 0600, nil)
-		if err != nil {
-			log.Errorf("[Error] Failed to create costmodel.db: %s", err.Error())
-			return cm.NewConfiguredClusterManager(cm.NewMapDBClusterStorage(), clustersConfigFile)
-		}
-
-		store, err := clusters.NewBoltDBClusterStorage("clusters", db)
-		if err != nil {
-			log.Errorf("[Error] Failed to Create Cluster Storage: %s", err.Error())
-			return clusters.NewConfiguredClusterManager(clusters.NewMapDBClusterStorage(), clustersConfigFile)
-		}
-
-		return clusters.NewConfiguredClusterManager(store, clustersConfigFile)
-	*/
 }
 }

+ 1 - 1
pkg/services/services.go

@@ -4,7 +4,7 @@ import (
 	"sync"
 	"sync"
 
 
 	"github.com/julienschmidt/httprouter"
 	"github.com/julienschmidt/httprouter"
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/log"
 )
 )
 
 
 // HTTPService defines an implementation prototype for an object capable of registering
 // HTTPService defines an implementation prototype for an object capable of registering

+ 1 - 1
pkg/storage/azurestorage.go

@@ -18,7 +18,7 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/log"
 
 
 	"github.com/Azure/azure-pipeline-go/pipeline"
 	"github.com/Azure/azure-pipeline-go/pipeline"
 	blob "github.com/Azure/azure-storage-blob-go/azblob"
 	blob "github.com/Azure/azure-storage-blob-go/azblob"

+ 1 - 1
pkg/storage/filestorage.go

@@ -7,7 +7,7 @@ import (
 	gopath "path"
 	gopath "path"
 	"path/filepath"
 	"path/filepath"
 
 
-	"github.com/kubecost/cost-model/pkg/util/fileutil"
+	"github.com/kubecost/opencost/pkg/util/fileutil"
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
 )
 )
 
 

+ 1 - 1
pkg/storage/gcsstorage.go

@@ -10,7 +10,7 @@ import (
 	"strings"
 	"strings"
 
 
 	gcs "cloud.google.com/go/storage"
 	gcs "cloud.google.com/go/storage"
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/log"
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
 	"golang.org/x/oauth2/google"
 	"golang.org/x/oauth2/google"
 	"google.golang.org/api/iterator"
 	"google.golang.org/api/iterator"

+ 1 - 1
pkg/storage/s3storage.go

@@ -13,7 +13,7 @@ import (
 	"strings"
 	"strings"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/log"
+	"github.com/kubecost/opencost/pkg/log"
 
 
 	aws "github.com/aws/aws-sdk-go-v2/aws"
 	aws "github.com/aws/aws-sdk-go-v2/aws"
 	awsconfig "github.com/aws/aws-sdk-go-v2/config"
 	awsconfig "github.com/aws/aws-sdk-go-v2/config"

+ 1 - 1
pkg/storage/storagetypes.go

@@ -3,7 +3,7 @@ package storage
 import (
 import (
 	"strings"
 	"strings"
 
 
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/util/json"
 )
 )
 
 
 /*
 /*

+ 1 - 1
pkg/storage/storagetypes_test.go

@@ -3,7 +3,7 @@ package storage
 import (
 import (
 	"testing"
 	"testing"
 
 
-	"github.com/kubecost/cost-model/pkg/util/json"
+	"github.com/kubecost/opencost/pkg/util/json"
 )
 )
 
 
 func assert(t *testing.T, condition bool, msg string) {
 func assert(t *testing.T, condition bool, msg string) {

+ 2 - 2
pkg/thanos/thanos.go

@@ -10,8 +10,8 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/env"
-	"github.com/kubecost/cost-model/pkg/prom"
+	"github.com/kubecost/opencost/pkg/env"
+	"github.com/kubecost/opencost/pkg/prom"
 
 
 	prometheus "github.com/prometheus/client_golang/api"
 	prometheus "github.com/prometheus/client_golang/api"
 )
 )

+ 1 - 1
pkg/util/atomic/example_intervalrunner_test.go

@@ -5,7 +5,7 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util/atomic"
+	"github.com/kubecost/opencost/pkg/util/atomic"
 )
 )
 
 
 // IntervalRunner is an example implementation of AtomicRunState.
 // IntervalRunner is an example implementation of AtomicRunState.

+ 1 - 1
pkg/util/buffer.go

@@ -9,7 +9,7 @@ import (
 	"reflect"
 	"reflect"
 	"unsafe"
 	"unsafe"
 
 
-	"github.com/kubecost/cost-model/pkg/util/stringutil"
+	"github.com/kubecost/opencost/pkg/util/stringutil"
 )
 )
 
 
 // NonPrimitiveTypeError represents an error where the user provided a non-primitive data type for reading/writing
 // NonPrimitiveTypeError represents an error where the user provided a non-primitive data type for reading/writing

+ 2 - 2
pkg/util/cache/cachegroup.go

@@ -5,7 +5,7 @@ import (
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util/interval"
+	"github.com/kubecost/opencost/pkg/util/interval"
 	"golang.org/x/sync/singleflight"
 	"golang.org/x/sync/singleflight"
 )
 )
 
 
@@ -27,7 +27,7 @@ type CacheGroup[T comparable] struct {
 	max              int
 	max              int
 }
 }
 
 
-// NewCacheGroup[T] creates a new cache group instance given the max number of keys to cache. 
+// NewCacheGroup[T] creates a new cache group instance given the max number of keys to cache.
 // If a new cache entry is added that exceeds the maximum, the oldest entry is evicted.
 // If a new cache entry is added that exceeds the maximum, the oldest entry is evicted.
 func NewCacheGroup[T comparable](max int) *CacheGroup[T] {
 func NewCacheGroup[T comparable](max int) *CacheGroup[T] {
 	return &CacheGroup[T]{
 	return &CacheGroup[T]{

+ 5 - 5
pkg/util/filterutil/allocationfilters.go

@@ -3,11 +3,11 @@ package filterutil
 import (
 import (
 	"strings"
 	"strings"
 
 
-	"github.com/kubecost/cost-model/pkg/costmodel/clusters"
-	"github.com/kubecost/cost-model/pkg/kubecost"
-	"github.com/kubecost/cost-model/pkg/log"
-	"github.com/kubecost/cost-model/pkg/prom"
-	"github.com/kubecost/cost-model/pkg/util/httputil"
+	"github.com/kubecost/opencost/pkg/costmodel/clusters"
+	"github.com/kubecost/opencost/pkg/kubecost"
+	"github.com/kubecost/opencost/pkg/log"
+	"github.com/kubecost/opencost/pkg/prom"
+	"github.com/kubecost/opencost/pkg/util/httputil"
 )
 )
 
 
 // parseWildcardEnd checks if the given filter value is wildcarded, meaning
 // parseWildcardEnd checks if the given filter value is wildcarded, meaning

+ 3 - 3
pkg/util/filterutil/allocationfilters_test.go

@@ -3,9 +3,9 @@ package filterutil
 import (
 import (
 	"testing"
 	"testing"
 
 
-	"github.com/kubecost/cost-model/pkg/costmodel/clusters"
-	"github.com/kubecost/cost-model/pkg/kubecost"
-	"github.com/kubecost/cost-model/pkg/util/mapper"
+	"github.com/kubecost/opencost/pkg/costmodel/clusters"
+	"github.com/kubecost/opencost/pkg/kubecost"
+	"github.com/kubecost/opencost/pkg/util/mapper"
 )
 )
 
 
 type mockClusterMap struct {
 type mockClusterMap struct {

+ 1 - 1
pkg/util/httputil/httputil.go

@@ -10,7 +10,7 @@ import (
 	"strings"
 	"strings"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util/mapper"
+	"github.com/kubecost/opencost/pkg/util/mapper"
 )
 )
 
 
 //--------------------------------------------------------------------------
 //--------------------------------------------------------------------------

+ 1 - 1
pkg/util/interval/intervalrunner.go

@@ -3,7 +3,7 @@ package interval
 import (
 import (
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util/atomic"
+	"github.com/kubecost/opencost/pkg/util/atomic"
 )
 )
 
 
 // IntervalRunner is an example implementation of AtomicRunState.
 // IntervalRunner is an example implementation of AtomicRunState.

+ 2 - 1
pkg/util/mapper/mapper.go

@@ -1,10 +1,11 @@
 package mapper
 package mapper
 
 
 import (
 import (
-	"github.com/kubecost/cost-model/pkg/util/timeutil"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
 	"time"
 	"time"
+
+	"github.com/kubecost/opencost/pkg/util/timeutil"
 )
 )
 
 
 //--------------------------------------------------------------------------
 //--------------------------------------------------------------------------

+ 1 - 1
pkg/util/retry/retry.go

@@ -6,7 +6,7 @@ import (
 	"math/rand"
 	"math/rand"
 	"time"
 	"time"
 
 
-	"github.com/kubecost/cost-model/pkg/util/defaults"
+	"github.com/kubecost/opencost/pkg/util/defaults"
 )
 )
 
 
 // RetryCancellationErr is the error type that's returned if the retry is cancelled
 // RetryCancellationErr is the error type that's returned if the retry is cancelled

Някои файлове не бяха показани, защото твърде много файлове са промени