Code Monkey home page Code Monkey logo

wordpress-eks-blueprints's Introduction

Deploying a WordPress application to Amazon Elastic Kubernetes Service (EKS)

This project creates the infrastructure and deployment pipeline to run a WordPress application on AWS.

The infrastrucutre consists of the folllowing:

  • Amazon EKS: This is created using the AWS EKS Blueprints for CDK
  • Amazon Aurora MySQL Cluster to store WordPress data
  • Amazon Elastic File System (EFS) service to store WordPress installation and configuration files

Here's the high level architecture design:

WordPress on EKS Architecture Diagram

This is a scalable and resilient design by following AWS good practices such as:

  • AWS VPC with multiple Availability Zones (AZs)
  • EKS Cluster with a minimum of two nodes placed across different AZs
  • Amazon MySQL Aurora cluster with two nodes (writer/reader) deployed across multiple AZs
  • Amazon EFS file system. A regional storage classes that store file system data and metadata redundantly across multiple geographically separated Availability Zones within an AWS Region
  • FluxCD to continuously monitor GitHub an and synchronizing the Kubernetes cluster using GitHub as it source of truth.

To deploy the application:

  1. Clone this repository
  2. Make the deploy script executable: chmod 750 deploy.sh
  3. Execute the script ./deploy.sh
  4. Once the deployment completes, create a directory in the root of the project called secrets and create two files inside:
  • kustomization.yaml
  • namespace.yaml

Add the following to the namespace.yaml:

apiVersion: v1
kind: Namespace
metadata:
  name: wordpress
  labels:
    name: wordpress

Add the following to the kustomization.yaml:

secretGenerator:
- name: mysql-pass
  namespace: wordpress
  options:
    disableNameSuffixHash: true
  literals:
  - dbpassword=
  - dbhost=
  - dbuser=
  - dbase=

resources:
  - namespace.yaml
  1. Make sure to add the credetials for the created database found in AWS Secrets
  2. Set your kubernetes context by updating kubeconfig]. The exact command can be found on the CloudFormation Output tab.
  3. Apply the secrets to the EKS Cluster by running kubectl apply -k /secrets/
  4. Next step is to install, configure and bootstrap FluxCD following the instructions here. This is an example of how to bootstrap flux:
flux bootstrap github \
  --owner=$GITHUB_USER \
  --repository=$REPO_NAME \
  --branch=main \
  --path=/k8s/prod \
  --personal=true

Enjoy your resilient, scalable WordPress installation that is continuously deployed to your Kubernetes cluster.

wordpress-eks-blueprints's People

Contributors

jmroche avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.