diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/argocd/guides/_category_.json b/docs/build-your-software-catalog/sync-data-to-catalog/argocd/guides/_category_.json new file mode 100644 index 0000000000..e3fa5ecb5e --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/argocd/guides/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Guides", + "position": 1 +} diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/argocd/guides/connect-opencost-resource-with-argocd-k8s-resources.md b/docs/build-your-software-catalog/sync-data-to-catalog/argocd/guides/connect-opencost-resource-with-argocd-k8s-resources.md new file mode 100644 index 0000000000..be9afaf9af --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/argocd/guides/connect-opencost-resource-with-argocd-k8s-resources.md @@ -0,0 +1,93 @@ +--- +sidebar_position: 1 +title: Connect Opencost Cloud Cost with ArgoCD/K8 resource in Port +--- + +import PortTooltip from "/src/components/tooltip/tooltip.jsx" + +# Connect Opencost Cloud Cost with ArgoCD/K8 resource in Port + +This guide demonstrates how to link OpenCost cloud cost data with your ArgoCD K8 resources within Port, enabling you to gain insights into the cost breakdown of your infrastructure and applications. + +## Use Case Examples: +- Cost Attribution: Determine which Kubernetes resource contribute the most to your overall cloud costs. +- Budget Management: Track the costs of individual pods or clusters against your budget allocations. +- Anomaly Detection: Identify unusual spikes in resource costs and investigate potential causes. +- Optimization Opportunities: Pinpoint resources that are underutilized or overprovisioned, potentially leading to cost savings. + +::: + + +## Prerequisites +- This guide assumes you have a Port account and that you have finished the [onboarding process](/quickstart). +- Ensure you have [Port's Opencost integration installed and configured in your environment](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost). +- Ensure you have [Port's ArgoCD integration installed and configured in your environment](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/argocd/). + + +## Create the ArgoCD K8 relation + +With Opencost and ArgoCD installed, you should see some blueprints created by both integrations. + +Now that Port is synced with our ArgoCD and Opencost resources, let's map the Opencost Resource Allocations to the ArgoCD K8 resource. + +First, we will need to create a [relation](/build-your-software-catalog/customize-integrations/configure-data-model/relate-blueprints/relate-blueprints.md) between our `argocdKubernetesResource` and the corresponding `openCostResourceAllocation`. + +1. Head back to the [Builder](https://app.getport.io/settings/data-model), choose the `Kubernetes Resource + + ` blueprint, and click on `New relation`: + + + +

+ +2. Fill out the form like this, then click `Create`: + + + +

+ + +Now that the blueprints are related, we need to assign the relevant ArgoCD Kubernetes resource to each of our Opencost Resource Allocation. This can be done by adding some mapping logic. Go to your [data sources page](https://app.getport.io/settings/data-sources), and click on your ArgoCD integration + +Under the `resources` key, locate the Kubernetes block and replace it with the following YAML block to map ArgoCD Kubernetes Resource to the respective Opencost Allocation Resource. Then click `Save & Resync`: + +
+Relation mapping (click to expand) + +```yaml showLineNumbers + - kind: managed-resource + selector: + query: "true" + port: + entity: + mappings: + identifier: .__application.metadata.uid + "-" + .kind + "-" + .name + title: .__application.metadata.name + "-" + .kind + "-" + .name + blueprint: '"argocdKubernetesResource"' + properties: + kind: .kind + namespace: .namespace + version: .resourceVersion + annotations: .liveState | fromjson | .metadata.annotations + labels: .liveState | fromjson | .metadata.labels + relations: + application: .__application.metadata.uid + image: 'if .kind == "Deployment" then .liveState | fromjson | .spec.template.spec.containers[0].image else null end' + openCostResourceAllocation: .name +``` + +
+ +:::tip Mapping explanation +The configuration mapping above maps `openCostResourceAllocation` using the `name` property of the Kubernetes resource since Opencost Resource Allocation have their identifiers as the name of the Kubernetes resource + +::: + + + + +More relevant guides and examples: +- [Port's Opencost integration](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost) +- [Port's ArgoCD integration](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/argocd/) + + diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/_category_.json b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/_category_.json new file mode 100644 index 0000000000..84621b0683 --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Opencost", + "position": 2 +} diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/_category_.json b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/_category_.json new file mode 100644 index 0000000000..e3fa5ecb5e --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Guides", + "position": 1 +} diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/connect-opencost-resource-with-aws-resource.md b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/connect-opencost-resource-with-aws-resource.md new file mode 100644 index 0000000000..799a615d35 --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/connect-opencost-resource-with-aws-resource.md @@ -0,0 +1,103 @@ +--- +sidebar_position: 1 +title: Connect Opencost Cloud Cost with AWS Resource in Port +--- + +import PortTooltip from "/src/components/tooltip/tooltip.jsx" + +# Connect Opencost Clou- d Cost with AWS Resource in Port + +This guide will show you how to connect an Opencost cloudcost resource with an AWS resource in Port to analyze your cloud cost allocation. + +## Use Case Examples: + +- Cost Attribution: Determine which AWS resources (EC2 instances, RDS databases, etc.) contribute the most to your overall cloud costs. +- Budget Management: Track the costs of individual resources or groups of resources against your budget allocations. +- Anomaly Detection: Identify unusual spikes in resource costs and investigate potential causes. +- Optimization Opportunities: Pinpoint resources that are underutilized or overprovisioned, potentially leading to cost savings. + +::: + +## Prerequisites +- This guide assumes you have a Port account and that you have finished the [onboarding process](/quickstart). +- Ensure you have [Port's Opencost integration installed and configured in your environment](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost). +- Ensure you have [Port's AWS integration installed and configured in your environment](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/cloud-providers/aws/installations/installation). This guide does not support the [deprecated AWS Exporter integration](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/cloud-providers/aws/aws-exporter/) + + +## Create the Opencost Cloudcost relation + +With Opencost and AWS integrations installed, you should see some blueprints created by both integrations + +Now that Port is synced with our AWS and Opencost resources, let's map the Opencost Cloudcost to the AWS Cloud Resources. + +First, we will need to create a [relation](/build-your-software-catalog/customize-integrations/configure-data-model/relate-blueprints/relate-blueprints.md) between our `openCostCloudcost` and the corresponding `cloudResource`. + +1. Head back to the [Builder](https://app.getport.io/settings/data-model), choose the `Opencost Cloudcost` blueprint, and click on `New relation`: + + + +

