Post a message to a configurable endpoint using helm - spring

I am new to Spring Boot and Helm. Could you give me an idea. I need to set configurable variable value should be provided from Helm values.yaml.

Related

What metrics are generated by #RefreshScope in Springboot?

Does using #RefreshScope annotation generates any metrics in springboot which can be visualised in grafana or prometheus?
Once you have this enabled, the configuration refresh is automatically enabled via "/actuator/refresh" endpoint. This traffic should be automatically captured by prometheus. I dont have it setup locally, but query to get total count would be something like:
http_server_requests_seconds_count{method="GET",status="200",uri="/actuator/refresh",}
update adding official documentation from comment:
Official Documentation

How to set up Spring Boot datasource URL from AWS AppConfig?

So the title says pretty much it all. I have a spring-boot based Microservices and I need to supply everything which usually goes to application.properties via AWS AppConfig. How can I do this? I've created a sample project, but how can I do this for the database URL?
If I had correctly understand the question then you need to configure the application properties through the AWS Config. On high level, AWS Config has Configuration Profile where you can store the configurations. The config profile can be in YML, JSON or text document format. Here is the official documentation of AWS config.

How do I use Spring Cloud Kubernetes to programmatically write a ConfigMap value?

I have a service that uses Spring Cloud Kubernetes Config to reload its configuration when a value in a ConfigMap changes. That all works great.
Is it possible to use Spring Cloud Kubernetes (or one of its dependencies) to write a ConfigMap value? I didn't see any examples of this in the documentation (here). Can I do this programmatically, or do I need to call the underlying Kubernetes APIs to do this?
Based on Eugene's reply:
No, this is impossible at the moment to do so. You can go to GitHub and create an issue with the explanation of your use case, and this feature can be created within the future releases.

programmatically configuration for spring boot micrometer with influxdb

I am facing some challenges while configuring Spring Boot Micrometer for my application. Micrometer documents says we can configure influxdb uri, userName, password, db etc through application.yml file which is working fine for my demo application but for production ready application we are using docker-compose and we are setting all our environment variable through docker-compose. Now I am facing challenges like -
How can I force micrometer to use docker-compose environment variable influxdb uri
For influxdb password, our application stores passwords in AWS secret Manager, how micrometer will access password from secret manager?
Can I configure all this micrometer properties programmatically (Spring Bean)? How?
I'm not sure how to leverage AWS Secret Manager, but for point 1 and 3 I can offer some advice.
I'm not familiar with Influx specifically, but based on the javadoc it uses management.metrics.export.influx.username to set the password.
1- To set a application property via an environment variable, set the equivalent using the typical 'SCREAMING_SNAKE_CASE' format:
MANAGEMENT_METRICS_EXPORT_INFLUX_USERNAME=myInfluxUser
Or if you already have an environment variable that you want to reference in you application.yml file you con reference in as a property:
management.metrics.export.influx.username: ${INFLUX_USER}
3- To configure Micromerter/influx programatically create a bean on type InfluxProperties:
#Bean
public InfluxProperties influxProperties() {
return new InfluxProperties(); // Programatically set any properties here.
}

Swagger Configuration for base url

I have my Spring boot application deployed using the Kubernetes cluster. I have swagger configured using
springfox.documentation.*
Now on the swagger page when I use "Try it out" button, and submit an API request the Request Url is formed like https://java:9080/api/customer/order Which should be https://application.domain.com/api/customer/order
The swagger page opens at https://application.domain.com/swagger-ui.html#
Any idea how could it be fixed?
You need to configure the swagger ui to use your server. Look at this document.
Looks like setting the URL environment variable for the swagger UI should work. For better control, you can get a copy of the dist/index.html page, edit it with your configuration options, and mount it into the swagger container.
My answer is straight forward WRT Kubernetes + SpringBoot.
If it's on kubernetes, Then please try to append your application name in the URL.
Refer application name from deployment.yml
---
apiVersion: v1
kind: deployment
metadata:
name: {app-name}
Example:-
https://application.domain.com/{application-name}/swagger-ui.html

Resources