GithubHelp home page GithubHelp logo

eks-ops's Introduction

Start EKS cluster and Applicatio Infrastrcture with Terraform and Run Deploy of App from Jenkins

This will start an EKS cluster with terraform and other components for deploying the A App

  1. Prerequisites:

  • Install Terraform on your workstation/server
  • Install aws cli on your workstation/server
  • Install kubectl on your workstation/server
  1. Variables:

  • Change the aws_region to your requested region (default: us-east-1)
  • Change kubernetes_version to the desired version (default: 1.18)
  • Change k8s_service_account_namespace to the namespace for your application (default: default)
  • Change k8s_service_account_name to the service account name for your application (default: k8s_service_account_name)
  1. Run:

  • Run the following to start your eks environment:
  • terraform init
  • terraform apply --auto-approve
  • After the environement is up run the following to update your kubeconfig file (you can get the cluster_name value from the cluster_name output in terraform)
  • aws eks --region=us-east-1 update-kubeconfig --name <cluster_name>
  1. To test the environemet run the following:

  • kubectl get nodes -o wide
  1. Optional:

If you'd like to add more authrized users or roles to your eks cluster follow this:

  • Create an IAM role or user that is authorized to user EKS

  • From an authorized user edit aws-auth-cm.yaml update aws-auth configmap and add the relevant users/roles and execute with kubectl data: mapRoles: |

    • rolearn:
  • then do "kubectl apply -f aws-auth-cm.yaml "

Important: Make sure you get the nodes role arn from the currently configured configmap using kubectl get configmap aws-auth -n kube-system -o yaml and replace with the above

  1. Add Jenkins Agent to IAM role that have the correct rights to perform all the actions needed.

  2. Testing Consul Server :

  • connect Consul server Public ip on port 8500 .
  1. Connection Jenkins and Running the Deploy

  • create credentials to connect EKS , choose kubeconfig and paste there the content of cat .kube/config
  • connect Jenkins Seever Public ip on port 8080
  • Run the job : deploy kalandula app
  1. check form kubectl get pods and kubectl get svc , to see if the app and LB service deployed .

  2. connect EKS public cluster ip to check the Application is up and Running .

  3. Config Bastion:

Edit ~/.ssh/config on local machine as /general/ssh_config. (modify the template with your pramaters)

  1. Run jenkins jobs:

  • Kandula app depploy
  • filebeat_deploy
  • node_exporter_deploy
  • consul_deploy
  1. Stop Environment

  • Run Jenknis job to destory all resources on Kube.
  • Make sure no pods or svc are up.
  • Run ```terrafrom/terraform destory --auto-approve

eks-ops's People

Contributors

y0zg avatar

Watchers

James Cloos avatar  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.