I try to deploy simple nodejs API to AKS. API works fine in local docker. I get no errors. AKS that status is running. However browser does not respond. Could someone check yaml and give me some tips?
apiVersion: apps/v1
kind: Deployment
metadata:
name: nodejs
labels:
app: nodejs
spec:
replicas: 3
selector:
matchLabels:
app: nodejs
template:
metadata:
labels:
app: nodejs
spec:
nodeSelector:
"kubernetes.io/os": linux
containers:
- name: nodejs
image: dileepamabulage/node-app:latest
imagePullPolicy: Always
ports:
- containerPort: 3003
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
name: nodejs
labels:
app: nodejs
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 3003
protocol: TCP
my docker file used to build the docker image
FROM node:20
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3003
CMD ["node", "server.js"]
When I try to access the external Ip it fails, are there any port mapping errors?
Thanks @arko for your insights, Here I have create a nodeJS application in my local and deployed it to my desktop docker using
Dockerfile
.Then created a
deployment.yaml
file andservice.yaml
file in my project directory and configured AKS configuration.Status: