-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmultus-service-demo1.yaml
99 lines (99 loc) · 2.17 KB
/
multus-service-demo1.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
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: macvlan1
spec:
config: '{
"cniVersion": "0.3.1",
"type": "macvlan",
"master": "ens4",
"mode": "bridge",
"ipam": {
"type": "whereabouts",
"range": "10.2.128.0/24",
"exclude": [
"10.2.128.10/32",
"10.2.128.11/32",
"10.2.128.12/32",
"10.2.128.254/32"
]
}
}'
---
apiVersion: v1
kind: Pod
metadata:
name: fedora-net1
annotations:
k8s.v1.cni.cncf.io/networks: '[ { "name": "macvlan1" } ]'
spec:
containers:
- name: fedora-net1
image: ghcr.io/redhat-nfvpe/multus-service-demo:fedora-tools
imagePullPolicy: Always
command:
- /sbin/init
securityContext:
privileged: true
---
kind: Service
apiVersion: v1
metadata:
name: multus-nginx-macvlan
labels:
service.kubernetes.io/service-proxy-name: multus-proxy
annotations:
k8s.v1.cni.cncf.io/service-network: macvlan1
spec:
selector:
app: multus-nginx-macvlan
ports:
- protocol: TCP
port: 80
---
apiVersion: v1
kind: ConfigMap
metadata:
name: multus-nginx-macvlan-conf
data:
index.html: |
<!DOCTYPE html>
<html>
<body>
This is multus-nginx-macvlan!
</body>
</html>
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: multus-nginx-macvlan
spec:
selector:
matchLabels:
app: multus-nginx-macvlan
replicas: 2
template:
metadata:
labels:
app: multus-nginx-macvlan
annotations:
k8s.v1.cni.cncf.io/networks: '[
{ "name": "macvlan1" } ]'
spec:
containers:
- name: multus-nginx
image: ghcr.io/redhat-nfvpe/multus-service-demo:fedora-nginx
ports:
- containerPort: 80
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
volumeMounts:
- mountPath: /usr/share/nginx/html
name: multus-nginx-macvlan-conf
volumes:
- name: multus-nginx-macvlan-conf
configMap:
name: multus-nginx-macvlan-conf