-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathinstall-iptracker.yaml
More file actions
190 lines (190 loc) · 3.97 KB
/
install-iptracker.yaml
File metadata and controls
190 lines (190 loc) · 3.97 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kube-ip-tracker
rules:
- apiGroups:
- ""
resources:
- nodes
- pods
- namespaces
verbs:
- get
- list
- watch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kube-ip-tracker
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kube-ip-tracker
subjects:
- kind: ServiceAccount
name: kube-ip-tracker
namespace: kube-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-ip-tracker
namespace: kube-system
---
apiVersion: v1
kind: Service
metadata:
name: kube-ip-tracker
namespace: kube-system
spec:
clusterIP: None
selector:
app: kube-ip-tracker
ports:
- name: grpc
port: 10999
targetPort: 10999
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: kube-ip-tracker
namespace: kube-system
labels:
app: kube-ip-tracker
k8s-app: kube-ip-tracker
spec:
replicas: 2
selector:
matchLabels:
app: kube-ip-tracker
template:
metadata:
labels:
app: kube-ip-tracker
k8s-app: kube-ip-tracker
spec:
hostNetwork: true # do not depend on the network of the cluster
serviceAccountName: kube-ip-tracker
containers:
- name: kube-ip-tracker
image: registry.k8s.io/networking/kube-ip-tracker:v0.9.2
args:
- /bin/kube-ip-tracker
- --listen-address=http://0.0.0.0:10999
- --v=2
ports:
- containerPort: 10999
name: grpc
resources:
requests:
cpu: "100m"
memory: "50Mi"
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kube-network-policies
rules:
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- "networking.k8s.io"
resources:
- networkpolicies
verbs:
- list
- watch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kube-network-policies
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kube-network-policies
subjects:
- kind: ServiceAccount
name: kube-network-policies
namespace: kube-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-network-policies
namespace: kube-system
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-network-policies
namespace: kube-system
labels:
tier: node
app: kube-network-policies
k8s-app: kube-network-policies
spec:
selector:
matchLabels:
app: kube-network-policies
template:
metadata:
labels:
tier: node
app: kube-network-policies
k8s-app: kube-network-policies
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
nodeSelector:
kubernetes.io/os: linux
tolerations:
- operator: Exists
effect: NoSchedule
serviceAccountName: kube-network-policies
containers:
- name: kube-network-policies
image: registry.k8s.io/networking/kube-network-policies:v1.0.0-iptracker
args:
- /bin/netpol
- --hostname-override=$(MY_NODE_NAME)
- --v=2
- --nfqueue-id=198
- --ip-tracker-address=kube-ip-tracker.kube-system.svc.cluster.local:10999
volumeMounts:
- name: nri-plugin
mountPath: /var/run/nri
- name: netns
mountPath: /var/run/netns
mountPropagation: HostToContainer
resources:
requests:
cpu: "100m"
memory: "50Mi"
securityContext:
privileged: true
capabilities:
add: ["NET_ADMIN"]
env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumes:
- name: nri-plugin
hostPath:
path: /var/run/nri
- name: netns
hostPath:
path: /var/run/netns
---