zkt25/assignment2/deployment-api.yaml

37 lines
594 B
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: weather-api
namespace: webapp-ns
spec:
replicas: 1
selector:
matchLabels:
app: weather-api
template:
metadata:
labels:
app: weather-api
spec:
containers:
- name: weather-api
image: weather-api:latest
ports:
- containerPort: 3000
---
apiVersion: v1
kind: Service
metadata:
name: weather-api-service
namespace: webapp-ns
spec:
selector:
app: weather-api
ports:
- protocol: TCP
port: 3000
targetPort: 3000
nodePort: 31000
type: NodePort