0
  1. Configured nginx-proxy-manager and hello-world fastapi app using K8S on Docker desktop
PS C:\Users\91893\Programming\docker\k8s\hello-world> kubectl get services NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE hello-world-service ClusterIP 10.99.143.236 <none> 7392/TCP 71m kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 3h54m nginx-proxy-manager-service NodePort 10.108.244.254 <none> 32080:32080/TCP,32443:32443/TCP,32081:32081/TCP 174m PS C:\Users\91893\Programming\docker\k8s\hello-world> 
  1. Added a Proxy Hosts config to nginx-proxy-manager via WebUI.
    Below I have shown the config taken from inside the pod.
    Also have shown the config screenshot at the last.
[root@docker-nginx-proxy-manager-app-cc7f96ffb-fm2wv:/app]# cat /data/nginx/proxy_host/1.conf | grep set set $forward_scheme http; set $server "hello-world-service"; set $port 7392; [root@docker-nginx-proxy-manager-app-cc7f96ffb-fm2wv:/app]# 
  1. From inside nginx-proxy-manager pod I am able to reach hello-world-service
[root@docker-nginx-proxy-manager-app-cc7f96ffb-fm2wv:/app]# curl http://hello-world-service:7392 {"message":"Hello, FastAPI!","counter":12} [root@docker-nginx-proxy-manager-app-cc7f96ffb-fm2wv:/app]# 
  1. But I am not able to reach the same via localhost
[root@docker-nginx-proxy-manager-app-cc7f96ffb-fm2wv:/app]# curl localhost 2>&1 | grep title <head><title>502 Bad Gateway</title></head> [root@docker-nginx-proxy-manager-app-cc7f96ffb-fm2wv:/app]# 

enter image description here

1 Answer 1

2

The problem got resolved when I configured with (FQN) full qualified name for the service like hello-world-service.default.svc.cluster.local

This question answered in StackOverflow

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.