Deploy the atlassian-confluence helm chart on Kubernetes
TypeScriptTo deploy the Atlassian Confluence Helm chart on a Kubernetes cluster using Pulumi, you can use the
helm.sh/v3.Chart
resource from the@pulumi/kubernetes
package. This resource allows you to specify a Helm chart, its values, and other configuration options to deploy an application onto your Kubernetes cluster.Firstly, ensure you have Pulumi and the Kubernetes provider set up on your machine. You will also need access to a Kubernetes cluster and the
kubectl
command-line tool configured to communicate with your cluster.Below, I will demonstrate a Pulumi TypeScript program that accomplishes the deployment of the Atlassian Confluence chart. Before running the code, you will need to replace the placeholder values with actual values relevant to your setup, such as the Kubernetes namespace you want to use.
import * as kubernetes from "@pulumi/kubernetes"; const namespace = "default"; // Use the appropriate namespace where you want to deploy Confluence const confluenceChart = "atlassian-confluence"; // Deploy the Atlassian Confluence Helm chart into your Kubernetes cluster const confluence = new kubernetes.helm.v3.Chart(confluenceChart, { chart: confluenceChart, version: "0.1.0", // Replace with a specific chart version namespace: namespace, fetchOpts: { repo: "https://atlassian.github.io/data-center-helm-charts", // Atlassian's official Helm chart repository }, // Define any custom values you want to apply to the chart. // These values will override the defaults provided by the chart. values: { // Specify custom values here, for example // service: { // type: "ClusterIP", // }, }, }); export const chartName = confluenceChart; export const confluenceServiceName = confluence.getResourceProperty("v1/Service", `${confluenceChart}-confluence`, "metadata").apply(m => m.name);
In the code above:
- We import the Pulumi Kubernetes package so that we can interact with Kubernetes resources.
- We create a new
Chart
resource, specifying the name of the Helm chart we want to deploy, in this case,atlassian-confluence
. - We specify the repository where the Helm chart is located, which is Atlassian's official Helm chart repo.
- We set
values
to customize the Helm chart deployment, which you can modify as needed. Thevalues
object is equivalent to the custom values you would typically define in avalues.yaml
file. - We then export
chartName
and the name of the created Kubernetes Service for Confluence, which can be used to interact with the Confluence instance.
To run this Pulumi program, you will save it to a file, for example,
index.ts
. Then, you'll navigate to the directory containing the file in your terminal and runpulumi up
. This will start the Pulumi program, which will perform the deployment.Remember to install the necessary NPM packages before running the Pulumi program:
npm install @pulumi/kubernetes
If you need to find out more about the configuration options available for the Atlassian Confluence Helm chart, you can typically consult the chart's documentation or use
helm show values atlassian/atlassian-confluence
. This will give you a detailed list of all the configurable parameters and their default values, which you can then override in thevalues
section of your Pulumi program.