-
Notifications
You must be signed in to change notification settings - Fork 39
/
0-nginx-all.yaml
87 lines (82 loc) · 1.7 KB
/
0-nginx-all.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
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 80
protocol: TCP
#changed https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#example-1
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
sessionAffinity: None
type: LoadBalancer
---
# Ingress resource example changed
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: nginx-example
rules:
- http:
paths:
- path: /testpath
pathType: Prefix
backend:
service:
name: test
port:
number: 80
#older example
# apiVersion: networking.k8s.io/v1
# kind: Ingress
# metadata:
# name: nginx
# annotations:
# ingress.kubernetes.io/ssl-redirect: "false"
# spec:
# rules:
# - http:
# paths:
# - path: /
# backend:
# serviceName: nginx
# servicePort: 80
# https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122
# Ingress resource example is replaced with this: https://kubernetes.io/docs/concepts/services-networking/ingress/#the-ingress-resource