From fd7930bc1bf9dcfd0b72d9c3d1cdd68af4ba594d Mon Sep 17 00:00:00 2001 From: Nima Kaviani Date: Mon, 24 Jul 2023 18:21:50 -0700 Subject: [PATCH 1/2] update README and plugin annotation keys --- README.md | 27 +++++++++++++++------------ src/plugin.ts | 5 +++-- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a7362b7..b40611f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This plugin displays your Argo Workflows in Backstage Entities must be annotated with Kubernetes annotations. An example component would look like the following where you can configure the `spec` to your -liking. Information specific to Argo Workflows goes under `annotations` as +liking. Information specific to Argo Workflows goes under `annotations` as shown below: ```yaml @@ -23,7 +23,7 @@ metadata: name: backstage annotations: backstage.io/kubernetes-namespace: default - backstage.io/kubernetes-label-selector: env=dev,my=label + argo-workflows.cnoe.io/label-selector: env=dev,my=label spec: type: service lifecycle: experimental @@ -38,13 +38,13 @@ argoWorkflows: baseUrl: https://my-argo-workflows.url ``` -Update your Entity page. For example: +Update your Entity page. For example: ```typescript // in packages/app/src/components/catalog/EntityPage.tsx import { EntityArgoWorkflowsOverviewCard, isArgoWorkflowsAvailable, -} from '@internal/plugin-argo-workflows'; +} from '@cnoe-io/plugin-argo-workflows'; const overviewContent = ( @@ -74,11 +74,14 @@ As shown in the example above, the following annotations could go under `annotations` in the backstage `Component` and will be recognized by this plugin. - `backstage.io/kubernetes-namespace`: Optional. The namespace to be search for finding Argo workflows. Defaults to the `default` namespace. -- Conditionally, one of the two labels below are required: - - `backstage.io/kubernetes-label-selector`: the backstage default label - selector to choose workflows that carry the label. - - `argo-workflows/label-selector`: Same as the above, except internal to Argo machinery. This value takes precedent over the one above if both are defined. -- `argo-workflows/cluster-name`: Optional. Specifies the name of the Kubernetes cluster to retrieve information from. If missing chooses the Kubernetes context available to backstage at runtime. +- `argo-workflows.cnoe.io/label-selector`: Same as the above, except internal to Argo machinery. This value takes precedent over the one above if both are defined. +- `argo-workflows.cnoe.io/cluster-name`: Optional. Specifies the name of the Kubernetes cluster to retrieve information from. If missing chooses the Kubernetes context available to backstage at runtime. + +you can also use the `backstage.io/kubernetes-label-selector`, to select the +relevant spark jobs. However , `backstage.io/kubernetes-label-selector` is a +generic label selector used more widely by the Kubernetes plugin which could +pull other less relevant data pulled into your backstage deployment as well. We +recommend using `argo-workflows.cnoe.io/label-selector` when using this plugin. ### Authentication @@ -173,7 +176,7 @@ kubernetes: caData: LS0t ``` -For this configuration, the `argo-workflows/cluster-name` annotaton value must be `my-cluster-1` +For this configuration, the `argo-workflows.cnoe.io/cluster-name` annotaton value must be `my-cluster-1` ```yaml apiVersion: backstage.io/v1alpha1 @@ -182,8 +185,8 @@ metadata: name: backstage annotations: backstage.io/kubernetes-namespace: default - backstage.io/kubernetes-label-selector: env=dev,my=label - argo-workflows/cluster-name: my-cluster-1 + argo-workflows.cnoe.io/label-selector: env=dev,my=label + argo-workflows.cnoe.io/cluster-name: my-cluster-1 spec: type: service lifecycle: experimental diff --git a/src/plugin.ts b/src/plugin.ts index e17e795..80e89a7 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -11,12 +11,13 @@ import { rootRouteRef } from "./routes"; import { ArgoWorkflows, argoWorkflowsApiRef } from "./api"; import { kubernetesApiRef } from "@backstage/plugin-kubernetes"; -export const CLUSTER_NAME_ANNOTATION = "argo-workflows/cluster-name"; +export const CLUSTER_NAME_ANNOTATION = "argo-workflows.cnoe.io/cluster-name"; export const K8S_LABEL_SELECTOR_ANNOTATION = "backstage.io/kubernetes-label-selector"; export const K8S_NAMESPACE_ANNOTATION = "backstage.io/kubernetes-namespace"; export const ARGO_WORKFLOWS_LABEL_SELECTOR_ANNOTATION = - "argo-workflows/label-selector"; + "argo-workflows.cnoe.io/label-selector"; + export const argoWorkflowsPlugin = createPlugin({ id: "argo-workflows", routes: { From 47a08b4739b947324eea0e2f854c16da1d064f4e Mon Sep 17 00:00:00 2001 From: Nima Kaviani Date: Tue, 1 Aug 2023 10:04:07 -0700 Subject: [PATCH 2/2] fix spark->argo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b40611f..9a9a0ff 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ As shown in the example above, the following annotations could go under - `argo-workflows.cnoe.io/cluster-name`: Optional. Specifies the name of the Kubernetes cluster to retrieve information from. If missing chooses the Kubernetes context available to backstage at runtime. you can also use the `backstage.io/kubernetes-label-selector`, to select the -relevant spark jobs. However , `backstage.io/kubernetes-label-selector` is a +relevant argo workflows. However , `backstage.io/kubernetes-label-selector` is a generic label selector used more widely by the Kubernetes plugin which could pull other less relevant data pulled into your backstage deployment as well. We recommend using `argo-workflows.cnoe.io/label-selector` when using this plugin.