This repos has the code and scripts to provision and configure a cloud infrastructure running Kubernetes and the required CI/CD components to build, deploy and host a micro service based order processing demo application.
Once monitored by ELK Monitoring, a multi-tier call flow will be available.
Footnotes:
- Currently, these setup scripts support only Amazon EKS. The plan is to then support Azure, RedHat, and Cloud Foundry PaaS platforms.
- Uses a docker registry run within the cluster
- Demo app based on example from: https://github.com/ewolff/microservice-kubernetes
- GitHub - Assumes you have a github account and have created a new github organization
- Cloud provider account. Highly recommend to sign up for personal free trial as to have full admin rights and to not cause any issues with your enterprise account. Links to free trials
The following set of tools are required by the installation scripts and interacting with the environment.
All platforms
- helm - Package manager for Kubernetes
- jq - Json query utility to suport parsing
- yq - Yaml query utility to suport parsing
- hub - git utility to support command line forking
- kubectl - CLI to manage the cluster. This is required for all, but will use the installation instructions per each cloud provider
AWS additional tools
- aws - CLI for AWS
- ekscli - CLI for Amazon EKS
- aws-iam-authenticator - Provides authentication kubectl to the eks cluster
Azure additional tools
- az - CLI for Azure
GCP additional tools
- gcloud CLI is available in https://cloud.google.com/sdk/
See these instructions for provisioning an ubuntu 16.04 LTS host on the targeted cloud provider.
There are multiple scripts used for the setup and they must be run the right order. Just run the setup script that will prompt you with menu choices.
./setup.sh <deployment type>
NOTE: Valid 'deployment type' argument values are:
- eks = AWS
- aks = Azure
- gke = GCP
NOTE: The setup.sh
script will set your 'deployment type' selection into creds.json file so that you don't have to keep typing it in each time.
The setup menu should look like this:
====================================================
SETUP MENU
====================================================
1) Install Prerequisites Tools
2) Enter Installation Script Inputs
3) Provision Kubernetes cluster
4) Fork Application Repositories
5) Setup Demo Services
----------------------------------------------------
10) Validate Kubectl
11) Validate Prerequisite Tools
----------------------------------------------------
99) Delete Kubernetes cluster
====================================================
Please enter your choice or <q> or <return> to exit
NOTE: each script will log the console output into the logs/
subfolder.
This will install the required unix tools such as kubectl, jq, cloud provider CLI.
At the end if the installation, the Sscript will call the 'Validate Prerequisite Tools' script that will verify tools setup setup.
You can re-run both 'Install Prerequisites Tools' or 'Validate Prerequisite Tools' anytime as required.
Before you do this step, be prepared with your github credentials, and cloud provider project information available.
This will prompt you for values that are referenced in the remaining setup scripts. Inputted values are stored in creds.json
file.
This will provision a Cluster on the specified cloud deployment type. This script will take several minutes to run and you can verify the cluster was created with the the cloud provider console.
This script at the end will run the 'Validate Kubectl' script.
This script will fork the orders application into the github organization you specified when you called 'Enter Installation Script Inputs' step.
Internally, this script will:
- delete and created a local respositories/ folder
- clone the orders application repositories
- use the
hub
unix git utility to fork each repositories - push each repository to your personal github organization
This script will:
- created staging & production namespaces for the orders app
- install jenkins in the cicd namespaces and setup credentials, environment variables and configure the t-systems performance signature plug-in
- install the Kubernetes ELK Monitoring Operator
- import Jenkins jobs for deploying the application
These are additional scripts available in the 'setup.sh' menu.
This script will attempt to 'get pods' using kubectl.
This script will look for the existence of required prerequisite tools. It does NOT check for version just the existence of the script.
Fastest way to remove everything is to delete your cluster using this script. Becare when you run this as to not lose your work.
NOTE: ekscli will report that the delete is done, but review the AWS console too. It seems it takes longer for the eks cluster and the cloudformation script that ekscli creates to actaully be deleted.
These scripts are helpful when using and reviewing status of your environment. Just run the helper script that will prompt you with menu choices.
./helper.sh
The helper menu should look like this:
====================================================
HELPER MENU
====================================================
1) show App
2) show Jenkins
3) show Dyntrace
====================================================
Please enter your choice or <q> or <return> to exit
NOTE: each script will log the console output into the logs/
subfolder.
Displays the deployed orders application pods and urls
Displays the jenkins pods
Displays the URL to the running Jenkins server
Just run the 'deploy-staging' or 'deploy-production' Jenkins job. You can verify the application is deployed by running the 'show app' helper script which will show you pod status and the application URL.