Deploy the circleci-runner helm chart on Oracle Kubernetes Engine (OKE)
TypeScriptTo deploy the
circleci-runner
Helm chart on Oracle Kubernetes Engine (OKE), we will leverage the Pulumi Kubernetes provider. You'll need a running instance of Oracle Kubernetes Engine, which you can set up through the OCI console or using Pulumi to create one. For simplicity, I'm assuming you already have a running OKE cluster andkubeconfig
file with the necessary access credentials.We'll perform the following steps in your Pulumi program:
- Create a Pulumi Kubernetes Provider. This requires
kubeconfig
credentials for accessing your OKE cluster. The Pulumi program assumes that this configuration is stored locally or in the environment. - Deploy the Helm chart using Pulumi's Helm Release resource. We'll use the
circleci-runner
chart from its repository, which you'll need to specify.
Below is the Pulumi TypeScript program that accomplishes this:
import * as k8s from "@pulumi/kubernetes"; // Create a Kubernetes provider that uses your existing kubeconfig const k8sProvider = new k8s.Provider("oke-k8s", { kubeconfig: "<Your OKE cluster kubeconfig here>", }); // Deploy the circleci-runner Helm chart to the OKE cluster const circleCiRunnerChart = new k8s.helm.v3.Chart("circleci-runner", { // Replace with the actual repository and version if necessary repo: "circleci-runner-repo", chart: "circleci-runner", version: "1.0.0", // The version number might vary, ensure to use the correct one // If there are any customizations or configurations that the chart requires or you wish to override, // specify them under the `values` property. values: { // Placeholder for any values you wish to customize, e.g., // image: { // repository: "circleci/runner", // tag: "latest" // }, // runnerToken: "<Your CircleCI Runner Token>", // other configs... }, }, { provider: k8sProvider }); // Optional: Export the name of the chart as a stack output export const chartName = circleCiRunnerChart.metadata.name;
In this code:
<Your OKE cluster kubeconfig here>
needs to be replaced with the actual path to yourkubeconfig
file or the content itself.- The
repo
field must be the name of the repository where thecircleci-runner
Helm chart is located. You need to replace"circleci-runner-repo"
with the correct repository name. - The
chart
field is the name of the Helm chart to deploy; in this case, it's"circleci-runner"
. - The
version
specifies the Helm chart version you want to deploy. Ensure you're using the version that matches your requirements. Replace"1.0.0"
with the correct version number. - The
values
property allows you to override default values in the chart. Customize your runner configuration here according to the chart's documentation. This would typically include setting the runner token and any image configuration necessary.
To run the program:
- Set up Pulumi.
- Create a new directory for your project and initialize a Pulumi project within it.
- Replace the content of
index.ts
in your Pulumi project with the above program. - Replace placeholders with actual values.
- Execute
pulumi up
in your terminal within the project directory to start the deployment.
Remember to check the Helm chart documentation for the necessary values to customize and provide the correct configuration for the
circleci-runner
Helm chart.- Create a Pulumi Kubernetes Provider. This requires