-
Notifications
You must be signed in to change notification settings - Fork 643
/
Copy pathk8s-deployment.yaml
38 lines (38 loc) · 1.71 KB
/
k8s-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
37
38
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: chat-server # Name of the kubernetes resource
labels: # Labels that will be applied to this resource
app: chat-server
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods mayching the specified labels
app: chat-server
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: chat-server
spec: # Spec for the containers that will be run in the Pods
containers:
- name: chat-server
image: callicoder/spring-boot-websocket-chat-demo:0.0.1-SNAPSHOT
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8080 # The port that the container exposes
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: chat-server # Name of the kubernetes resource
labels: # Labels that will be applied to this resource
app: chat-server
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
selector:
app: chat-server # The service exposes Pods with label `app=polling-app-server`
ports: # Forward incoming connections on port 8080 to the target port 8080
- name: http
port: 8080
targetPort: 8080