This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
poc.yaml
113 lines (112 loc) · 2.22 KB
/
poc.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
######################################################################
# Learn how to to create a deployment and a service
# from the command line with 'kubectl' and a complete YAML descriptor
######################################################################
## App 1
### Deployment
### https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app1-deployment
namespace: my-poc
labels:
app: my-app1
spec:
replicas: 1
selector:
matchLabels:
app: my-app1
template:
metadata:
labels:
app: my-app1
spec:
containers:
- name: my-app1
image: "kicbase/echo-server:latest"
ports:
- containerPort: 8080
---
### Service
### https://kubernetes.io/docs/concepts/services-networking/service/
apiVersion: v1
kind: Service
metadata:
name: my-app1-service
namespace: my-poc
labels:
app: my-app1
spec:
type: NodePort
selector:
app: my-app1
ports:
- port: 8080
---
## App 2
### Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app2-deployment
namespace: my-poc
labels:
app: my-app2
spec:
replicas: 1
selector:
matchLabels:
app: my-app2
template:
metadata:
labels:
app: my-app2
spec:
containers:
- name: my-app2
image: "kicbase/echo-server:latest"
ports:
- containerPort: 8080
---
### Service
apiVersion: v1
kind: Service
metadata:
name: my-app2-service
namespace: my-poc
labels:
app: my-app2
spec:
type: NodePort
selector:
app: my-app2
ports:
- port: 8080
---
### Ingress
### https://kubernetes.io/docs/concepts/services-networking/ingress/
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-ingress
namespace: my-poc
spec:
rules:
- http:
paths:
- pathType: Prefix
path: /app1
backend:
service:
name: my-app1-service
port:
number: 8080
- pathType: Prefix
path: /app2
backend:
service:
name: my-app2-service
port:
number: 8080
---