1. Deploy the knative-serving-crds helm chart on Linode Kubernetes Engine


    To deploy the knative-serving-crds Helm chart on Linode Kubernetes Engine using Pulumi, we'll use the kubernetes.helm.v3.Chart resource from the Pulumi Kubernetes provider. This resource allows us to install Helm charts into a Kubernetes cluster.

    The kubernetes.helm.v3.Chart resource requires a few key properties to be set:

    • chart: The name of the chart we want to deploy, in this case, knative-serving-crds.
    • version: The version of the Helm chart to deploy. If not specified, the latest version will be deployed.
    • fetchOpts: An optional property that specifies the Helm chart repository containing the chart we want to deploy. We will need to specify this if the chart isn't in the stable repository.

    First, you'll need to set up your Linode Kubernetes cluster and have kubectl configured to communicate with it. Make sure your Kubernetes context is set to your Linode cluster. Pulumi will use this context to deploy resources to your cluster.

    Below is a Pulumi TypeScript program that will deploy the knative-serving-crds Helm chart to your Linode Kubernetes Engine cluster. It's important to replace the repo value with the URL of the Helm repository that contains the knative-serving-crds chart, if it's different from the example provided. You'll also want to ensure the namespace is set to the Kubernetes namespace into which you'd like to deploy the chart.

    import * as k8s from "@pulumi/kubernetes"; // Create a Helm Chart resource for the knative-serving-crds chart. const knativeServingCrdsChart = new k8s.helm.v3.Chart("knative-serving-crds", { // Replace with the correct chart repository URL and name. // You can usually find these in the documentation for the chart you're deploying. repo: "knative", chart: "knative-serving-crds", // Specify the version of the chart you wish to deploy. // If you omit this, the latest version will be used. version: "<chart-version>", // Additional configuration values for the chart can be passed in as key-value pairs. values: { // For example, if the chart requires certain values to be set, // you can set them here: // someSetting: "some-value", }, // Specify the namespace where this chart will be installed. // You can create a namespace resource with Pulumi or use an existing one. namespace: "knative-serving", }, { // Optional: specify providers if you want to use a specific Kubernetes context. // This is useful when dealing with multiple clusters. // providers: { kubernetes: myKubernetesProvider }, }); // Export the base URL for the service, this may be useful if the chart exposes any endpoints. export const knativeCrdsBaseUrl = knativeServingCrdsChart.getResourceProperty( "v1/Service", "knative-serving", "status" ).apply(status => status.loadBalancer.ingress[0].ip || status.loadBalancer.ingress[0].hostname);

    Before you run the Pulumi program above, make sure to install the Pulumi CLI and log in to your Pulumi account. After that, you can execute the following commands in the terminal:

    # Create a new Pulumi project directory mkdir linode-knative-crds && cd linode-knative-crds # Generate a new Pulumi project for TypeScript pulumi new kubernetes-typescript # Replace the contents of index.ts with the provided Pulumi program # Run pulumi up to preview and deploy the changes pulumi up

    This will initiate the deployment process. Pulumi will provide a preview of the actions that will be performed and ask for your confirmation before proceeding with the deployment. Once you confirm, the knative-serving-crds chart will be installed on your Linode Kubernetes Engine cluster.

    The final export statement at the end of the Pulumi program allows you to access the base URL for the service if it is exposed by the Helm chart. You can use pulumi stack output knativeCrdsBaseUrl to retrieve the value after the deployment is complete.