This repository contains code and instructions for setting up a Jenkins pipeline that deploys a sample application to a Google Kubernetes Engine (GKE) cluster using Ansible (over google IAP servers) and terraform
To use this pipeline, you'll need:
- Google Cloud Platform (GCP) account with the necessary permissions
- Google Cloud SDK
- GKE cluster
- Ansible installed
- terraform installed
- slack channel
-
Clone this repository to your local machine.
git clone https://github.com/ahmedsaadx/jenkins-pipeline-with-gke-and-ansible.git
-
start with terraform
cd terraform terraform init terraform apply --auto-approve
-
start playing with ansible (you need add kubconfig path , slack token )
cd .. ansible -i hosts playbook.yaml
-
jenkins pipeline configurations
- access jenkins LB with browser (open loadbalancer page in google account and grep lb ip )
- exec the Container and get the First Password
- install plugins and create account
- add github and dockerhub cred
- create pipeline with jenkins file from this repo https://github.com/ahmedsaadx/goapp
- build now