How Do I Deploy Argo CD and Elasticsearch on Kubernetes?
Introduction
This guide provides a comprehensive walkthrough for deploying Argo CD and Elasticsearch on a Kubernetes cluster using Pulumi. Argo CD is a declarative, GitOps continuous delivery tool designed for Kubernetes, while Elasticsearch is a powerful distributed, RESTful search and analytics engine. Our goal is to set up the necessary Kubernetes resources to deploy both applications efficiently.
Deployment Process
Create Namespaces:
- First, we need to create separate namespaces for Argo CD and Elasticsearch. This ensures that the resources for each application are organized and managed within their respective environments.
Deploy Argo CD:
- Utilize the official Helm chart to deploy Argo CD. Specify the version and repository to ensure you are using the correct configuration. Deploy it within the previously created namespace for Argo CD.
Deploy Elasticsearch:
- Similarly, deploy Elasticsearch using its official Helm chart. Ensure it is installed in its dedicated namespace. This setup helps in maintaining a clear separation of concerns between the two applications.
Export Service URLs:
- After deployment, export the URLs for both the Argo CD server and the Elasticsearch service. These URLs are crucial for accessing and managing the applications externally.
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
// Create a namespace for Argo CD
const argoNamespace = new k8s.core.v1.Namespace("argo-namespace", {
metadata: { name: "argo" },
});
// Deploy Argo CD using the official Helm chart
const argoCd = new k8s.helm.v3.Chart("argo-cd", {
chart: "argo-cd",
version: "4.5.2",
fetchOpts: {
repo: "https://argoproj.github.io/argo-helm",
},
namespace: argoNamespace.metadata.name,
});
// Create a namespace for Elasticsearch
const esNamespace = new k8s.core.v1.Namespace("elasticsearch-namespace", {
metadata: { name: "elasticsearch" },
});
// Deploy Elasticsearch using the official Helm chart
const elasticsearch = new k8s.helm.v3.Chart("elasticsearch", {
chart: "elasticsearch",
version: "7.10.1",
fetchOpts: {
repo: "https://helm.elastic.co",
},
namespace: esNamespace.metadata.name,
});
// Export the Argo CD server URL
export const argoCdUrl = argoCd.getResource("v1/Service", "argo/argo-cd-server").status.loadBalancer.ingress[0].hostname;
// Export the Elasticsearch URL
export const elasticsearchUrl = elasticsearch.getResource("v1/Service", "elasticsearch/elasticsearch-master").status.loadBalancer.ingress[0].hostname;
Key Points
- We created namespaces specifically for Argo CD and Elasticsearch to maintain resource organization.
- Deployment of Argo CD and Elasticsearch was accomplished using their official Helm charts.
- URLs for accessing the Argo CD server and Elasticsearch service were exported for external access.
Summary
In this guide, we successfully deployed Argo CD and Elasticsearch on a Kubernetes cluster using Pulumi. We established distinct namespaces, utilized Helm charts for deployment, and exported service URLs for both applications. This setup not only ensures efficient resource management but also facilitates easy access and scalability of the applications within the Kubernetes environment.
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.