-
Notifications
You must be signed in to change notification settings - Fork 0
/
app-deploy.yaml
35 lines (34 loc) · 861 Bytes
/
app-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-deploy # name of deployment
namespace: default
spec:
replicas: 1 # number of replicas
selector:
matchLabels:
app: app # selector label
template:
metadata:
labels:
app: app # same selector label as deployment
spec:
containers:
- name: students-database-dotnet-docker-app
image: students-database-dotnet-docker-app:latest
imagePullPolicy: IfNotPresent # Corrected line
ports:
- containerPort: 5000
--- # separates deployment and service
apiVersion: v1
kind: Service
metadata:
name: app-service # name of service
spec:
type: NodePort # service has to be accessible externally
selector:
app: app # same selector label as deployment
ports:
- nodePort: 30001
port: 5000
targetPort: 5000