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

Not able to acess the application running inside kind cluster #3127

Closed
rabindragogoi opened this issue Mar 16, 2023 · 4 comments
Closed

Not able to acess the application running inside kind cluster #3127

rabindragogoi opened this issue Mar 16, 2023 · 4 comments
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@rabindragogoi
Copy link

rabindragogoi commented Mar 16, 2023

I have an applcation with the below deployment file:
apiVersion: apps/v1 kind: Deployment metadata: name: flask-app-deployment namespace: default spec: replicas: 1 selector: matchLabels: app: flask-app-deployment template: metadata: labels: app: flask-app-deployment spec: containers: - name: test-app image: localhost:5001/learn:01 resources: limits: memory: "128Mi" cpu: "500m" ports: - containerPort: 8399

  1. Created a service .
    kubectl expose deployment flask-app-deployment --type=NodePort --name=my-service
    But I am not able to access my application. While I do kubectl get deployments and get services, it shows everything is fine.

The only way I am able to run the application i when I run separately port forwarding. command.
kubectl port-forward flask-app-deployment-74b5c95c56-rj5mf 8399:8399
How can I run the application without port forwarding and put whatever needed in service.yaml file?
Please help.

@rabindragogoi rabindragogoi added the kind/support Categorizes issue or PR as a support question. label Mar 16, 2023
@BenTheElder
Copy link
Member

what platform are you on?

on mac/windows you'll have to use some form of port forwarding. you can do https://kind.sigs.k8s.io/docs/user/configuration/#extra-port-mappings + a node port, see e.g. https://kind.sigs.k8s.io/docs/user/ingress/

on linux you can typically use the node container IPs and access the nodeports at $container_ip:$port

is there a reason kubectl port-forward is insufficient? it's a pretty simple and portable option.

@rabindragogoi
Copy link
Author

Hey @BenTheElder : Thanks for the suggestion. I am able to access my application without port forwarding separately in a command.

Would like to know that the same process will work for load balancer as well?

@rabindragogoi
Copy link
Author

closing the issue Thanks

@BenTheElder
Copy link
Member

LoadBalancer API doesn't really map well to pre-defined forwards of specific ports https://kind.sigs.k8s.io/docs/user/loadbalancer/

We're working on something else in #3086

In the meantime this approach does work https://kind.sigs.k8s.io/docs/user/ingress/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

2 participants