Create GKE using Terraform infrastructure and jenkins deployment to Deploy a Python web application on GKE using CI/CD Jenkins Pipeline using the following steps and high-level diagram:
- Implement a secure GKE Cluster
- Deploy and configure Jenkins on GKE
- Deploy the backend application on GKE using the Jenkins pipeline
Infrastructure as a code to execute the app Infrastructure.
An open source automation server which we will use to build, test, and deploy our app or software.
The platform which we use to build the app image.
provision the underlying infrastructure of your environment, virtualized hosts and hypervisors.
Kubernetes automates operational tasks of container management.
The Google cloud provider which we will use it through our project.
terraform init
terraform plan
terraform apply
metadata_startup_script = <<-EOF
#
sudo apt install -y apt-transport-https ca-certificates gnupg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo tee /usr/share/keyrings/cloud.google.gpg
sudo apt-get update && sudo apt-get install -y google-cloud-cli
sudo apt-get install kubectl -y
sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin -y
sudo git clone https://github.com/mahmoud-24/ITI-Graduation-Project-Infrastructure /home/mahmoud/ans-file
sudo apt-get install -y ansible
sudo ansible-playbook /home/mahmoud/ans-file/ansible.yaml
EOF
kubectl get all -n jenkins
kubectl exec --namespace jenkins -it svc/jenkins-service -c jenkins -- /bin/cat /var/jenkins_home/secrets/initialAdminPassword && echo