Deploy on AWS
This guide uses AWS Aurora as a database, eksctl
to deploy the application, and AWS Load Balancer Controller and External DNS to realize Ingress resources.
#
Production warningPlease take note that these instructions are intended as a guide. Your needs will dictate how to deploy papercups into your environment. Some considerations which must be taken into account when deploying to production include:
- Securing the Database's credentials, encryption at rest and in transit, backups and disaster planning, etc..
- We are reusing the same subnets for application to database communication as we are for ALB to application communication. You may wish to separate these subnets.
- We are enabling database network connectivity to the entire node pool. You may wish to use amazon-vpc-cni-k8s to attach security groups to the pods.
- You may wish to enable SSL support.
Your pre-existing infrastructure will dictate what steps you must perform or skip.
This guide is not meant to dictate architecture, but merely represents a possible path. You might choose to use Aurora, as described here, or an RDS instance, or the Bitnami Postgresql chart. You may choose to use EKS, or ECS, with eksctl
or with kops
. There are many variables available to chooose from, and this approach should be used as the start of a conversation. Please find us at slack to chat!
#
PrerequisitesThe versions of tools used to produce this guide are:
If you encounter any issues, please check the version of tool you have installed.
- For more information, see
Setup your environment variables with an AWS access key and secret.
#
Step By Step InstallationThis guide presumes a clean AWS account with no resources.
#
Database Setup (Aurora)- Create Security Group for Aurora.
- Create an RDS instance for your cluster
#
EKS Setup- Create the cluster with the subnets from the "default" db subnet group.
- Enable the Node Group security group to communicate with the Aurora cluster.
#
Setup the AWS Load Balancer ControllerTag the subnets as usable by the ELB.
Download AWSLoadBalancerControllerIAMPolicy
Create AWSLoadBalancerControllerIAMPolicy
Create IAM Open ID Connect provider
Install the AWS Load Balancer Controller
Check to see if the controller is installed.
If Step 6 had a result, perform step 5 from https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html
Install the TargetGroupBinding CRD
Add the EKS-charts repository
Use Helm to install the AWS Load Balancer Controller to the kube-system namespace
Verify the controller is installed
#
Setup the External DNS ControllerIf you choose to skip this section, after deploying Papercups and the ingress controller is created, add a CNAME or ALIAS record for
papercups.example.com
that points to the created load balancer fromkubectl --namespace papercups describe ing papercups
*
Create the IAM policy.
You may wish to fine tune this policy document to only permit explicit Hosted Zone IDs
Create the service account.
If you need to create the hosted zone, do so now. Take note of the output of the command. Please read this guide if you are unfamiliar with DNS management.
In case you forget, this is how you recall the HostedZoneID and Name Servers for the zone.
Deploy the external-dns-controller
#
Deploying Papercups- Deploy the application using helm
- Follow up to check on the status of the deployment.
- Follow up to check on the status of the ingress controller
#
Deleting the deployment- Delete the EKS cluster
- Delete the RDS instance
- Empty the DNS Hosted Zone
- Delete the DNS Hosted Zone