spring-cloud / spring-cloud-skipper

A package manager that installs, upgrades, and rolls back Spring Boot applications on multiple Cloud Platforms.
http://cloud.spring.io/spring-cloud-skipper/
Apache License 2.0
112 stars 77 forks source link

facing an issue with HPA on springcloud based deployment in Kubernetes #1085

Closed anishkumar7836 closed 1 year ago

anishkumar7836 commented 1 year ago

We have deployed the pod of Spring Cloud dataflow and Skipper in AWS EKS. We have registered the application and created the stream. Whenever we undeploy and deploy the stream, the deployment name and repicasset are changed. Can we have the option to fix it (deployment name) as we are facing an issue with the Kubernetes Horizontal Pod Auto Scaler policy as HPA based on the Deployment name?

For example Application Name: sms Stream name: sms Deployment name: sms-v1

After undeploy and deploy: Deployment name: sms-v2

in this case, we have applied the HPA on deployment name sms-v1 not working after sms-v2. So we need to update the deployment name in HPA which is impossible every time.

Please share some suggestion.

Thanks

Currently, We have manually changed the deployment name in HPA.

corneil commented 1 year ago

There will be labels assigned to the related Kubernetes Services, Deployments and Pods:

spring-group-id: sms
spring-app-id: sms-v1                                                                                                                                              
spring-application-name: sms
spring-deployment-id: sms-v1                                                                                                                                       

If you have a stream the spring-group-id is the streamName and spring-application-name will be streamName-appName-version The spring-deployment-id will typically match the spring-app-id

You can use kubectl get pod --selector='spring-group-id=sms' to view all pods for the specific stream / task

You should be able to use label selectors in HPA instead of Deployment names.