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:

Key Description Default value
cluster:flavor Default size for cluster nodes d2-4
cluster:name Cluster name pulumi-cluster
cluster:nodepool Nodepool name pulumi-pool
cluster:min_nodes Minimum number of nodes in cluster 1
cluster:max_nodes Maximum number of nodes in cluster 2
cluster:region Datacenter in which cluster will be deployed GRA9
ovh:endpoint Endpoint for OVH APIs ovh-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 platform for humans and agents.