Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StatefulSet scaling on GKE Autopilot #1085

Merged
merged 12 commits into from
Dec 14, 2022
Merged

Conversation

TheRealSpaceShip
Copy link
Contributor

This PR adds to the extra directory a new setup of deployment of the Bank of Anthos Sample Application on GKE Autopilot with examples of autoscaling of StatefulSet and Stateless Kubernetes workloads with HPA objects based on standard and external metrics.

Change Summary

  • A new directory with Kubernetes manifests and additional configurations
  • Usage of PostgreSQL HA from Helm chart
  • HPA configs for frontend, userservice, contacts, and PostgreSQL StatefulSet
  • Simple operator for Pgpool-II
  • Detailed instruction how to use this setup

@TheRealSpaceShip TheRealSpaceShip requested a review from a team as a code owner November 11, 2022 14:51
@snippet-bot
Copy link

snippet-bot bot commented Nov 11, 2022

No region tags are edited in this PR.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

src/frontend/frontend.py Outdated Show resolved Hide resolved
src/ledger-db/initdb/1_create_transactions.sh Show resolved Hide resolved
@@ -0,0 +1,98 @@
# Copyright 2022 Google LLC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file not with the other manifests in the kubernetes-manifests/ directory you created?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use kubernetes-manifests/ directory to deploy only Bank of Anthos app. The load generator is a separate entity in this example and the file should be modified before applying (see README)

@@ -0,0 +1,136 @@
# Copyright 2019 Google LLC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give me a quick run-down of the diff between the root kubernetes-manifests/ and this new directory with copies?
(Note that Kustomize is coming in this repo in the next month or two, which should greatly simplify these duplicates -- but in the meantime duplicates are okay)

Copy link
Contributor Author

@TheRealSpaceShip TheRealSpaceShip Nov 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main change is related to resources limits and requests. Because this example should be run on GKE Autopilot I want to get rid of annoying warning message when kubectl apply -f command runs

extras/gke-autopilot/README.md Outdated Show resolved Hide resolved
@TheRealSpaceShip
Copy link
Contributor Author

@bourgeoisor ready to review. I have added answers to your comments and changed/renamed the dir structure.

@bourgeoisor
Copy link
Member

Staging: http://34.171.27.57

@bourgeoisor
Copy link
Member

@TheRealSpaceShip looks great so far! Could you:

  • Remove all region tags in the new directory (remove all lines that start with # [START or # [END)
  • Pull / merge the main branch into this (it looks like the branch is out-of-date)

Lines that start with # [START or # [END
@TheRealSpaceShip
Copy link
Contributor Author

Done

Copy link
Member

@bourgeoisor bourgeoisor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bourgeoisor bourgeoisor merged commit 0629f15 into GoogleCloudPlatform:main Dec 14, 2022
big-appled pushed a commit to big-appled/bank-of-anthos that referenced this pull request Jun 9, 2023
* StatefulSet scaling on GKE Autopilot

* Fix CI checks

* Apply suggestions from code review

* Update readmes

* Small improvements in kubernetes manifests

* No need to disable managed prometheus in GKE

* Usage single postgres instance

 - Removed ledger-db sts
 - Connection parameters as secret
 - Reconfigure deployments to use secret
 - Increased total connections number for PostgreSQL

* Graceful shutdown for scaling services

* Min 5 replicas for stateless services

* Rename gke-autopilot directory to postgres-hpa

 - Rename of directory
 - Shorten README file

* Fallback to previous timeout default value

* Remove all region tags

Lines that start with # [START or # [END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants