Skip to content

feat: k8s resource recommendation service integration #6676

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ require (
replace (
github.com/argoproj/argo-workflows/v3 v3.5.13 => github.com/devtron-labs/argo-workflows/v3 v3.5.13
github.com/cyphar/filepath-securejoin v0.4.1 => github.com/cyphar/filepath-securejoin v0.3.6 // indirect
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250616095652-3ee00d35b864
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616095652-3ee00d35b864
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250618111727-31fb9a4b3aff
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250618111727-31fb9a4b3aff
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc h1:VRRKCwnzq
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/devtron-labs/argo-workflows/v3 v3.5.13 h1:3pINq0gXOSeTw2z/vYe+j80lRpSN5Rp/8mfQORh8SmU=
github.com/devtron-labs/argo-workflows/v3 v3.5.13/go.mod h1:/vqxcovDPT4zqr4DjR5v7CF8ggpY1l3TSa2CIG3jmjA=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250616095652-3ee00d35b864 h1:nemhi7OwDE4zTRyMYbeW8rCgCa3FnetL8Izt30gUn7k=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250616095652-3ee00d35b864/go.mod h1:9LCkYfiWaEKIBkmxw9jX1GujvEMyHwmDtVsatffAkeU=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616095652-3ee00d35b864 h1:MNpsaUvDgvaiHcYVzT8tPJ7UyY8QiBekpWezfPYu4nA=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616095652-3ee00d35b864/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250618111727-31fb9a4b3aff h1:zCZgpyA6UJc+AAySnslt6zLPuAU7JUvh8PsS5iB7BUM=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250618111727-31fb9a4b3aff/go.mod h1:9LCkYfiWaEKIBkmxw9jX1GujvEMyHwmDtVsatffAkeU=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250618111727-31fb9a4b3aff h1:bCD/Lq8fwoz7LdAWgAEZTgxvC+TXspBGlLAqcnGNYe0=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250618111727-31fb9a4b3aff/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
github.com/devtron-labs/go-bitbucket v0.9.60-beta h1:VEx1jvDgdtDPS6A1uUFoaEi0l1/oLhbr+90xOwr6sDU=
github.com/devtron-labs/go-bitbucket v0.9.60-beta/go.mod h1:GnuiCesvh8xyHeMCb+twm8lBR/kQzJYSKL28ZfObp1Y=
github.com/devtron-labs/protos v0.0.3-0.20250323220609-ecf8a0f7305e h1:U6UdYbW8a7xn5IzFPd8cywjVVPfutGJCudjePAfL/Hs=
Expand Down
11 changes: 11 additions & 0 deletions scripts/sql/33703900_devtron_resource_recommendation.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
BEGIN;

DROP TABLE IF EXISTS krr_scan_history;

DROP SEQUENCE IF EXISTS krr_scan_history_id_seq;

DROP TABLE IF EXISTS krr_scan_request;

DROP SEQUENCE IF EXISTS krr_scan_request_id_seq;

END;
44 changes: 44 additions & 0 deletions scripts/sql/33703900_devtron_resource_recommendation.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
BEGIN;

CREATE SEQUENCE IF NOT EXISTS krr_scan_request_id_seq;

CREATE TABLE IF NOT EXISTS krr_scan_request
(
"id" INTEGER PRIMARY KEY DEFAULT nextval('krr_scan_request_id_seq'),
"kind" VARCHAR(250) NOT NULL,
"api_version" VARCHAR(250) NOT NULL,
"name" VARCHAR(250) NOT NULL,
"namespace" VARCHAR(250) NOT NULL,
"cluster_id" INTEGER NOT NULL,
"created_on" TIMESTAMPTZ,
"created_by" INTEGER,
"updated_on" TIMESTAMPTZ,
"updated_by" INTEGER,
CONSTRAINT cluster_id_krr_scan_request_fk FOREIGN KEY (cluster_id) REFERENCES cluster (id)
);


CREATE SEQUENCE IF NOT EXISTS krr_scan_history_id_seq;

CREATE TABLE IF NOT EXISTS krr_scan_history
(
"id" INTEGER PRIMARY KEY DEFAULT nextval('krr_scan_history_id_seq'),
"krr_scan_request" INTEGER NOT NULL,
"container" VARCHAR(1000) NOT NULL,
"scanned_on" TIMESTAMPTZ NOT NULL,
"scanned_by" INTEGER,
"resource_type" VARCHAR(50) CHECK (resource_type IN ('CPU', 'MEMORY')),
"recommended_strategy_name" VARCHAR(250),
"recommended_request" DOUBLE PRECISION,
"recommended_limits" DOUBLE PRECISION,
"unit" VARCHAR(50),
"evaluation" JSONB,
"recommendation" JSONB,
"created_on" TIMESTAMPTZ,
"created_by" INTEGER,
"updated_on" TIMESTAMPTZ,
"updated_by" INTEGER,
CONSTRAINT krr_scan_request_fk FOREIGN KEY (krr_scan_request) REFERENCES krr_scan_request (id)
);

END;

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -523,15 +523,15 @@ github.com/davecgh/go-spew/spew
# github.com/deckarep/golang-set v1.8.0
## explicit; go 1.17
github.com/deckarep/golang-set
# github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250616095652-3ee00d35b864
# github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250618111727-31fb9a4b3aff
## explicit; go 1.24.0
github.com/devtron-labs/authenticator/apiToken
github.com/devtron-labs/authenticator/client
github.com/devtron-labs/authenticator/jwt
github.com/devtron-labs/authenticator/middleware
github.com/devtron-labs/authenticator/oidc
github.com/devtron-labs/authenticator/password
# github.com/devtron-labs/common-lib v0.18.1-0.20241001061923-eda545dc839e => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616095652-3ee00d35b864
# github.com/devtron-labs/common-lib v0.18.1-0.20241001061923-eda545dc839e => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250618111727-31fb9a4b3aff
## explicit; go 1.24.0
github.com/devtron-labs/common-lib/async
github.com/devtron-labs/common-lib/blob-storage
Expand Down Expand Up @@ -2569,5 +2569,5 @@ xorm.io/xorm/log
xorm.io/xorm/names
xorm.io/xorm/schemas
xorm.io/xorm/tags
# github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250616095652-3ee00d35b864
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616095652-3ee00d35b864
# github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250618111727-31fb9a4b3aff
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250618111727-31fb9a4b3aff
2 changes: 1 addition & 1 deletion wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.