Skip to content

Commit

Permalink
Love-308: Complete EKS blueprint (#4)
Browse files Browse the repository at this point in the history
Merge EKS complete blueprint
  • Loading branch information
eltonkevani authored Nov 21, 2018
1 parent 4f340b9 commit 8e8fc0c
Show file tree
Hide file tree
Showing 58 changed files with 1,363 additions and 4,075 deletions.
43 changes: 11 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,15 @@
# use glob syntax.
syntax: glob
.gradle/
secrets.xlvals
kubernetes/build
kubernetes/.gradle

# Build output
#src/downloads/
build/
out/
target/
bin/
test-output/
.cache
# Maven
pom.xml

# Eclipse
.metadata/
.settings/
.classpath
.project
.pydevproject
.scala_dependencies

# IntelliJ
######################
# Intellij
######################
.idea/
*.iml
*.ipr
*.iws
*.log
s101plugin.state

# Mac
.DS_Store

# Cloud Provisioning
scenarios/cloud/src/runtime/keys/*
*.ipr
*.ids
*.orig
classes/
out/
2 changes: 2 additions & 0 deletions .xebialabs/wrapper.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CLI_BASE_URL="https://s3.amazonaws.com/xl-cli/bin"
CLI_VERSION="8.5.0-alpha.20"
43 changes: 13 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,21 @@
# A microservice e-commerce application demo
## e-commerce microservice application on AWS EKS

There is a version of this app with Consul as registry instead of JHipster Registry in the [consul branch](https://github.com/xebialabs/e-commerce-microservice/tree/consul)
The blueprint deploys an e-commerce microservice created using JHipster to AWS EKS.
XL deploy does the provisioning and deployment, while XL release orchestrates everything.

The stack is based on JHipster microservice architecture. Below are the componenets
### Prerequisites.

![Architecture][arch-image]
1. Git clone [https://github.com/xebialabs/e-commerce-microservice/tree/blueprint-demo](https://github.com/xebialabs/e-commerce-microservice/tree/blueprint-demo)
2. Generate the blueprint with `xl blueprint -t aws/microservice-ecommerce`

## Store app:

This is the Gateway to the mircoservices. Refer [this](https://github.com/xebialabs/e-commerce-microservice/store/README.md)
To deploy this blueprint with XL Platform follow the below steps

## Invoice app:
1. Move the `kubernetes` folder from the root directory into the xebialabs folder created by blueprint
2. Apply the generated yaml configurations

This is one of the mircoservices. Refer [this](https://github.com/xebialabs/e-commerce-microservice/invoice/README.md)
```
xl apply -f xebialabs.yaml
```
## Notification app:

This is one of the mircoservices. Refer [this](https://github.com/xebialabs/e-commerce-microservice/notification/README.md)


## Docker compose files:

The complete docker compose setup for the stack. Refer [this](https://github.com/xebialabs/e-commerce-microservice/docker-compose/README-DOCKER-COMPOSE.md)

## Kubernetes files:

The complete Kubernetes setup for the stack. Refer [this](https://github.com/xebialabs/e-commerce-microservice/xl-platform/kubernetes/README.md)

## Xl Platform files:

The complete XL-Platform setup for the stack. Refer [this](https://github.com/xebialabs/e-commerce-microservice/xl-platform/)

## XLD files
XLD as-code yaml files that import the whole setup into an XLD instance. Mircorservices have dependencies on each other. Deploying store service will deploy also all other services.


[arch-image]: https://raw.githubusercontent.com/xebialabs/e-commerce-microservice/master/arch.png
3. Go to XL Release and look for the e-commerce-release-pipeline and start a new release from it.
Binary file added cloudformation/cfn-secret-provider.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Amazon EKS - Master for E-commerce Microservices Application'
Description: 'Amazon EKS - Master for Microservices Application'

Parameters:

VPCStack:
ProjectName:
Type: String
Default: "app"
VPCStackName:
Type: String
Description: VPC Stack Name
Default: "eks-vpc"
Expand Down Expand Up @@ -35,22 +37,22 @@ Resources:
GroupDescription: Cluster communication with worker nodes
VpcId:
Fn::ImportValue:
!Sub "${VPCStack}-VPCID"
!Sub "${VPCStackName}-VPCID"

Cluster:
Type: "AWS::EKS::Cluster"
Properties:
Name: "ecommerce-master"
Name: !Sub "${ProjectName}-master"
Version: "1.10"
RoleArn: !GetAtt ClusterRole.Arn
ResourcesVpcConfig:
SecurityGroupIds:
- !Ref ClusterControlPlaneSecurityGroup
SubnetIds:
- Fn::ImportValue:
!Sub "${VPCStack}-subnetAID"
!Sub "${VPCStackName}-subnetAID"
- Fn::ImportValue:
!Sub "${VPCStack}-subnetBID"
!Sub "${VPCStackName}-subnetBID"

Outputs:
ClusterName:
Expand Down Expand Up @@ -86,4 +88,4 @@ Outputs:
Description: ClusterControlPlaneSecurityGroup
Export:
Name:
Fn::Sub: "${AWS::StackName}-ClusterControlPlaneSecurityGroup"
Fn::Sub: "${AWS::StackName}-ClusterControlPlaneSecurityGroup"
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
AWSTemplateFormatVersion: '2010-09-09'
Description: "Amazon EKS - KeyPair and User"
Parameters:
ProjectName:
Type: String
Default: "app"
S3BucketPrefix:
Type: String
Default: 'binxio-public'
CFNCustomProviderZipFileName:
Type: String
Default: 'lambdas/cfn-secret-provider-0.12.2.zip'
Username:
Default: 'cfn-secret-provider.zip'
UserStackName:
Type: String
Default: 'eks-ecommerce'
Default: 'eks-user'

Resources:

EksUser:
Type: AWS::IAM::User
Properties:
UserName: !Sub '${Username}'
UserName: !Sub '${UserStackName}'
LambdaPolicy:
Type: AWS::IAM::Policy
DependsOn:
Expand Down Expand Up @@ -72,7 +74,7 @@ Resources:
Properties:
Description: CloudFormation Custom:Secret implementation
Code:
S3Bucket: !Sub '${S3BucketPrefix}-${AWS::Region}'
S3Bucket: !Ref 'S3BucketPrefix'
S3Key: !Ref 'CFNCustomProviderZipFileName'
FunctionName: 'binxio-cfn-secret-provider'
Handler: secrets.handler
Expand Down Expand Up @@ -106,7 +108,7 @@ Resources:

Outputs:
Username:
Value: !Sub '${Username}'
Value: !Sub '${UserStackName}'
Description: EKS Username
Export:
Name: !Sub '${AWS::StackName}-user'
Expand All @@ -116,7 +118,7 @@ Outputs:
Export:
Name: !Sub '${AWS::StackName}-user-arn'
KeyPairName:
Value: !Sub '${Username}'
Value: !Sub '${UserStackName}'
Description: KeyPair name for EKS Worker nodes
Export:
Name: !Sub '${AWS::StackName}-keypair'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Amazon EKS - VPC for E-commerce Microservices Application'
Description: 'Amazon EKS - VPC for Microservices Application'

Parameters:
ProjectName:
Type: String
Default: "app"
AvailabilityZones:
Description: 'List of Availability Zones to use for the subnets in the VPC. Note:
The logical order is preserved.'
Type: List<AWS::EC2::AvailabilityZone::Name>
Default: 'eu-west-1a, eu-west-1b'
VPCStackName:
Type: String
Description: VPC Stack Name
Default: "eks-vpc"

Resources:
InternetGateway:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Key: Name
Value: 'eks-ecommerce'
Value: !Sub "eks-${ProjectName}"
VPC:
Type: AWS::EC2::VPC
Properties:
Expand All @@ -25,7 +31,7 @@ Resources:
InstanceTenancy: default
Tags:
- Key: Name
Value: ecommerce-eks-vpc
Value: !Sub "${ProjectName}-${VPCStackName}"
AttachGateway:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
Expand All @@ -45,7 +51,7 @@ Resources:
- Ref: AvailabilityZones
Tags:
- Key: Name
Value: ecommerce-eks-vpc-a
Value: !Sub "${ProjectName}-${VPCStackName}-a"
subnetB:
Type: AWS::EC2::Subnet
Properties:
Expand All @@ -58,7 +64,7 @@ Resources:
- Ref: AvailabilityZones
Tags:
- Key: Name
Value: ecommerce-eks-vpc-b
Value: !Sub "${ProjectName}-${VPCStackName}-b"
subnetARouteTable:
Type: AWS::EC2::RouteTable
Properties:
Expand Down
Loading

0 comments on commit 8e8fc0c

Please sign in to comment.