Skip to content

Commit

Permalink
[CLD-4712] Cleanup of Kubecost deployments (#821)
Browse files Browse the repository at this point in the history
* CLD-4712 Cleanup of Kubecost deployments

* remove more

Co-authored-by: Stylianos Rigas <[email protected]>
Co-authored-by: Mir Shahriar Sabuj <[email protected]>
  • Loading branch information
3 people authored Jan 4, 2023
1 parent aeb80a3 commit 9f9245c
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 237 deletions.
4 changes: 0 additions & 4 deletions cmd/cloud/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,10 +664,6 @@ func processUtilityFlags(utilityFlags utilityFlags) map[string]*model.HelmUtilit
Chart: utilityFlags.rtcdVersion,
ValuesPath: utilityFlags.rtcdValues,
},
model.KubecostCanonicalName: {
Chart: utilityFlags.kubecostVersion,
ValuesPath: utilityFlags.kubecostValues,
},
model.NodeProblemDetectorCanonicalName: {
Chart: utilityFlags.nodeProblemDetectorVersion,
ValuesPath: utilityFlags.nodeProblemDetectorValues,
Expand Down
4 changes: 0 additions & 4 deletions cmd/cloud/cluster_flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ type utilityFlags struct {
rtcdValues string
promtailVersion string
promtailValues string
kubecostVersion string
kubecostValues string
nodeProblemDetectorVersion string
nodeProblemDetectorValues string
metricsServerVersion string
Expand Down Expand Up @@ -103,8 +101,6 @@ func (flags *utilityFlags) addFlags(command *cobra.Command) {
command.Flags().StringVar(&flags.rtcdValues, "rtcd-values", "", "The full Git URL of the desired chart values for RTCD")
command.Flags().StringVar(&flags.promtailVersion, "promtail-version", "", "The version of Promtail to provision. Use 'stable' to provision the latest stable version published upstream.")
command.Flags().StringVar(&flags.promtailValues, "promtail-values", "", "The full Git URL of the desired chart values for Promtail")
command.Flags().StringVar(&flags.kubecostVersion, "kubecost-version", "", "The version of Kubecost. Use 'stable' to provision the latest stable version published upstream.")
command.Flags().StringVar(&flags.kubecostValues, "kubecost-values", "", "The full Git URL of the desired chart values for Kubecost")
command.Flags().StringVar(&flags.nodeProblemDetectorVersion, "node-problem-detector-version", "", "The version of Node Problem Detector. Use 'stable' to provision the latest stable version published upstream.")
command.Flags().StringVar(&flags.nodeProblemDetectorValues, "node-problem-detector-values", "", "The full Git URL of the desired chart values for Node Problem Detector")
command.Flags().StringVar(&flags.metricsServerVersion, "metrics-server-version", "", "The version of Metrics Server. Use 'stable' to provision the latest stable version published upstream.")
Expand Down
4 changes: 0 additions & 4 deletions cmd/cloud/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ func executeServerCmd(flags serverFlags) error {
}
model.SetUtilityDefaults(flags.utilitiesGitURL)

if flags.kubecostToken != "" {
_ = os.Setenv(model.KubecostToken, flags.kubecostToken)
}

logger := logger.WithField("instance", instanceID)

sqlStore, err := sqlStore(flags.database)
Expand Down
2 changes: 0 additions & 2 deletions cmd/cloud/server_flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ type serverFlags struct {
database string
maxSchemas int64
enableRoute53 bool
kubecostToken string

poll int
slowPoll int
Expand All @@ -221,7 +220,6 @@ func (flags *serverFlags) addFlags(command *cobra.Command) {
command.Flags().StringVar(&flags.database, "database", "sqlite://cloud.db", "The database backing the provisioning server.")
command.Flags().Int64Var(&flags.maxSchemas, "default-max-schemas-per-logical-database", 10, "When importing and creating new proxy multitenant databases, this value is used for MaxInstallationsPerLogicalDatabase.")
command.Flags().BoolVar(&flags.enableRoute53, "installation-enable-route53", false, "Specifies whether CNAME records for Installation should be created in Route53 as well.")
command.Flags().StringVar(&flags.kubecostToken, "kubecost-token", "", "Set a kubecost token")

command.Flags().IntVar(&flags.poll, "poll", 30, "The interval in seconds to poll for background work.")
command.Flags().IntVar(&flags.slowPoll, "slow-poll", 60, "The interval in seconds to poll for background work for supervisors that are not time sensitive (slow-poll supervisors).")
Expand Down
1 change: 0 additions & 1 deletion helm-charts/kubecost_values.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions internal/api/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func TestNewCreateClusterRequestFromReader(t *testing.T) {
"pgbouncer": {Chart: "1.2.0", ValuesPath: ""},
"promtail": {Chart: "6.2.2", ValuesPath: ""},
"rtcd": {Chart: "1.1.0", ValuesPath: ""},
"kubecost": {Chart: "1.95.0", ValuesPath: ""},
"node-problem-detector": {Chart: "2.0.5", ValuesPath: ""},
"metrics-server": {Chart: "3.8.2", ValuesPath: ""},
"velero": {Chart: "2.31.3", ValuesPath: ""},
Expand Down Expand Up @@ -106,7 +105,6 @@ func TestNewCreateClusterRequestFromReader(t *testing.T) {
"pgbouncer": {Chart: "1.2.0", ValuesPath: ""},
"promtail": {Chart: "6.2.2", ValuesPath: ""},
"rtcd": {Chart: "1.1.0", ValuesPath: ""},
"kubecost": {Chart: "1.95.0", ValuesPath: ""},
"node-problem-detector": {Chart: "2.0.5", ValuesPath: ""},
"metrics-server": {Chart: "3.8.2", ValuesPath: ""},
"velero": {Chart: "2.31.3", ValuesPath: ""},
Expand Down
189 changes: 0 additions & 189 deletions internal/provisioner/kubecost.go

This file was deleted.

10 changes: 1 addition & 9 deletions internal/provisioner/utility_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ var helmRepos = map[string]string{
"bitnami": "https://charts.bitnami.com/bitnami",
"fluent": "https://fluent.github.io/helm-charts",
"grafana": "https://grafana.github.io/helm-charts",
"kubecost": "https://kubecost.github.io/cost-analyzer/",
"deliveryhero": "https://charts.deliveryhero.io/",
"metrics-server": "https://kubernetes-sigs.github.io/metrics-server/",
"vmware-tanzu": "https://vmware-tanzu.github.io/helm-charts/",
Expand Down Expand Up @@ -140,13 +139,6 @@ func newUtilityGroupHandle(
return nil, errors.Wrap(err, "failed to get handle for RTCD")
}

kubecost, err := newKubecostHandle(cluster,
cluster.DesiredUtilityVersion(model.KubecostCanonicalName),
kubeconfigPath, params.AllowCIDRRangeList, awsClient, logger)
if err != nil {
return nil, errors.Wrap(err, "failed to get handle for Kubecost")
}

nodeProblemDetector, err := newNodeProblemDetectorHandle(
cluster.DesiredUtilityVersion(model.NodeProblemDetectorCanonicalName),
cluster, kubeconfigPath, logger)
Expand Down Expand Up @@ -178,7 +170,7 @@ func newUtilityGroupHandle(
// the order of utilities here matters; the utilities are deployed
// in order to resolve dependencies between them
return &utilityGroup{
utilities: []Utility{nginx, nginxInternal, prometheusOperator, thanos, fluentbit, teleport, pgbouncer, promtail, kubecost, nodeProblemDetector, rtcd, metricsServer, velero, cloudprober},
utilities: []Utility{nginx, nginxInternal, prometheusOperator, thanos, fluentbit, teleport, pgbouncer, promtail, nodeProblemDetector, rtcd, metricsServer, velero, cloudprober},
logger: logger,
cluster: cluster,
}, nil
Expand Down
3 changes: 0 additions & 3 deletions model/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ const (
// MattermostChannel is the name of the Environment Variable which
// may contain a Mattermost channel in which notifications are going to be sent
MattermostChannel = "mattermost-channel"
// KubecostToken is the name of the Environment Variable which
// may contain a Kubecost token which kubecost helm chart needs
KubecostToken = "kubecost-token"
)

// Cluster represents a Kubernetes cluster.
Expand Down
9 changes: 0 additions & 9 deletions model/cluster_utility.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ const (
PromtailCanonicalName = "promtail"
// RtcdCanonicalName is the canonical string representation of RTCD
RtcdCanonicalName = "rtcd"
// KubecostCanonicalName is the canonical string representation of kubecost
KubecostCanonicalName = "kubecost"
// NodeProblemDetectorCanonicalName is the canonical string representation of node problem detector
NodeProblemDetectorCanonicalName = "node-problem-detector"
// MetricsServerCanonicalName is the canonical string representation of metrics server
Expand Down Expand Up @@ -79,8 +77,6 @@ var DefaultUtilityVersions map[string]*HelmUtilityVersion = map[string]*HelmUtil
PromtailCanonicalName: {Chart: "6.2.2", ValuesPath: ""},
// RtcdCanonicalName defines the default version and values path for the Helm chart
RtcdCanonicalName: {Chart: "1.1.0", ValuesPath: ""},
// KubecostCanonicalName defines the default version and values path for the Helm chart
KubecostCanonicalName: {Chart: "1.95.0", ValuesPath: ""},
// NodeProblemDetectorCanonicalName defines the default version and values path for the Helm chart
NodeProblemDetectorCanonicalName: {Chart: "2.0.5", ValuesPath: ""},
// MetricsServerCanonicalName defines the default version and values path for the Helm chart
Expand All @@ -101,7 +97,6 @@ var defaultUtilityValuesFileNames map[string]string = map[string]string{
PgbouncerCanonicalName: "pgbouncer_values.yaml",
PromtailCanonicalName: "promtail_values.yaml",
RtcdCanonicalName: "rtcd_values.yaml",
KubecostCanonicalName: "kubecost_values.yaml",
NodeProblemDetectorCanonicalName: "node_problem_detector_values.yaml",
MetricsServerCanonicalName: "metrics_server_values.yaml",
VeleroCanonicalName: "velero_values.yaml",
Expand Down Expand Up @@ -147,7 +142,6 @@ type UtilityGroupVersions struct {
Pgbouncer *HelmUtilityVersion
Promtail *HelmUtilityVersion
Rtcd *HelmUtilityVersion
Kubecost *HelmUtilityVersion
NodeProblemDetector *HelmUtilityVersion
MetricsServer *HelmUtilityVersion
Velero *HelmUtilityVersion
Expand All @@ -168,7 +162,6 @@ func (h *UtilityGroupVersions) AsMap() map[string]*HelmUtilityVersion {
PgbouncerCanonicalName: h.Pgbouncer,
PromtailCanonicalName: h.Promtail,
RtcdCanonicalName: h.Rtcd,
KubecostCanonicalName: h.Kubecost,
NodeProblemDetectorCanonicalName: h.NodeProblemDetector,
MetricsServerCanonicalName: h.MetricsServer,
VeleroCanonicalName: h.Velero,
Expand Down Expand Up @@ -301,8 +294,6 @@ func setUtilityVersion(versions *UtilityGroupVersions, utility string, desiredVe
versions.Promtail = desiredVersion
case RtcdCanonicalName:
versions.Rtcd = desiredVersion
case KubecostCanonicalName:
versions.Kubecost = desiredVersion
case NodeProblemDetectorCanonicalName:
versions.NodeProblemDetector = desiredVersion
case MetricsServerCanonicalName:
Expand Down
Loading

0 comments on commit 9f9245c

Please sign in to comment.