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

Deployment to local minikube, of HelloWorld Spring Boot Application, doesn't read IP and port mappings from PODs and Services #95

Closed
prafullkotecha opened this issue Apr 25, 2019 · 5 comments
Assignees
Labels
kind/bug Something isn't working priority/p2 Needs action later

Comments

@prafullkotecha
Copy link

Environment:
Extension version: 0.0.8
VSCode version:1.34.0-insider
OS: darwin (macOS Mojave, 10.14.4)

Description:
Deployment succeeds, but External IP, and the port is not recognized. The IP is the host IP of minikube, which can be found in the deployed POD's yaml. I could find the port mapping using kubectl get svc command.

Repro step:

  • Open Cloud Code - Welcome Page
  • Click on Starter Apps
  • Select Java: Hello World option
  • Execute Cloud Code: Deploy command from the command palette
  • Ignore errors from repackage goal of spring-boot-maven-plugin:2.1.2.RELEASE
    Error:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  44.835 s
[INFO] Finished at: 2019-04-25T14:02:24Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.2.RELEASE:repackage (repackage) on project hello-world: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.2.RELEASE:repackage failed: Unable to find main class -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[INFO] Build failures were ignored.

This error can be fixed by adding following to plugin section of pom.xml

<configuration>
  <mainClass>cloudcode.helloworld.HelloWorldApplication</mainClass>
</configuration>
  • Locate the IP in hostIP property of the pod, using kubectl get pods -o yaml command.
    hostIP: 192.168.64.11
    phase: Running
    podIP: 172.17.0.8
    qosClass: BestEffort
    startTime: "2019-04-25T14:50:58Z"
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""
  • Locate the port mapping using kubectl get svc command. The output would look something like:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
java-hello-world-external LoadBalancer 10.98.165.217 <pending> 80:32078/TCP 63m
  • Open the browser and go to : http://<hostIP>:<mapped-port>
@iantalarico iantalarico added the kind/bug Something isn't working label Apr 25, 2019
@quoctruong
Copy link
Contributor

@prafullkotecha Eventually, does the external IP shows up when you run kubectl get svc command? What the extension does under the scene is just wait until kubectl get svc shows an external IP.

@prafullkotecha
Copy link
Author

prafullkotecha commented Apr 25, 2019

@quoctruong - No. With minikube, the external IP is always in <pending> mode, and that's why we need to use the "minikube" IP, in place of external IP. I found this out while trying to deploy knative samples on minikube. https://knative.dev/docs/install/knative-with-minikube/

@sujit-kamireddy
Copy link
Contributor

sujit-kamireddy commented May 30, 2019

kubernetes/minikube#4113 for reference.

@quoctruong quoctruong added the priority/p2 Needs action later label Jun 25, 2019
@sujit-kamireddy
Copy link
Contributor

@prafullkotecha , can you try this with the latest version of minikube and cloud code and let us know if it still repro? It didn't repro for me.

@kschaab
Copy link
Contributor

kschaab commented Nov 27, 2019

We think this is fixed, please reopen if it reproduces in the future.

@kschaab kschaab closed this as completed Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working priority/p2 Needs action later
Projects
None yet
Development

No branches or pull requests

6 participants