Deploy the seldon-core-controller helm chart on Kubernetes
TypeScriptTo deploy the
seldon-core-controller
Helm chart on Kubernetes using Pulumi, we will leverage Pulumi's Kubernetes provider. This provider allows us to work with Kubernetes resources in a declarative manner using familiar programming languages, such as TypeScript.The first step is to ensure that we have a Kubernetes cluster running and that
kubectl
is configured to communicate with it, as Pulumi will use the same configuration. Then, we will use theChart
resource from the@pulumi/kubernetes/helm/v3
package to deploy theseldon-core-controller
chart.Below is a Pulumi program in TypeScript that demonstrates how to deploy the
seldon-core-controller
Helm chart. Please ensure that you have Pulumi installed and configured to use your Kubernetes cluster.We will perform the following steps in the program:
- Import the necessary Pulumi and Kubernetes classes.
- Create a new Helm Chart resource specifying the
seldon-core-controller
chart from its repository.
Here's the complete program:
import * as k8s from "@pulumi/kubernetes"; // Name of the Helm chart we want to deploy. const chartName = "seldon-core-operator"; // Repository which contains the chart. const chartRepo = "https://storage.googleapis.com/seldon-charts"; // Namespace where the chart should be deployed. // Make sure this namespace exists in your Kubernetes cluster or create one. const namespace = "seldon-system"; // Version of the chart you want to deploy. const chartVersion = "1.13.1"; // Please use a specific version that fits your needs. // Initialize a Helm chart. const seldonCoreChart = new k8s.helm.v3.Chart(chartName, { chart: chartName, version: chartVersion, fetchOpts: { repo: chartRepo }, namespace: namespace, }, { // These options are used to deploy Helm charts using Pulumi. // You may specify additional options here, such as `values` to override default chart values. }); // Export the name of the namespace where 'seldon-core-controller' is installed. export const seldonCoreNamespace = namespace;
In the above code:
- We import the Kubernetes package from Pulumi which will allow us to create and manage Kubernetes resources.
- We define constants for the chart name, chart repository URL, namespace, and version. You must ensure that the namespace
seldon-system
exists on your cluster; if it doesn’t, you can create it usingkubectl create namespace seldon-system
. - We instantiate a
Chart
resource, which corresponds to a Helm chart deployment. By providing the chart name, version, and repository URL, Pulumi can fetch and install the chart into the specified namespace. - The
export
statement is used to output the namespace, which can be helpful for querying or managing the deployment after it has been created.
To run this Pulumi program:
- Save the code to a file named
index.ts
in a new Pulumi project directory. - Run
pulumi up
from the command line within the directory. - Pulumi CLI will show you a preview of the Kubernetes resources that will be created.
- If everything looks good, you can proceed with the deployment by confirming the action in the CLI.
This will initiate the deployment of the
seldon-core-controller
Helm chart to your Kubernetes cluster. When the process completes, you should see that the resources have been created successfully, and you can usekubectl
to confirm that theseldon-core-controller
has been deployed to theseldon-system
namespace.