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

How deploy spring-petclinic-cloud to k8s without wavefront? #39

Open
patsevanton opened this issue Oct 28, 2021 · 9 comments
Open

How deploy spring-petclinic-cloud to k8s without wavefront? #39

patsevanton opened this issue Oct 28, 2021 · 9 comments

Comments

@patsevanton
Copy link
Contributor

Hello!
I try run spring-petclinic-cloud in kubernetes locally.
I get error.
How deploy spring-petclinic-cloud to k8s without wavefront?

api-gateway-87b794774-kn2rc api-gateway 2021-10-28 10:18:45.674 ERROR [api-gateway,,,] 1 --- [tClientSender-0] c.w.s.c.c.service.ReportingService       : Unable to obtain status code from the Wavefront service at http://wavefront-proxy.spring-petclinic.svc.cluster.local:2878/report?f=trace
api-gateway-87b794774-kn2rc api-gateway 
api-gateway-87b794774-kn2rc api-gateway java.net.UnknownHostException: wavefront-proxy.spring-petclinic.svc.cluster.local
api-gateway-87b794774-kn2rc api-gateway         at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/java.net.Socket.connect(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.NetworkClient.doConnect(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.www.http.HttpClient.openServer(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.www.http.HttpClient.openServer(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.www.http.HttpClient.<init>(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.www.http.HttpClient.New(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.www.http.HttpClient.New(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/java.net.HttpURLConnection.getResponseCode(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at com.wavefront.sdk.common.clients.service.ReportingService.safeGetResponseCodeAndClose(ReportingService.java:77)
api-gateway-87b794774-kn2rc api-gateway         at com.wavefront.sdk.common.clients.service.ReportingService.send(ReportingService.java:68)
api-gateway-87b794774-kn2rc api-gateway         at com.wavefront.sdk.common.clients.WavefrontClient.internalFlush(WavefrontClient.java:515)
api-gateway-87b794774-kn2rc api-gateway         at com.wavefront.sdk.common.clients.WavefrontClient.flushNoCheck(WavefrontClient.java:472)
api-gateway-87b794774-kn2rc api-gateway         at com.wavefront.sdk.common.clients.WavefrontClient.flush(WavefrontClient.java:460)
api-gateway-87b794774-kn2rc api-gateway         at com.wavefront.sdk.common.clients.WavefrontClient.run(WavefrontClient.java:448)
api-gateway-87b794774-kn2rc api-gateway         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
api-gateway-87b794774-kn2rc api-gateway         at java.base/java.lang.Thread.run(Unknown Source)
@patsevanton
Copy link
Contributor Author

May be project have switch: enable/disable wavefront?

@arey
Copy link
Member

arey commented Oct 28, 2021

I am in favor of the possibility of disabling wavefront on the k8s profile. Could you work on this idea?

@patsevanton
Copy link
Contributor Author

patsevanton commented Oct 29, 2021

I try to disable wavefront by issue wavefrontHQ/wavefront-spring-boot#57

In https://github.com/spring-petclinic/spring-petclinic-cloud/blob/master/k8s/api-gateway-deployment.yaml use SPRING_PROFILES_ACTIVE - kubernetes

cat spring-petclinic-api-gateway/src/main/resources/bootstrap.yml

---
spring:
  profiles: kubernetes
  cloud:
    config:
      enabled: false
    kubernetes:
      reload:
        strategy: restart-context
        enabled: true
      config:
        enabled: true
        name: petclinic-config
management:
  endpoint:
    restart:
      enabled: true
  metrics:
    export:
      wavefront:
        enabled: false

Run skaffold dev --default-repo antonpatsev

Get error

api-gateway-84d66b6dd4-kg948 api-gateway 2021-10-29 08:36:00.615 ERROR [api-gateway,,,] 1 --- [tClientSender-0] c.w.s.c.c.service.ReportingService       : Unable to obtain status code from the Wavefront service at http://wavefront-proxy.spring-petclinic.svc.cluster.local:2878/report?f=trace
api-gateway-84d66b6dd4-kg948 api-gateway 
api-gateway-84d66b6dd4-kg948 api-gateway java.net.UnknownHostException: wavefront-proxy.spring-petclinic.svc.cluster.local
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/java.net.Socket.connect(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.NetworkClient.doConnect(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.www.http.HttpClient.openServer(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.www.http.HttpClient.openServer(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.www.http.HttpClient.<init>(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.www.http.HttpClient.New(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.www.http.HttpClient.New(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/java.net.HttpURLConnection.getResponseCode(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at com.wavefront.sdk.common.clients.service.ReportingService.safeGetResponseCodeAndClose(ReportingService.java:77)
api-gateway-84d66b6dd4-kg948 api-gateway        at com.wavefront.sdk.common.clients.service.ReportingService.send(ReportingService.java:68)
api-gateway-84d66b6dd4-kg948 api-gateway        at com.wavefront.sdk.common.clients.WavefrontClient.internalFlush(WavefrontClient.java:515)
api-gateway-84d66b6dd4-kg948 api-gateway        at com.wavefront.sdk.common.clients.WavefrontClient.flushNoCheck(WavefrontClient.java:472)
api-gateway-84d66b6dd4-kg948 api-gateway        at com.wavefront.sdk.common.clients.WavefrontClient.flush(WavefrontClient.java:460)
api-gateway-84d66b6dd4-kg948 api-gateway        at com.wavefront.sdk.common.clients.WavefrontClient.run(WavefrontClient.java:448)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway        at java.base/java.lang.Thread.run(Unknown Source)
api-gateway-84d66b6dd4-kg948 api-gateway 

May be i incorrect add management.metrics.export.wavefront.enabled=false ?

@patsevanton
Copy link
Contributor Author

patsevanton commented Oct 29, 2021

May be create issue in https://github.com/wavefrontHQ/wavefront-spring-boot ?

@snicoll
Copy link

snicoll commented Nov 1, 2021

I think we should keep this conversation here. The configuration to disable the endpoint should be read soon enough (that is not via configuration server). How is this configuration file loaded ?

@patsevanton
Copy link
Contributor Author

@snicoll I am sorry. I am DevOps engineer. Where i can find configuration file ?

@snicoll
Copy link

snicoll commented Nov 8, 2021

@patsevanton sorry I've noticed that you did answered my question already. I am not sure bootstrap.yml is the best place for this. See also the issue I've created.

@patsevanton
Copy link
Contributor Author

any news?

@arey
Copy link
Member

arey commented Dec 28, 2021

Yes see #43

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

No branches or pull requests

3 participants