-
Notifications
You must be signed in to change notification settings - Fork 880
Expand file tree
/
Copy pathdeployment.yml
More file actions
37 lines (35 loc) · 760 Bytes
/
deployment.yml
File metadata and controls
37 lines (35 loc) · 760 Bytes
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
36
37
apiVersion: apps/v1
kind: Deployment
metadata:
name: apachewebsite-deployment
labels:
app: apachewebsite
spec:
replicas: 2 # number of pods
selector:
matchLabels:
app: apachewebsite
template:
metadata:
labels:
app: apachewebsite
spec:
containers:
- name: apachewebsite
image: akshu20791/apachewebsite:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: apachewebsite-service
spec:
selector:
app: apachewebsite
ports:
- protocol: TCP
port: 80 # Service port
targetPort: 80 # Container port
nodePort: 30080 # Optional: fixed NodePort
type: NodePort # Change to LoadBalancer if using cloud provider