This project contains:
- Infrastructure as code using Terraform that builds an environment on the AWS cloud platform
- Kubernetes Jenkins-Deployment_Manifests YAML files for deploying jenkins
- Demo app with Dockerfile
- Kubernetes Using the demo app from My_Connect-4_repo
-
Using Git, clone the project.
git clone https://github.com/AmrTarek17/iti-project.git
-
First setup your aws account with cli.
-
Second build the infrastructure by run
cd iti-project/terraform
terraform init terraform apply
that will build:
- VPC named "prod-vpc"
- 2 public Subnets
- 2 private Subnets
- 2 nat gateway
- EKS private Kubernetes cluster
- 1 ec2 used as bastion and slave for jenkins
- groups: - system:masters rolearn: arn:aws:iam::<change all arn with yours>:role/ec2-eks username: basion-admin
```bash # NOTE You need to get attached to cluster using. aws eks --region <region> update-kubeconfig --name <clusterName> ```
---
- name: deploy jenkins
hosts: k8s
become: true
tasks:
- name: Copy jenkins files
copy:
src: "./Jenkins-Deployment_Manifests"
dest: "/home/ansadmin"
- name: configure cluster
shell: aws eks --region us-west-2 update-kubeconfig --name prod_eks_cluster
- name: deploy jenkins
shell: kubectl apply -f /home/ansadmin/Jenkins-Deployment_Manifests/
kubect exec -it <jenkins_pod_name> bash
- cat the admin password file and use it to create your own
- hit install recomended
- fork my repo My_Connect-4_repo
- edit IMG_NAME variable from Jenkinsfile there
- configure your docker hub credintials on jenkins with credentialsId: 'Docker_Hub'
- configure your ec2 ssh credintial with the private key that terraform created for you "You can locate it in secrets manger from console" use
label:ec2-slave
You can try my deployed demo Game from here
connect4 game Game-repo with Jenkins pipline
You can try my deployed jenkins from here
User:admin
,Pass:admin
๐ ๐ ๐ ๐