0

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 are undeploy and deploy the stream that time deployment name and repicasset are changed. Can we have option to fix it (deployment name) as we are facing issue with 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 woking after sms-v2. So we need to update deployment name in HPA which is not possible everytime.

Please share the some suggestion.

Thanks

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

1 Answers1

0

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.

  • Hi, Thank you for your suggestion. Could you please help me to apply the HPA based on the label sector instead of the Deployment name? What are the parameters in the HPA YAML file? – Anish Raut Mar 31 '23 at 05:05
  • I am investigating the HPA configuration required. I made the mistake of assuming a selector could be used to identify the Deployment targeted. I will revert with feedback soon. – Corneil du Plessis Mar 31 '23 at 13:37
  • My suggestion for now is to add an init container using an image that has kubectl and yq with a command to update the HPA resource using a selector to determine the name. `NAME=$(kubectl get deployment --selector=spring-group-id=stream-name --selector=spring-application-name=app-name -o yaml | yq '.items[0].metadata.name')` Then update the HPA with the new name. – Corneil du Plessis Apr 05 '23 at 09:53
  • Hi, Thank you for the suggest. could you please make it easy for me? I didn't understand where I can run the init container. – Anish Raut Apr 06 '23 at 11:17
  • https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#configuration-kubernetes-deployer Look at the initContainer property. The sample value is a reasonable start. You will need to use an image that has kubectl installed in order to update / create the entries you require. https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ will provide extra info. – Corneil du Plessis May 11 '23 at 10:11