I started implementing the Kuberenetes for my simple app. I am facing issue when i use NodePort
. IF I use LoadBalancer
I can open my url. If I use NodePort
it will take long time for trying to load and getting error connection refused
. Below is my simple yaml file.
> POD yaml
apiVersion: v1
kind: Pod
metadata:
name: pod-webapp
labels:
app: webapp
spec:
containers:
- name: app
image: mydockerimage_xxx
> service.yaml
kind: Service
apiVersion: v1
metadata:
# Unique key of the Service instance
name: service-webapp
spec:
ports:
# Accept traffic sent to port 80
- name: http
port: 80
nodePort: 30080
selector:
app: webapp
type: NodePort
what I found something in GitHub : Kubernetes NodePort which solved my issue partially.