You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "chander35 (via GitHub)" <gi...@apache.org> on 2023/04/13 16:57:22 UTC

[GitHub] [camel-k] chander35 opened a new issue, #4256: unable to access the URL and unable to expose port after the integration build is successfully deployed.

chander35 opened a new issue, #4256:
URL: https://github.com/apache/camel-k/issues/4256

   Here, I have used a simple code to expose the REST url as i mentioned below
   <img width="458" alt="image" src="https://user-images.githubusercontent.com/128601152/231826248-9ac7a69c-ab5b-46e8-9ced-1184e8d8487d.png">
   
   when I run the Kamel command for the same REST code, the build got successful and shown message like **"Listening on: http://0.0.0.0:8080"**, below I have shared the screenshot for the same.
   <img width="849" alt="image" src="https://user-images.githubusercontent.com/128601152/231827060-c7a4a06c-38fc-4fe2-9950-17597525464f.png">
   
   But Iam not able to access the url as mentioned above, I have tried different ways to access like
   **http://0.0.0.0:8080/hello
   http://localhost:8080/hello
   http://127.0.0.1:8080/hello** in web browser as well as in postman, still no use.
   
   later I got to know that we need to expose the port in docker to access the actual 8080 port, so i tried below mentioned command to expose outside the docker **"docker run -it -p 8080:8080 <image name> "** but every time iam getting same error as shown below
   <img width="844" alt="image" src="https://user-images.githubusercontent.com/128601152/231830209-bcf08f04-e362-4f4e-a5e3-606a11209fa8.png">
   
   I want to know where i am doing wrong and how can i resolve this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on issue #4256: unable to access the URL and unable to expose port after the integration build is successfully deployed.

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on issue #4256:
URL: https://github.com/apache/camel-k/issues/4256#issuecomment-1598344263

   If your goal is to access your rest end point from outside the K8s cluster, you will need to add an ingress https://kubernetes.io/docs/concepts/services-networking/ingress/


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] chander35 commented on issue #4256: unable to access the URL and unable to expose port after the integration build is successfully deployed.

Posted by "chander35 (via GitHub)" <gi...@apache.org>.
chander35 commented on issue #4256:
URL: https://github.com/apache/camel-k/issues/4256#issuecomment-1507952341

   Thank you @essobedo, It started working with your command, I have tried many ways to expose the port but none of them are worked, thank you for your dedication to resolve my issue and now I am able to expose the port and able to access it, Thank you so much.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] github-actions[bot] commented on issue #4256: unable to access the URL and unable to expose port after the integration build is successfully deployed.

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #4256:
URL: https://github.com/apache/camel-k/issues/4256#issuecomment-1724651753

   This issue has been automatically marked as stale due to 90 days of inactivity.
   It will be closed if no further activity occurs within 15 days.
   If you think that’s incorrect or the issue should never stale, please simply write any comment.
   Thanks for your contributions!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] chander35 closed issue #4256: unable to access the URL and unable to expose port after the integration build is successfully deployed.

Posted by "chander35 (via GitHub)" <gi...@apache.org>.
chander35 closed issue #4256: unable to access the URL and unable to expose port after the integration build is successfully deployed.
URL: https://github.com/apache/camel-k/issues/4256


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] chander35 commented on issue #4256: unable to access the URL and unable to expose port after the integration build is successfully deployed.

Posted by "chander35 (via GitHub)" <gi...@apache.org>.
chander35 commented on issue #4256:
URL: https://github.com/apache/camel-k/issues/4256#issuecomment-1595826327

   I have a question, do we need to run "**kubectl port-forward svc/rest-dsl 8080:80 -n <your-namespace-here>**" command every time when ever we want to expose the above "RestDSL" class? is there any other way to expose while using the "kamel run "command itself.?
   the issue with this is, if the code has changed then the port-forwarder is stopping immediately, so need to start again every time to access the url.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on issue #4256: unable to access the URL and unable to expose port after the integration build is successfully deployed.

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on issue #4256:
URL: https://github.com/apache/camel-k/issues/4256#issuecomment-1507371639

   What you are looking for is port forwarding https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/
   
   Camel-K should have created a service automatically for you.
   
   You can check it with the next command:
   
   ```
   kubectl get svc -n <your-namespace-here>                     
   NAME       TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
   rest-dsl   ClusterIP   10.96.195.112   <none>        80/TCP    82s
   ```
   
   In the previous example, the service `rest-dsl` is listening on port `80` so assuming that you would like to access your application from port `8080` on your local machine, the  corresponding `port-forward` command is then:
   ```
   kubectl port-forward svc/rest-dsl 8080:80 -n <your-namespace-here>
   ```
   
   The code of the integration that I used:
   ```
   import org.apache.camel.builder.RouteBuilder;
   import org.apache.camel.Exchange;
   
   public class RestDSL extends RouteBuilder {
   
       @Override
       public void configure() throws Exception {
       	rest()
       		.get("/hello")
       		.to("direct:hello");
           from("direct:hello")
           	.setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
               .transform().simple("Hello, Camel K");
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on issue #4256: unable to access the URL and unable to expose port after the integration build is successfully deployed.

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on issue #4256:
URL: https://github.com/apache/camel-k/issues/4256#issuecomment-1598291835

   Well, this is required if you're on a local cluster such as Minikube or the like. With the port-forward, you'll be able to "see" the Kubernetes service which otherwise is not available. In a real environment, you should be able to access the service OOTB.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on issue #4256: unable to access the URL and unable to expose port after the integration build is successfully deployed.

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on issue #4256:
URL: https://github.com/apache/camel-k/issues/4256#issuecomment-1598335094

   Just to avoid misunderstanding, if your goal is to access your service from localhost, `port-forward` will always be needed whatever the cluster used behind (local or not)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] unable to access the URL and unable to expose port after the integration build is successfully deployed. [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #4256: unable to access the URL and unable to expose port after the integration build is successfully deployed.
URL: https://github.com/apache/camel-k/issues/4256


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org