Deploy the symfony-app helm chart on AWS EKS
TypeScriptTo deploy the
symfony-app
Helm chart on AWS EKS, we will use Pulumi to create the necessary resources in a series of steps. This includes setting up an Amazon EKS cluster, configuring the Kubernetes provider to deploy resources to that cluster, and then deploying thesymfony-app
Helm chart.Here is a step-by-step guide including a Pulumi program in TypeScript to achieve your goal:
Step 1: Provision an EKS Cluster
First, we need to provision an EKS cluster. For this, we will use the
aws.eks.Cluster
resource which simplifies creating and managing an EKS Kubernetes cluster (aws.eks.Cluster documentation).Step 2: Configure Kubernetes Provider
Once we have an EKS Cluster, we need to configure the Kubernetes provider to interact with the cluster. The
k8s.Provider
resource is responsible for this, and we need to supply it with the kubeconfig information from the created EKS cluster.Step 3: Deploy Helm Chart
Finally, we will deploy the
symfony-app
using the Pulumi Kubernetes (@pulumi/kubernetes
) Helm chart resource calledChart
. To deploy a custom Helm chart, we will set therepo
property to the location of your Helm chart repository and thechart
property to"symfony-app"
.Below is the complete Pulumi program that accomplishes these tasks:
import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; import * as eks from "@pulumi/eks"; import * as k8s from "@pulumi/kubernetes"; // Create an EKS cluster with the default configuration. const cluster = new eks.Cluster("my-cluster"); // Export the clusters' kubeconfig. export const kubeconfig = cluster.kubeconfig; // Create a Kubernetes Provider referencing the EKS cluster's kubeconfig. const provider = new k8s.Provider("k8s-provider", { kubeconfig: cluster.kubeconfig, }); // Deploy the `symfony-app` Helm chart to the EKS cluster. const symfonyAppChart = new k8s.helm.v3.Chart("symfony-app-chart", { chart: "symfony-app", // If your helm chart is in a specific repository, configure the appropriate 'repo' option here. // repo: "https://charts.mycompany.com/", values: { service: { type: "LoadBalancer", }, // Define other custom values for your Helm chart here. }, }, { provider }); // Export the endpoint to access the `symfony-app` export const symfonyAppEndpoint = symfonyAppChart.getResourceProperty("v1/Service", "symfony-app", "status").apply(status => status.loadBalancer.ingress[0].hostname || status.loadBalancer.ingress[0].ip);
This program will perform the following actions:
- It initializes an EKS cluster and exports the generated kubeconfig, which will be needed to interact with the cluster.
- It creates a new Kubernetes provider instance configured to use the kubeconfig from the created EKS cluster.
- It deploys the
symfony-app
Helm chart to the EKS cluster with some default values. You should change these values according to your Helm chart's requirements.
Make sure to replace
service.type
in the Helm chart values with the appropriate type for your application;LoadBalancer
is used for demonstration purposes, exposing the application to the internet.After deploying this program using Pulumi (
pulumi up
), you'll be provided with thekubeconfig
output andsymfonyAppEndpoint
, which you can use to interact with your EKS cluster and access your Symfony application respectively.For more detailed control over the cluster settings, you can explore additional configuration options for the
aws.eks.Cluster
resource, such as different VPC configurations, node groups, IAM roles, and others.