-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s-nginx.yaml
66 lines (66 loc) · 1.28 KB
/
k8s-nginx.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
# k3d create --name k3d --api-port 6551 --publish 80:80 --workers 2
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
containers:
- name: nginx-deployment
image: nginx
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
sessionAffinity: None
type: ClusterIP
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx-ingress
annotations:
ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
## - http:
## paths:
## - path: /
## backend:
## serviceName: nginx-service
## servicePort: 80
# - host: example.com
# http:
# paths:
# - backend:
# serviceName: nginx-service
# servicePort: 80
- http:
paths:
- backend:
serviceName: nginx-service
servicePort: 80