I have a yaml file for Kubernetes that looks like this:
apiVersion: v1
kind: Service
metadata:
name: my-node-app-service
spec:
selector:
app: my-node-app
ports:
- name: http
port: 3000
targetPort: 3000
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-node-app
spec:
replicas: 1
selector:
matchLabels:
app: my-node-app
template:
metadata:
labels:
app: my-node-app
spec:
containers:
- name: node-app
image: <my image>
ports:
- containerPort: 3000
Here's the line for the POST request from an HTML page:
<form action="http://my-node-app-service:3000/" method="post">
It doesn't work and gives me a Server Not Found error in my browser.
I expected the POST request to go through successfully and write to my database, but it looks like where I'm posting to is wrong. Where should I post to?