-
Notifications
You must be signed in to change notification settings - Fork 3
/
vip-daemonset.yaml
75 lines (75 loc) · 2.03 KB
/
vip-daemonset.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
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-keepalived-vip
namespace: keepalived
labels:
k8s-app: kube-keepalived-vip
spec:
selector:
matchLabels:
k8s-app: kube-keepalived-vip
template:
metadata:
labels:
k8s-app: kube-keepalived-vip
app: nginx-sidecar
spec:
serviceAccount: kube-vip
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: lb
operator: NotIn
values:
- nginx
hostNetwork: true
containers:
- name: nginx-sidecar
image: onlineshop/nginx
ports:
- containerPort: 80
- image: 10.10.101.175/library/kube-keepalived-vip:0.35
name: kube-keepalived-vip
imagePullPolicy: Always
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
timeoutSeconds: 3
securityContext:
privileged: true
volumeMounts:
- mountPath: /lib/modules
name: modules
readOnly: true
- mountPath: /dev
name: dev
# use downward API
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
# to use unicast
args:
- --services-configmap=default/vip-configmap
# unicast uses the ip of the nodes instead of multicast
# this is useful if running in cloud providers (like AWS)
#- --use-unicast=true
volumes:
- name: modules
hostPath:
path: /lib/modules
- name: dev
hostPath:
path: /dev
#nodeSelector:
# # type: worker