A repo for the deployment scripts used to setup a deployment pipeline for the microservices-app-example.
This repo contains the following
- A packer template file
packer.json
for creating an AMI on AWS. The Image is privisioned with Ansible and basic file uploads. - An Ansible playbook
playbook.yml
that inplements set of tasks defined in theroles
folder - A
roles
folder contains a set of subfolders each of which implements a set of setup specific tasks - A
k8s_setup.sh
script which is copied into the image and is used to create a Kuberneters cluster on AWS
To build the image ensure you have both Packer and Ansible installed. If you are new to configuration managemant, you may consider using this introductory demo I did on the subject. Follow this here article to get you up to speed.
Installing pre-requisites
Packer
brew install packer
ansible
brew install ansible
To build the image do Clone the repo
git clone https://github.com/indungu/microservices-deployment-scripts
cd microservices-deployment-scripts
**Create .env file
aws configure # fill in the prompts appropriately
cat ~/.aws/credentials > .env # create the env file from the credentials you supplied
Build the image
packer build packer.json
Once the AMI is created successfully, launch an instance with it and run the k8s_setup.sh
script as shown below.
ubuntu@instance_local_ip~$ source k8s_setup.sh
When this is done, you will have access to a jenkins instance that has: awscli, kops, kubernetes, docker, docker-compose, kubectl and nginx for reverse proxy to the Jenkins server.
Running the script will also create a cluster as set in the user defined variables
section. Be sure to edit this section with the appropriate variables.