From 0ed027726b71ddd4df38ba8c945323c1fd0b01fe Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Thu, 28 Sep 2023 12:54:50 +0200 Subject: [PATCH 01/12] first draft --- lib/addons/kuberay/index.ts | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 lib/addons/kuberay/index.ts diff --git a/lib/addons/kuberay/index.ts b/lib/addons/kuberay/index.ts new file mode 100644 index 000000000..c2c62e186 --- /dev/null +++ b/lib/addons/kuberay/index.ts @@ -0,0 +1,55 @@ +import { Construct } from 'constructs'; +import merge from "ts-deepmerge"; +import { ClusterInfo, Values } from "../../spi"; +import { createNamespace } from "../../utils"; +import { HelmAddOn, HelmAddOnProps, HelmAddOnUserProps } from "../helm-addon"; + +/** + * User provided options for the Helm Chart + */ +export interface KubeRayAddOnProps extends HelmAddOnUserProps { + /** + * To Create Namespace using CDK + */ + createNamespace?: boolean; +} + +/** + * Default props to be used when creating the Helm chart + */ +const defaultProps: HelmAddOnProps & KubeRayAddOnProps = { + name: "kuberay-operator", + chart: "kuberay/kuberay-operator", + namespace:"default", + version: "1.0.0-rc.0", + release: "KubeRay", + repository: "https://ray-project.github.io/kuberay-helm", + values: {}, + createNamespace: true +}; + +/** + * Main class to instantiate the Helm chart + */ +export class KubeRayAddOn extends HelmAddOn { + + readonly options: KubeRayAddOnProps; + constructor(props?: KubeRayAddOnProps) { + super({...defaultProps, ...props}); + this.options = this.props as KubeRayAddOnProps; + } + + deploy(clusterInfo: ClusterInfo): Promise { + const cluster = clusterInfo.cluster; + let values: Values = this.options.values ?? {}; + values = merge(values, this.props.values ?? {}); + + const chart = this.addHelmChart(clusterInfo, values); + + if( this.options.createNamespace == true){ + const namespace = createNamespace(this.options.namespace! , cluster); + chart.node.addDependency(namespace); + } + return Promise.resolve(chart); + } +} From 4b65735cc8039e1479a5b7c44b0d0f526c578fe0 Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Thu, 28 Sep 2023 20:58:48 +0200 Subject: [PATCH 02/12] fixed missing line in addons and chart release name --- lib/addons/index.ts | 1 + lib/addons/kuberay/index.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/addons/index.ts b/lib/addons/index.ts index 65cb06de4..0e8cb79fa 100644 --- a/lib/addons/index.ts +++ b/lib/addons/index.ts @@ -28,6 +28,7 @@ export * from './helm-addon'; export * from './karpenter'; export * from './kube-proxy'; export * from './kube-state-metrics'; +export * from './kuberay'; export * from './metrics-server'; export * from './nested-stack'; export * from './nginx'; diff --git a/lib/addons/kuberay/index.ts b/lib/addons/kuberay/index.ts index c2c62e186..bcc562eef 100644 --- a/lib/addons/kuberay/index.ts +++ b/lib/addons/kuberay/index.ts @@ -19,11 +19,11 @@ export interface KubeRayAddOnProps extends HelmAddOnUserProps { */ const defaultProps: HelmAddOnProps & KubeRayAddOnProps = { name: "kuberay-operator", - chart: "kuberay/kuberay-operator", - namespace:"default", + chart: "kuberay-operator", + namespace: "default", version: "1.0.0-rc.0", - release: "KubeRay", - repository: "https://ray-project.github.io/kuberay-helm", + release: "kuberay-operator", + repository: "https://ray-project.github.io/kuberay-helm", values: {}, createNamespace: true }; From e3495c92eb08a416b800230d4a655d8527b3dd21 Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Fri, 29 Sep 2023 09:19:38 +0200 Subject: [PATCH 03/12] added doc --- docs/addons/kuberay-operator.md | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 docs/addons/kuberay-operator.md diff --git a/docs/addons/kuberay-operator.md b/docs/addons/kuberay-operator.md new file mode 100644 index 000000000..2e6fbdf58 --- /dev/null +++ b/docs/addons/kuberay-operator.md @@ -0,0 +1,51 @@ +# KubeRay Operator Add-on + +[Ray](https://github.com/ray-project/ray) is a framework for scaling AI applications written in Python. Ray consists of a core distributed runtime and a set of AI libraries for simplifying ML compute. Ray allows scaling applications from a laptop to a cluster. + +KubeRay is a Kubernetes Operator that simplifies the deployment and management of Ray applications on Kubernetes. It is made of the following components: + +- KubeRay core, the official, fully-maintained component of KubeRay that provides three custom resource definitions, RayCluster, RayJob, and RayService +- Community-managed components (optional): KubeRay APIServer, KubeRay Python client and KubeRay CLI + +Please refer to [KubeRay Operator documentation](https://docs.ray.io/en/latest/cluster/kubernetes/index.html) for detailed information. + +This add-on installs the KubeRay Operator [Helm chart](https://github.com/ray-project/kuberay/blob/master/helm-chart/kuberay-operator/README.md). + +## Usage + +```typescript +import { Construct } from 'constructs'; +import * as blueprints from '@aws-quickstart/eks-blueprints'; + +export class DatadogConstruct extends Construct { + constructor(scope: Construct, id: string) { + super(scope, id); + + const stackID = `${id}-blueprint`; + + const addOn = new blueprints.addons.KubeRayAddOn(); + + blueprints.EksBlueprint.builder() + .account(process.env.CDK_DEFAULT_ACCOUNT!) + .region(process.env.CDK_DEFAULT_REGION!) + .version('auto') + .addOns(addOn) + .build(scope, stackID); + } +} +``` + +## Validation + +To validate the KubeRay Operator installation, please run the following command: + +```bash +kubectl get pods +``` + +Expected output: + +```bash +NAME READY STATUS RESTARTS AGE +kuberay-operator-58c98b495b-5k75l 1/1 Running 0 112m +``` From 4dea7178b9ad2d23c86556e47610e1de587d2387 Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Fri, 29 Sep 2023 17:10:37 +0200 Subject: [PATCH 04/12] addressing pr feedback --- examples/blueprint-construct/index.ts | 1 + mkdocs.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/blueprint-construct/index.ts b/examples/blueprint-construct/index.ts index 0bcd220e6..4663145e8 100644 --- a/examples/blueprint-construct/index.ts +++ b/examples/blueprint-construct/index.ts @@ -212,6 +212,7 @@ export default class BlueprintConstruct { efsFileSystem: 'apache-airflow-efs-provider' }), new blueprints.ExternalsSecretsAddOn(), + new blueprints.KubeRayAddOn() ]; // Instantiated to for helm version check. diff --git a/mkdocs.yml b/mkdocs.yml index 36e1086f8..fb383aed6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -62,6 +62,7 @@ nav: - Kube Proxy: 'addons/kube-proxy.md' - Kubecost: 'addons/kubecost.md' - Kubeflow: 'addons/kubeflow.md' + - KubeRay Operator: 'addons/kuberay-operator.md' - Kubevious: 'addons/kubevious.md' - Kube State Metrics: 'addons/kube-state-metrics.md' - Metrics Server: 'addons/metrics-server.md' From c93e2c5e0ab7fa6d5f9787c3148b523ab6f182cf Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Sat, 30 Sep 2023 08:06:27 +0200 Subject: [PATCH 05/12] added to index.md --- docs/addons/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/addons/index.md b/docs/addons/index.md index 88699b515..b4d75be18 100644 --- a/docs/addons/index.md +++ b/docs/addons/index.md @@ -50,6 +50,7 @@ The framework currently supports the following add-ons. | [`KomodorAddOn`](https://github.com/komodorio/komodor-eks-blueprints-addon) | Adds the [Komodor Agent](https://github.com/komodorio/helm-charts/tree/master/charts/k8s-watcher) to the EKS Cluster. | ✅ | ✅ | [`KubecostAddOn`](./kubecost.md) | Adds [Kubecost](https://kubecost.com) cost analyzer to the EKS cluster. | ✅ | | [`KubeflowAddOn`](./kubeflow.md) | Adds [kubeflow](https://awslabs.github.io/kubeflow-manifests/) Kubeflow pipeline addon the EKS cluster. | ✅ | +| [`KubeRayAddOn`](./kuberay-operator.md) | Installs KubeRay Operator. | ✅ | | [`KubeviousAddOn`](./kubevious.md) | Adds [Kubevious](https://github.com/kubevious/kubevious) open source Kubernetes dashboard to an EKS cluster. | ✅ | | [`KarpenterAddOn`](./karpenter.md) | Adds [Karpenter](https://github.com/awslabs/karpenter) support for Amazon EKS. | ✅ | ✅ | | [`KubeProxyAddOn`](./kube-proxy.md) | Adds kube-proxy Amazon EKS add-on. Kube-proxy maintains network rules on each Amazon EC2 node. | ✅ | ✅ | From 3d71cfe3bd93e672d9ddd8016a5c364e7ec5d048 Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Sat, 30 Sep 2023 08:12:55 +0200 Subject: [PATCH 06/12] amended index.md --- docs/addons/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/addons/index.md b/docs/addons/index.md index b4d75be18..6452fcc50 100644 --- a/docs/addons/index.md +++ b/docs/addons/index.md @@ -50,7 +50,7 @@ The framework currently supports the following add-ons. | [`KomodorAddOn`](https://github.com/komodorio/komodor-eks-blueprints-addon) | Adds the [Komodor Agent](https://github.com/komodorio/helm-charts/tree/master/charts/k8s-watcher) to the EKS Cluster. | ✅ | ✅ | [`KubecostAddOn`](./kubecost.md) | Adds [Kubecost](https://kubecost.com) cost analyzer to the EKS cluster. | ✅ | | [`KubeflowAddOn`](./kubeflow.md) | Adds [kubeflow](https://awslabs.github.io/kubeflow-manifests/) Kubeflow pipeline addon the EKS cluster. | ✅ | -| [`KubeRayAddOn`](./kuberay-operator.md) | Installs KubeRay Operator. | ✅ | +| [`KubeRayAddOn`](./kuberay-operator.md) | Installs the [KubeRay Operator](https://docs.ray.io/en/latest/cluster/kubernetes/index.html) Operator. | ✅ | ✅ | | [`KubeviousAddOn`](./kubevious.md) | Adds [Kubevious](https://github.com/kubevious/kubevious) open source Kubernetes dashboard to an EKS cluster. | ✅ | | [`KarpenterAddOn`](./karpenter.md) | Adds [Karpenter](https://github.com/awslabs/karpenter) support for Amazon EKS. | ✅ | ✅ | | [`KubeProxyAddOn`](./kube-proxy.md) | Adds kube-proxy Amazon EKS add-on. Kube-proxy maintains network rules on each Amazon EC2 node. | ✅ | ✅ | From 332f3d744e35c22985923186e3d7ee425e4b10e0 Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Sat, 30 Sep 2023 08:14:03 +0200 Subject: [PATCH 07/12] amended index.md --- docs/addons/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/addons/index.md b/docs/addons/index.md index 6452fcc50..995b091fd 100644 --- a/docs/addons/index.md +++ b/docs/addons/index.md @@ -50,7 +50,7 @@ The framework currently supports the following add-ons. | [`KomodorAddOn`](https://github.com/komodorio/komodor-eks-blueprints-addon) | Adds the [Komodor Agent](https://github.com/komodorio/helm-charts/tree/master/charts/k8s-watcher) to the EKS Cluster. | ✅ | ✅ | [`KubecostAddOn`](./kubecost.md) | Adds [Kubecost](https://kubecost.com) cost analyzer to the EKS cluster. | ✅ | | [`KubeflowAddOn`](./kubeflow.md) | Adds [kubeflow](https://awslabs.github.io/kubeflow-manifests/) Kubeflow pipeline addon the EKS cluster. | ✅ | -| [`KubeRayAddOn`](./kuberay-operator.md) | Installs the [KubeRay Operator](https://docs.ray.io/en/latest/cluster/kubernetes/index.html) Operator. | ✅ | ✅ | +| [`KubeRayAddOn`](./kuberay-operator.md) | Installs the [KubeRay Operator](https://docs.ray.io/en/latest/cluster/kubernetes/index.html). | ✅ | ✅ | | [`KubeviousAddOn`](./kubevious.md) | Adds [Kubevious](https://github.com/kubevious/kubevious) open source Kubernetes dashboard to an EKS cluster. | ✅ | | [`KarpenterAddOn`](./karpenter.md) | Adds [Karpenter](https://github.com/awslabs/karpenter) support for Amazon EKS. | ✅ | ✅ | | [`KubeProxyAddOn`](./kube-proxy.md) | Adds kube-proxy Amazon EKS add-on. Kube-proxy maintains network rules on each Amazon EC2 node. | ✅ | ✅ | From 22849ba5aec5bab58b0e916f21c418f64ea0c5da Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Tue, 3 Oct 2023 07:36:32 +0200 Subject: [PATCH 08/12] corrected doc error --- docs/addons/kuberay-operator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/addons/kuberay-operator.md b/docs/addons/kuberay-operator.md index 2e6fbdf58..954d2a1b6 100644 --- a/docs/addons/kuberay-operator.md +++ b/docs/addons/kuberay-operator.md @@ -17,7 +17,7 @@ This add-on installs the KubeRay Operator [Helm chart](https://github.com/ray-pr import { Construct } from 'constructs'; import * as blueprints from '@aws-quickstart/eks-blueprints'; -export class DatadogConstruct extends Construct { +export class KubeRayConstruct extends Construct { constructor(scope: Construct, id: string) { super(scope, id); From 158288a75d7e752630fdad14fc88330d95741b1d Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Mon, 5 Feb 2024 09:18:56 +0100 Subject: [PATCH 09/12] updated chart version --- lib/addons/kuberay/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/addons/kuberay/index.ts b/lib/addons/kuberay/index.ts index bcc562eef..cd0d2d751 100644 --- a/lib/addons/kuberay/index.ts +++ b/lib/addons/kuberay/index.ts @@ -21,7 +21,7 @@ const defaultProps: HelmAddOnProps & KubeRayAddOnProps = { name: "kuberay-operator", chart: "kuberay-operator", namespace: "default", - version: "1.0.0-rc.0", + version: "1.0.0", release: "kuberay-operator", repository: "https://ray-project.github.io/kuberay-helm", values: {}, From 639a0529b1c6bfe1b9ef74214d779a87784ec592 Mon Sep 17 00:00:00 2001 From: Mikhail Shapirov <60622975+shapirov103@users.noreply.github.com> Date: Thu, 15 Feb 2024 11:04:41 -0500 Subject: [PATCH 10/12] Update index.ts failing after conflict resolution --- examples/blueprint-construct/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/blueprint-construct/index.ts b/examples/blueprint-construct/index.ts index e17689acd..cb4d6a417 100644 --- a/examples/blueprint-construct/index.ts +++ b/examples/blueprint-construct/index.ts @@ -228,7 +228,7 @@ export default class BlueprintConstruct { }), new blueprints.ExternalsSecretsAddOn(), new blueprints.EksPodIdentityAgentAddOn(), - new blueprints.KubeRayAddOn() + new blueprints.KubeRayAddOn(), new blueprints.NeuronPluginAddOn() ]; From bf54ca3a8dabcda3a0d98c3089707eebfd5e61e5 Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Wed, 28 Feb 2024 07:40:06 +0000 Subject: [PATCH 11/12] moved addon position for testing --- examples/blueprint-construct/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/blueprint-construct/index.ts b/examples/blueprint-construct/index.ts index b30480119..411866b10 100644 --- a/examples/blueprint-construct/index.ts +++ b/examples/blueprint-construct/index.ts @@ -55,6 +55,7 @@ export default class BlueprintConstruct { }); const addOns: Array = [ + new blueprints.KubeRayAddOn(), new blueprints.addons.AwsLoadBalancerControllerAddOn(), new blueprints.addons.AppMeshAddOn(), new blueprints.addons.CertManagerAddOn(), @@ -228,7 +229,6 @@ export default class BlueprintConstruct { }), new blueprints.ExternalsSecretsAddOn(), new blueprints.EksPodIdentityAgentAddOn(), - new blueprints.KubeRayAddOn(), new blueprints.NeuronPluginAddOn() ]; From 0f9303dd50078eeceefd49a3a239a8ea22b4d1fa Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Wed, 28 Feb 2024 08:03:17 +0000 Subject: [PATCH 12/12] fixing kubecost urls --- docs/addons/kubecost.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/addons/kubecost.md b/docs/addons/kubecost.md index d0cc71043..81bee5f7a 100644 --- a/docs/addons/kubecost.md +++ b/docs/addons/kubecost.md @@ -49,7 +49,7 @@ Custom values to pass to the chart. Config options: https://github.com/kubecost/ #### `customPrometheus: string` (optional) Kubecost comes bundled with a Prometheus installation. However, if you wish to integrate with an external Prometheus deployment, provide your local Prometheus service address with this format `http://..svc`. -Note: integrating with an existing Prometheus is only officially supported under Kubecost paid plans and requires some extra configurations on your Prometheus: https://docs.kubecost.com/install-and-configure/install/custom-prom +Note: integrating with an existing Prometheus is only officially supported under Kubecost paid plans and requires some extra configurations on your Prometheus: https://docs.kubecost.com/install-and-configure/install #### `installPrometheusNodeExporter: boolean` (optional) @@ -63,7 +63,7 @@ Additional options for customers who may need to supply their own private Helm r ## Support -If you have any questions about Kubecost, get in touch with the team [on Slack](https://docs.kubecost.com/kubecost-cloud/receiving-kubecost-cloud-support). +If you have any questions about Kubecost, get in touch with the team [on Slack](https://docs.kubecost.com/troubleshooting/creating-a-support-ticket). ## License