Skip to content

Mariamkassab/End-to-End-DevOps-Project-APP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

End-to-End-DevOps-Project-APP:

  • The project is about creating a private cluster and deploy Jenkins, and deploy as app using Jenkins pipeline.
  • I used google cloud provider,created the infra using Terraform, and deployed Jenkins on the GKE using Ansible.
  • The Infra repo
  • The APP repo

Terraform components:

  • VPC
  • Two subnets one for GKE and the other for the private-bastion
  • GKE cluster
  • IAP
  • NAT Gatway and Router
  • Service Account
  • private-bastion wuth its automation file

Cloud Architecture - Page 1 (3)


Commands to run Terraform:

terraform init
terraform plan
terraform apply
  • run gcloud compute ssh private-bastion --dry-run private-bastion to get the "ProxyCommand"
  • run ssh-keygen -t rsa to generate a keypair
  • then ssh to the private-bastion
  • copy the pub key and paste it in the private-bastion in path: "/home/user/.ssh/authorized_keys"

Commands to connect the private-bastion to the GKE:

gcloud auth login
gcloud container clusters get-credentials <cluster_name> --zone <zone> --project <project_name>

Create jenkins slave image with all its dependances:

  • on dockerhub mariamkasssab/jenkins_slave:v3

Commands to run Ansible:

  • mkdir jenkins in the private-bastion

  • run from your PC

ansible-playbook playbook.yaml -e 'ansible_ssh_common_args="-o -<ProxyCommand>- "'  

Commands on the jenkins salve pod:

  • passwd jenkins to reset the password we will use on jenkins.
  • chmod 777 /var/run/docker.sock
  • service ssh start
  • then,
gcloud auth login
gcloud container clusters get-credentials <cluster_name> --zone <zone> --project <project_name>

2


1


3


4


Ansible


image


image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published