-
Notifications
You must be signed in to change notification settings - Fork 39
/
2-whoareyou-all.yml
71 lines (66 loc) · 1.34 KB
/
2-whoareyou-all.yml
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoareyou-deployment
spec:
replicas: 3
selector:
matchLabels:
app: whoareyou
template:
metadata:
labels:
app: whoareyou
spec:
containers:
- name: whoareyou-container
image: containous/whoami
---
apiVersion: v1
kind: Service
metadata:
name: whoareyou-service
spec:
ports:
- name: http
targetPort: 80
port: 80
selector:
app: whoareyou
---
# changed
# apiVersion: networking.k8s.io/v1
# kind: Ingress
# metadata:
# name: whoareyou-ingress
# annotations:
# kubernetes.io/ingress.class: "traefik"
# spec:
# rules:
# - host: node2
# http:
# paths:
# - path: /
# backend:
# serviceName: whoareyou-service
# servicePort: http
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: whoareyou-ingress
annotations:
ingressclass.kubernetes.io/is-default-class: "true"
spec:
ingressClassName: traefik
rules:
- host: node2
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: whoareyou-service
port:
number: 80
# Do we need to add IngreessClass https://kubernetes.github.io/ingress-nginx/#i-have-only-one-instance-of-the-ingresss-nginx-controller-in-my-cluster-what-should-i-do