Skip to main content

Search the Dev Center

Search tutorials, templates, examples, and more.

Managed Kubernetes on OVH

A Go program to deploy a Kubernetes cluster on OVHcloud

This example lives in the pulumi/examples repository. Check out just this directory to use it:

Get started with this example
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set ovhcloud-go-kubernetes
cd pulumi-examples/ovhcloud-go-kubernetes

Deploys a managed Kubernetes cluster and node pool on OVHcloud.

Prerequisites#

  1. Install Pulumi

  2. Configure Kubernetes

  3. Install Go

  4. Set up the environment variables used to authenticate against the OVH APIs:

    Terminal window
    # Your OVH project ID
    export OVH_SERVICE_NAME=xxx
    # Your application information (can be created on https://api.ovh.com/createToken)
    export OVH_APPLICATION_SECRET=xxx
    export OVH_APPLICATION_KEY=xxx
    export OVH_CONSUMER_KEY=xxx

Configuration#

You can configure your setup in Pulumi.yaml:

KeyDescriptionDefault value
cluster:flavorDefault size for cluster nodesd2-4
cluster:nameCluster namepulumi-cluster
cluster:nodepoolNodepool namepulumi-pool
cluster:min_nodesMinimum number of nodes in cluster1
cluster:max_nodesMaximum number of nodes in cluster2
cluster:regionDatacenter in which cluster will be deployedGRA9
ovh:endpointEndpoint for OVH APIsovh-eu

Deploying the example#

  1. Install dependencies:

    Terminal window
    go mod download
  2. Create a new stack:

    Terminal window
    pulumi stack init
  3. Run pulumi up to preview and deploy changes:

    Terminal window
    pulumi up
    Updating (gitpod)
    Type Name Status
    + pulumi:pulumi:Stack hashnode-article-gitpod created (405s)
    + ├─ ovh:CloudProject:Kube pulumi-cluster created (401s)
    + └─ ovh:CloudProject:KubeNodePool pulumi-pool created (222s)
    Outputs:
    kubeconfig: [secret]
    Resources:
    + 3 created
    Duration: 10m30s
  4. Retrieve the kubeconfig:

    Terminal window
    pulumi stack output kubeconfig --show-secrets > kubeconfig

Cleaning up#

Once you’re finished experimenting, destroy your stack and remove it to avoid incurring any additional cost:

Terminal window
pulumi destroy
pulumi stack rm

Related

The infrastructure as code platform for any cloud.