How do I deploy the Vaultwarden Helm chart on DigitalOcean Kubernetes?
In this guide, you will learn how to deploy the Vaultwarden Helm chart on a DigitalOcean Kubernetes cluster using Pulumi. We will create a Kubernetes cluster on DigitalOcean, and then deploy the Vaultwarden application using a Helm chart.
Steps:
- Create a Kubernetes cluster on DigitalOcean.
- Deploy the Vaultwarden Helm chart to the Kubernetes cluster.
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
import * as k8s from "@pulumi/kubernetes";
// Create a DigitalOcean Kubernetes cluster
const cluster = new digitalocean.KubernetesCluster("do-cluster", {
region: digitalocean.Region.NYC3,
version: "1.21.5-do.0",
nodePool: {
name: "default",
size: "s-2vcpu-4gb",
nodeCount: 2,
},
});
// Export the kubeconfig to use with kubectl
export const kubeconfig = cluster.kubeConfigs[0].rawConfig;
// Create a Kubernetes provider using the kubeconfig
const provider = new k8s.Provider("do-k8s", {
kubeconfig: cluster.kubeConfigs[0].rawConfig,
});
// Deploy the Vaultwarden Helm chart
const vaultwarden = new k8s.helm.v3.Chart("vaultwarden", {
chart: "vaultwarden",
version: "3.0.0",
fetchOpts: {
repo: "https://dani-garcia.github.io/bw_helm",
},
values: {
// Customize the values as needed
ingress: {
enabled: true,
hosts: ["vaultwarden.example.com"],
},
persistence: {
enabled: true,
size: "10Gi",
},
},
}, { provider });
export const vaultwardenUrl = vaultwarden.getResource("v1/Service", "vaultwarden").status.loadBalancer.ingress[0].hostname;
Key Points:
- We created a DigitalOcean Kubernetes cluster using the
digitalocean.KubernetesCluster
resource. - We exported the
kubeconfig
to allow Pulumi to manage resources in the cluster. - We used the
kubernetes.helm.v3.Chart
resource to deploy the Vaultwarden Helm chart. - We customized the Helm chart values to enable ingress and set up persistence.
Summary
In this guide, we successfully deployed the Vaultwarden Helm chart on a DigitalOcean Kubernetes cluster using Pulumi. We created the Kubernetes cluster, configured it, and deployed Vaultwarden with customized settings.
Deploy this code
Want to deploy this code? Sign up for a free Pulumi account to deploy in a few clicks.
Sign upNew to Pulumi?
Want to deploy this code? Sign up with Pulumi to deploy in a few clicks.
Sign upThank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.