Setup a dev -> prod pipeline
Using Plural PR-based Pipelines to automate Dev -> Staging -> Prod Promotions
Overview
We've already gone over provisioning clusters, deploying a basic cluster runtime, and setting up a microservice. You can use almost all those tools for a general deployment process if you wanted to and still maintain good velocity overall. But any robust organization is going to split their environments into at least a dev and a prod stage, and start wasting cycles on promotions between them. Plural Pipelines are meant to solve for that.
This tutorial will cover:
- Using the cluster-creator PR Automation (PRA) to setup a prod cluster.
- Using the same technique as in the Deploying a Microservice tutorial to set up an example prod service
- Setting up a
PrAutomationfor generating the promotion related GitOps codechanges needed - Setting up a
Pipelineto orchestrate our promotion process.
Setup Your Prod Cluster
Go through the Setting Up Your First Workload Cluster tutorial again to create another cluster which will serve as the prod cluster. This will involve:
- Call the
cluster-creatorPRA to generate a PR to create your cluster. Approve and merge it. - Wait for the new stack to be spawned, and approve its run.
- Wait 10-20m for EKS to provision fully and be registered in Plural.
Setup the Prod Instance of the cd-demo Service
Imitating the Setting Up a Microservice tutorial, write a new ServiceDeployment to bootstrap/cd-demo/prod.yaml:
apiVersion: deployments.plural.sh/v1alpha1
kind: ServiceDeployment
metadata:
name: cd-demo-prod
namespace: infra
spec:
namespace: cd-demo
git:
folder: helm # this is where the helm chart is located in the git repository
ref: main
repositoryRef:
kind: GitRepository
name: cd-demo
namespace: infra
helm:
values:
image:
repository: ghcr.io/pluralsh/plrl-cd-test
tag: latest # VERSION
clusterRef:
kind: Cluster
name: REPLACE_ME_WITH_PROD_CLUSTER_NAME # replace this with whatever you might have named your prod cluster
namespace: infra