-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CDK BlueGreen Deployment Codepipeline Pattern #181
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a doc page under docs/patterns with the description of the pattern and instructions to launch. It seems I won't be able to validate just yet because of the hosted zone (unless we create it in the partner account).
errorHandler(app, "Blue Green cluster pattern is not setup. It may be due to missing secrets: ", error); | ||
}); | ||
|
||
// import { configureApp, errorHandler } from '../lib/common/construct-utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove commented code. applies elsewhere.
envName: string; | ||
} | ||
|
||
class DnsStack extends cdk.Stack { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comments on top, explain the purpose for this stack
import * as blueprints from '@aws-quickstart/eks-blueprints'; | ||
|
||
|
||
export default class MultiClusterBuilderConstruct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what makes it multi-cluster? Seems like it create a common blueprint. General approach on using this is using a function for example. Here is code example, mostly pseudo:
const clusterBlueprint = buildCommonBlueprint();
const blueClusterBlueprint = clusterBlueprint.clone(); // if you plan to customize, like adding additional addons, change providers
const greenClusterBlueprint = blueClusterBlueprint.clone(); // if you plan to customize
You can even inline the function. Having a separate class maybe an overkill - does not buy us much. Maybe keep the file, like common-builder.ts and put one builder function in it.
stackBuilder : blueprintBlue.clone(region), | ||
// stageProps: { | ||
// post: [ | ||
// new ShellStep("Validate App", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why validation is commented out? did it work?
// } | ||
}) | ||
|
||
const blueprintGreen = blueprintBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why version and cluster provider are here and not in the blueprint?
const stagesEks : blueprints.StackStage[] = []; | ||
|
||
const blueprintBuilder = new MultiClusterBuilderConstruct().create(scope, accountID, region); | ||
const blueprintBlue = blueprintBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why version and cluster provider are here and not in the common blueprint?
}) | ||
const stagesDns : blueprints.StackStage[] = []; | ||
|
||
const prodEnv = clusterBNameSuffix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's say switch worked and moved DNS target to green. Now I have blue/green, Route53 points to green. What happens on the next iteration, when customer upgrades clusters to 1.31 and needs to engage blue/green again. Do you change the name of prodEnv?
Issue #, if available:
Description of changes: Created a new pattern that supports 2 versions of EKS clusters i.e. blue and green simultaneously running. The switching from Blue to Green and vice-versa is done by updating the DNS record which requires manual approval in codepipeline.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.