+ +2. Fill out the form like this, then click `Create`: + + + +

+ + +Now that the blueprints are related, we need to assign the relevant Opencost Cloudcost to each of our AWS Cloud Resource. This can be done by adding some mapping logic. Go to your [data sources page](https://app.getport.io/settings/data-sources), and click on your Opencost integration: + + + +

+ +Under the `resources` key, locate the Cloudcost block and replace it with the following YAML block to map Opencost Cloudcost to the respective AWS Cloud Resource. Then click `Save & Resync`: + +
+Relation mapping (click to expand) + +```yaml showLineNumbers + - kind: cloudcost + selector: + query: .properties.providerID + aggregate: providerID + accumulate: week + window: week + port: + entity: + mappings: + identifier: .properties.providerID + title: .properties.providerID + blueprint: '"openCostCloudcost"' + properties: + startDate: .window.start + endDate: .window.end + listCost: .listCost.cost + netCost: .netCost.cost + amortizedNetCost: .amortizedNetCost.cost + invoicedCost: .invoicedCost.cost + amortizedCost: .amortizedCost.cost + relations: + awsCloudResource: .properties.providerID +``` + +
+ +:::tip Mapping explanation +The configuration mapping above ingests cloud cost data with selector properties designed to retrieve the AWS resource's ID + +- `query: .properties.providerID` ensures that only entities with a providerID are ingested +- `aggregate: providerID` aggregates data by provider ID (AWS ARN) which ensures that entities are mapped to their respective AWS resource +- `accumulate: week` defines the step size which accumulates data week by week +- `window: week` grabs data for the past one week + +For the `awsCloudCost` relation, we extract the resource ID from the Provider ID of the cloudcost information. Therefore, each Cloudcost entity will be mapped to their respective AWS resource. +By following these steps, you can seamlessly connect Opencost Cloudcost data with its respective AWS resources. + +::: + + + +More relevant guides and examples: +- [Port's Opencost integration](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost) +- [Port's AWS integration](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/cloud-providers/aws/installations/installation) diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost.md b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/opencost.md similarity index 98% rename from docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost.md rename to docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/opencost.md index 264d64a5f6..2256585a7b 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/opencost.md @@ -1,9 +1,9 @@ import Tabs from "@theme/Tabs" import TabItem from "@theme/TabItem" -import Prerequisites from "../templates/\_ocean_helm_prerequisites_block.mdx" -import AzurePremise from "../templates/\_ocean_azure_premise.mdx" -import DockerParameters from "./\_opencost-docker-parameters.mdx" -import AdvancedConfig from '../../../generalTemplates/_ocean_advanced_configuration_note.md' +import Prerequisites from "../../templates/\_ocean_helm_prerequisites_block.mdx" +import AzurePremise from "../../templates/\_ocean_azure_premise.mdx" +import DockerParameters from "../\_opencost-docker-parameters.mdx" +import AdvancedConfig from '../../../../generalTemplates/_ocean_advanced_configuration_note.md' import PortApiRegionTip from "/docs/generalTemplates/_port_region_parameter_explanation_template.md" import OceanRealtimeInstallation from "/docs/build-your-software-catalog/sync-data-to-catalog/templates/_ocean_realtime_installation.mdx" diff --git a/docs/guides/all/setup-slack-reminders.md b/docs/guides/all/setup-slack-reminders.md index 10ba492056..57fcc54773 100644 --- a/docs/guides/all/setup-slack-reminders.md +++ b/docs/guides/all/setup-slack-reminders.md @@ -221,7 +221,7 @@ Create a webhook in GitLab for triggering your GitLab: - Construct the [pipeline trigger webhook URL](https://docs.gitlab.com/ee/ci/triggers/#use-a-webhook) with your project details. - Back in Port, edit your action and in its `backend` step paste the **webhook URL** in the `Endpoint URL` field. -Now let's create the pipeline file that contains our logic. In your GitLab project create a new file named `gitlab-ci.yaml` and use the following snippet as its content: +Now let's create the pipeline file that contains our logic. In your GitLab project create a new file named `.gitlab-ci.yml` (note the period at the start of the filename) and use the following snippet as its content:
GitLab pipeline (click to expand) diff --git a/docs/integrations-index.md b/docs/integrations-index.md index d4706df369..70bca425f0 100644 --- a/docs/integrations-index.md +++ b/docs/integrations-index.md @@ -236,7 +236,11 @@ This page contains a list of Port's available integrations, organized by the pla ## OpenCost -- [OpenCost integration](/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost.md) +- [OpenCost integration](/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/opencost.md) + +- [Connect Opencost resource with ArgoCD K8 resource](/build-your-software-catalog/sync-data-to-catalog/argocd/guides/connect-opencost-resource-with-argocd-k8s-resources.md) + +- [Connect Opencost resource with AWS resource](/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/connect-opencost-resource-with-aws-resource.md) ## Dynatrace diff --git a/static/img/build-your-software-catalog/sync-data-to-catalog/argocd/argoCDToOpencostRelation.png b/static/img/build-your-software-catalog/sync-data-to-catalog/argocd/argoCDToOpencostRelation.png new file mode 100644 index 0000000000..085a6a7b90 Binary files /dev/null and b/static/img/build-your-software-catalog/sync-data-to-catalog/argocd/argoCDToOpencostRelation.png differ diff --git a/static/img/build-your-software-catalog/sync-data-to-catalog/argocd/createRelation.png b/static/img/build-your-software-catalog/sync-data-to-catalog/argocd/createRelation.png new file mode 100644 index 0000000000..2834228e4d Binary files /dev/null and b/static/img/build-your-software-catalog/sync-data-to-catalog/argocd/createRelation.png differ diff --git a/static/img/build-your-software-catalog/sync-data-to-catalog/argocd/newRelationMapping.png b/static/img/build-your-software-catalog/sync-data-to-catalog/argocd/newRelationMapping.png new file mode 100644 index 0000000000..91d1fcbfba Binary files /dev/null and b/static/img/build-your-software-catalog/sync-data-to-catalog/argocd/newRelationMapping.png differ diff --git a/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/awsToCloudcostRelation.png b/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/awsToCloudcostRelation.png new file mode 100644 index 0000000000..8e6308fb7e Binary files /dev/null and b/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/awsToCloudcostRelation.png differ diff --git a/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/createNewRelationOpencost.png b/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/createNewRelationOpencost.png new file mode 100644 index 0000000000..18b0c13f0c Binary files /dev/null and b/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/createNewRelationOpencost.png differ diff --git a/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/datasourcesOpencost.png b/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/datasourcesOpencost.png new file mode 100644 index 0000000000..f63111b883 Binary files /dev/null and b/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/datasourcesOpencost.png differ diff --git a/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/newRelationOpenCost.png b/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/newRelationOpenCost.png new file mode 100644 index 0000000000..5a09360f94 Binary files /dev/null and b/static/img/build-your-software-catalog/sync-data-to-catalog/cloud-cost/opencost/guides/newRelationOpenCost.png differ