This architecture uses click-to-deploy so you can spin up a GKE cluster with NGINX for load balancing.
In the fast-paced world of software development, organizations strive to achieve efficient and automated processes to deliver high-quality applications at a rapid pace. To accomplish this, companies leverage technologies like Google Kubernetes Engine (GKE) for container orchestration, Jenkins to implement CI/CD pipelines, and Prometheus Stack for monitoring.
This architecture enables the company to achieve several key benefits. Firstly, it automates and streamlines the application deployment process, reducing manual intervention and improving deployment consistency. Secondly, it ensures scalability and high availability by leveraging GKE's container orchestration capabilities, allowing applications to scale dynamically to handle varying workloads. Thirdly, the integrated monitoring stack provides valuable insights into the system's performance, allowing the company to proactively address any issues, optimize resource usage, and ensure a high-quality user experience.
Overall, this architecture offers a robust and efficient solution for modern application deployment, enabling the company to accelerate their software development processes, improve scalability and reliability, and gain valuable insights into application performance.
These are some examples of the use cases you can build on top of this architecture:
- Web applications: This architecture can be used to deploy and manage web applications. The Nginx controller can be used to load balance traffic across multiple pods or nodes in a cluster, and Jenkins can be used to automate the deployment of applications to Kubernetes. Prometheus can be used to collect metrics from the web applications and to generate alerts when applications are unhealthy or when performance metrics are outside of acceptable ranges.
- Automated Deployment and Testing: With GKE and Jenkins, you can set up an automated CI/CD pipeline that enables seamless deployment of applications to the Kubernetes cluster.Jenkins can be configured to monitor source code repositories, trigger build processes, run automated tests, and deploy application containers to GKE.Utilize the Prometheus Stack to collect and analyze metrics from the deployment pipeline, monitoring the application's performance and ensuring its stability.
- Scalable and Resilient Deployment: By combining GKE with NGINX, you can achieve scalable and resilient application deployments. NGINX acts as a reverse proxy and load balancer in front of the GKE cluster, efficiently distributing traffic to the application containers. GKE's built-in scalability features, combined with NGINX's load balancing capabilities, allow the infrastructure to handle increasing user loads and ensure high availability.
The main components that we would be setting up are (to learn more about these products, click on the hyperlinks)
- VPC with Private Service Access to deploy the instances and VM
- Google Kubernetes Engine cluster: The most scalable and fully automated Kubernetes service
- Load Balancers: When your app usage spikes, it is important to scale, optimize and secure the app. Cloud Load Balancing is a fully distributed solution that balances user traffic to multiple backends to avoid congestion, reduce latency and increase security.
Applications Deployed
- The Prometheus Stack including Prometheus, Grafana, and Alert Manager.
- A Jenkins instance which is an open-source automation server that lets you flexibly orchestrate your build, test, and deployment pipelines.
Pricing Estimates - We have created a sample estimate based on some usage we see from new startups looking to scale. This estimate would give you an idea of how much this deployment would essentially cost per month at this scale and you extend it to the scale you further prefer. Here's the link.
This solution assumes you already have a project created and set up where you wish to host these resources. If you haven't created a project yet or want to create a new one, please follow the instructions in this guide.
- Have an organization set up in Google cloud.
- Have a billing account set up.
- Have an existing project with billing enabled, we'll call this the service project.
In order to spin up this architecture, you will need to be a user with the Project owner IAM role on the existing project:
Note: To grant a user a role, take a look at the Granting and Revoking Access documentation.
🕐 Estimated deployment time: 13 min
- Click on Open in Google Cloud Shell button below.
- Run the prerequisites script to enable APIs and set Cloud Build permissions.
sh prereq.sh- Run the Cloud Build Job
gcloud builds submit . --config build/cloudbuild.yamlIn this example, we demonstrate the usage of a sample domain (example.com). To access the applications, you should set the NGINX IP in your /etc/hosts file.
Go to the GKE Services and copy the external IP assigned to ingress-nginx-controller, then add it to your machine's /etc/hosts alongside <app>.example.com, for example:
##
# Host Database
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
34.95.133.118 jenkins.example.com
34.95.133.118 grafana.example.com
34.95.133.118 prometheus.example.comNote: In your environment, please use a proper domain and set DNS records.
Looking at the grafana.example.com should look like this:

Run the command below on Cloud Shell to delete the resources.
gcloud builds submit . --config build/cloudbuild_destroy.yaml| name | description | type | required | default |
|---|---|---|---|---|
| project_id | Project id, references existing project if project_create is null. |
string |
✓ |

