Skip to content

Commit

Permalink
Tested Kubecost for ArmoniK
Browse files Browse the repository at this point in the history
  • Loading branch information
AncientPatata committed Dec 30, 2024
1 parent 52e8326 commit 65a7d3a
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 6 deletions.
8 changes: 8 additions & 0 deletions dev/temp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```
helm upgrade --install kubecost \
--repo https://kubecost.github.io/cost-analyzer/ cost-analyzer \
--namespace armonik \
--set kubecostToken="YWJkZXJyYWhtYW5lLmRrb3VyQHN0dWRlbnQtY3MuZnI=xm343yadf98" \
--set global.prometheus.fqdn=http://prometheus.armonik.svc:9090 \
--set global.prometheus.enabled=false
```
8 changes: 4 additions & 4 deletions infrastructure/quick-deploy/aws/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ RANDOM_PREFIX != [ -e $(GENERATED_DIR)/.prefix ] || { mkdir -p $(GENERATED_DIR)
export TF_DATA_DIR?=$(GENERATED_DIR)
export TF_PLUGIN_CACHE_DIR?=$(GENERATED_DIR)/terraform-plugins
export REGION?=eu-west-3
export PROFILE?=default
export NAMESPACE?=armonik
export PREFIX?=armonik-$(RANDOM_PREFIX)
export PROFILE?=sleep
export NAMESPACE?=ad
export PREFIX?=ad-$(RANDOM_PREFIX)
export TFSTATE_BUCKET_NAME?=$(PREFIX)-tfstate

export TF_VAR_region?=$(REGION)
Expand Down Expand Up @@ -102,7 +102,7 @@ get-modules:
git -C $(MODULES_DIR) -c advice.detachedHead=false checkout $(MODULES_VERSION);\
git -C $(MODULES_DIR) pull origin $(MODULES_VERSION);\
else \
git -c advice.detachedHead=false clone --branch $(MODULES_VERSION) $(MODULES_SOURCE) $(MODULES_DIR);\
git -c advice.detachedHead=false clone --branch $(MODULES_VERSION) $(MODULES_SOURCE) $(MODULES_DIR) --depth=1;\
fi

clean:
Expand Down
21 changes: 21 additions & 0 deletions infrastructure/quick-deploy/aws/monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ module "prometheus" {
service_type = var.prometheus.service_type
node_selector = var.prometheus.node_selector
metrics_exporter_url = "${module.metrics_exporter.host}:${module.metrics_exporter.port}"
mongo_metrics_exporter_url = module.mongodb_exporter.url
docker_image = {
image = local.ecr_images["${var.prometheus.image_name}:${try(coalesce(var.prometheus.image_tag), "")}"].image
tag = local.ecr_images["${var.prometheus.image_name}:${try(coalesce(var.prometheus.image_tag), "")}"].tag
Expand All @@ -215,6 +216,26 @@ module "prometheus" {
security_context = var.prometheus.security_context
}

# module "kubecost" {
# source = "./generated/infra-modules/monitoring/onpremise/kubecost"
# namespace = local.namespace
# prometheus_fqdn= module.prometheus.url
# }


# MongoExporter
module "mongodb_exporter" {
source = "./generated/infra-modules/monitoring/onpremise/exporters/mongodb-exporter"
namespace = local.namespace
docker_image = {
image = "percona/mongodb_exporter"
tag = "0.41.0"
image_pull_secrets = ""
}
certif_mount = module.mongodb[0].mount_secret
mongo_url = "mongodb://mongodb_exporter:mongodb_exporter@mongodb-armonik-headless/admin?tls=true&tlsAllowInvalidCertificates=true&tlsAllowInvalidHostnames=true&tlsCAFile=/mongodb/certificate/mongodb-ca-cert"
}


module "prometheus_efs_persistent_volume" {
count = (try(var.prometheus.persistent_volume.storage_provisioner, "") == "efs.csi.aws.com" ? 1 : 0)
Expand Down
4 changes: 3 additions & 1 deletion infrastructure/quick-deploy/aws/parameters.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ eks = {
map_users = []
}

upload_images = false

# List of EKS managed node groups
eks_managed_node_groups = {
# Default node group for workers of ArmoniK
Expand Down Expand Up @@ -303,7 +305,7 @@ mongodb = {
}

# Nullify to disable sharding, each nullification of subobject will result in the use of default values
mongodb_sharding = {}
mongodb_sharding = null

seq = {
node_selector = { service = "monitoring" }
Expand Down
3 changes: 3 additions & 0 deletions infrastructure/quick-deploy/localhost/parameters.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ control_plane = {
default_partition = "default"
}

upload_images = false


# Parameters of admin GUI
admin_gui = {
limits = {
Expand Down
2 changes: 1 addition & 1 deletion versions.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"armonik_versions": {
"armonik": "2.20.0",
"infra": "0.5.1-pre-2-e62c928",
"infra": "ad/kubecost",
"infra_plugins": "0.1.1",
"core": "0.27.2",
"api": "3.19.0",
Expand Down

0 comments on commit 65a7d3a

Please sign in to comment.