Skip to content

Commit

Permalink
backstage: add opencost
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Login <batazor@evrone.com>
  • Loading branch information
batazor committed Jan 20, 2023
1 parent e2b5b4f commit ad2f40f
Show file tree
Hide file tree
Showing 15 changed files with 108 additions and 2 deletions.
Binary file modified docs/shortlink-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion internal/services/backstage/app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ catalog:
entityFilename: catalog-info.yaml
pullRequestBranchName: backstage-integration
rules:
- allow: [Component, System, API, Resource, Location]
- allow: [Component, System, API, Resource, Location, Domain]
locations:
# Local example data, file locations are relative to the backend process, typically `packages/backend`
- type: file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,38 @@ export class ShortLinkTechRadar implements TechRadarApi {
description:
'Excepteur **sint** occaecat *cupidatat* non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n```ts\nconst x = "3";\n```\n',
},
{
url: "#",
key: "kubernetes",
id: "kubernetes",
title: "Kubernetes",
quadrant: "platforms",
description: "Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.",
timeline: [
{
moved: 0,
ringId: "adopt",
date: new Date("2020-08-06"),
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"
},
]
},
{
title: "GitLab",
quadrant: "tools",
url: "#",
key: "gitlab",
id: "gitlab",
description: "GitLab is a web-based DevOps lifecycle tool that provides a Git-repository manager providing wiki, issue-tracking and continuous integration and deployment pipeline features, using an open-source license, developed by GitLab Inc.",
timeline: [
{
moved: 0,
ringId: "adopt",
date: new Date("2020-08-06"),
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"
},
],
}
],
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ spec:
targets:
- ./components/shortlink-api.yaml
- ./components/shortlink-billing.yaml
- ./components/k8s-opencost.yaml
2 changes: 1 addition & 1 deletion internal/services/backstage/shortlink-org/all-domains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
description: A collection of all Backstage shortlink domains
spec:
targets:
- ./domains/shortlink.best.yaml
- ./domains/shortlink.yaml
1 change: 1 addition & 0 deletions internal/services/backstage/shortlink-org/all-systems.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ metadata:
spec:
targets:
- ./systems/shortlink.yaml
- ./systems/kubernetes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: OpenCost
description: Open source cost monitoring for cloud native environments
links:
- url: https://www.opencost.io/
title: Website
icon: link
tags:
- kubernetes
- prometheus
annotations:
'backstage.io/kubernetes-namespace': opencost
'backstage.io/kubernetes-label-selector': 'app.kubernetes.io/name=opencost'
backstage.io/techdocs-ref: 'dir:opencost'
spec:
type: service
lifecycle: experimental
owner: shortlink-org
system: kubernetes
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Open source cost monitoring for cloud native environments

OpenCost is a vendor-neutral open source project for measuring and allocating
infrastructure and container costs in real time. Built by Kubernetes experts and
supported by Kubernetes practitioners, OpenCost shines a light into the black
box of Kubernetes spend.


### Goal

> OpenCost is a tool or monitoring the cost of Kubernetes.
In a world of horizontal pod autoscalers and autoscaling node groups
it is important to be able to monitor and perhaps even regulate spend automatically.
The obvious possibility of OpenCost is integrating with Prometheus and
using Prometheus to create cost alerts. Another possibility
I see is integrating OpenCost metrics with custom metrics
for horizontal pod autoscalers in Kubernetes as a way to set limits on spend
when scaling automatically. The autoscaling/v2 API supports scaling based on
multiple metrics. By leveraging custom metrics constraints on scaling can be set
based on data from OpenCost.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
site_name: opencost

nav:
- Home: README.md

plugins:
- techdocs-core
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
site_name: shortlink-api

nav:
- Home: README.md

plugins:
- techdocs-core
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
site_name: shortlink-billing

nav:
- Home: README.md

plugins:
- techdocs-core
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: backstage.io/v1alpha1
kind: System
metadata:
name: kubernetes
description: Kubernetes cluster
spec:
owner: shortlink-org
domain: kubernetes.local

0 comments on commit ad2f40f

Please sign in to comment.