Deploy the inferenceservices-controller helm chart on Kubernetes
TypeScriptTo deploy the
inferenceservices-controller
Helm chart on Kubernetes using Pulumi, you will need to use theChart
resource from the@pulumi/kubernetes
package. TheChart
resource allows you to deploy a Helm chart to a Kubernetes cluster in a declarative way using Pulumi.Here's what we'll do:
- We will initialize a new Pulumi project using TypeScript.
- We will add the necessary Kubernetes and Helm configurations.
- We will create a
Chart
resource to deploy theinferenceservices-controller
chart.
Below is a complete program that deploys the
inferenceservices-controller
Helm chart. Ensure you havekubectl
configured to the right Kubernetes cluster, where you want to deploy this chart.import * as k8s from '@pulumi/kubernetes'; // Deploy the "inferenceservices-controller" Helm chart using the Chart resource. const inferenceservicesController = new k8s.helm.v3.Chart("inferenceservices-controller", { // Replace the '<REPO-URL>' placeholder with the actual Helm chart repository URL. repo: "<REPO-URL>", chart: "inferenceservices-controller", version: "<CHART-VERSION>", // Specify the version of the chart you wish to deploy. // If you have custom values you'd like to override in the chart, you can include them here. // For example, if you need to set specific namespaces or replica counts. // Another common use case is if the helm chart requires certain set values to run that cannot be the default. values: { // Example of overriding values (these are not actual values for the chart) // namespace: "my-namespace", // replicaCount: 2, }, }); // Export any relevant resources. export const serviceName = inferenceservicesController.getResourceProperty("v1/Service", "my-service", "metadata.name");
Here’s what each part of the code is doing:
-
We import the
@pulumi/kubernetes
package to interact with Kubernetes resources. -
We create a new instance of
k8s.helm.v3.Chart
calledinferenceservicesController
. Replace<REPO-URL>
with the repository URL where theinferenceservices-controller
chart is hosted, and<CHART-VERSION>
with the chart version you want to deploy. -
The
values
property inside theChart
is a placeholder for any configurations you want to override in your Helm chart (inferenceservices-controller
has its own default values). You will need to refer to the specific Helm chart documentation for what values can be overridden. -
The
serviceName
export is an example of how you can export resource properties from the deployed Helm chart. You would change the arguments togetResourceProperty
depending on which exact resource and property you want to export from the chart.
This Pulumi program assumes that you have already configured the access to your Kubernetes cluster (through your
kubeconfig
file or any cloud provider-specific authentication mechanism).Remember to replace placeholder values as necessary to reflect your specific configuration.
To run this program:
- Save the code in a file with a
.ts
extension, for example,deploy-inferenceservices-controller.ts
. - Run
pulumi up
in the directory where the file is saved. Pulumi CLI will execute the program and apply the changes to your Kubernetes cluster.
Finally, to interact with and maintain the deployment, you will use the Pulumi CLI and the
pulumi up
,pulumi preview
, andpulumi destroy
commands, among others, to create, preview, and tear down resources, respectively.