forked from Nagarajan-sam/pyhton-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.yaml
36 lines (33 loc) · 990 Bytes
/
deployment.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
36
apiVersion: apps/v1
kind: Deployment # Kubernetes resource kind we are creating
metadata:
name: pyapp-k8s-deployment
spec:
selector:
matchLabels:
app: pyapp-k8s
replicas: 2 # Number of replicas that will be created for this deployment
template:
metadata:
labels:
app: pyapp-k8s
spec:
containers:
- name: pyapp-k8s
image: nagarajansam/pythonapp:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5000 # The port that the container is running on in the cluster
---
apiVersion: v1 # Kubernetes API version
kind: Service # Kubernetes resource kind we are creating
metadata: # Metadata of the resource kind we are creating
name: pyapp-k8ssvc
spec:
selector:
app: pyapp-k8s
ports:
- protocol: "TCP"
port: 8081 # The port that the service is running on in the cluster
targetPort: 5000 # The port exposed by the service
type: NodePort # type of the service