2017-08-25 07:07:50 +00:00
---
kind: ConfigMap
apiVersion: v1
metadata:
name: kube-flannel-cfg
2018-03-30 11:29:13 +00:00
namespace: "kube-system"
2017-08-25 07:07:50 +00:00
labels:
tier: node
app: flannel
data:
cni-conf.json: |
{
2017-10-16 06:11:38 +00:00
"name":"cni0",
2017-08-25 07:07:50 +00:00
"cniVersion":"0.3.1",
"plugins":[
{
"type":"flannel",
"delegate":{
"forceAddress":true,
2017-11-21 10:42:53 +00:00
"hairpinMode": true,
2017-08-25 07:07:50 +00:00
"isDefaultGateway":true
}
},
{
"type":"portmap",
"capabilities":{
"portMappings":true
}
}
]
}
net-conf.json: |
{
"Network": "{{ kube_pods_subnet }}",
"Backend": {
"Type": "{{ flannel_backend_type }}"
}
}
---
2019-09-10 19:06:55 +00:00
apiVersion: apps/v1
2017-08-25 07:07:50 +00:00
kind: DaemonSet
metadata:
name: kube-flannel
2018-03-30 11:29:13 +00:00
namespace: "kube-system"
2017-08-25 07:07:50 +00:00
labels:
tier: node
k8s-app: flannel
spec:
2019-09-10 19:06:55 +00:00
selector:
matchLabels:
tier: node
k8s-app: flannel
2017-08-25 07:07:50 +00:00
template:
metadata:
labels:
tier: node
k8s-app: flannel
spec:
2018-09-25 14:50:22 +00:00
priorityClassName: system-node-critical
2017-08-25 07:07:50 +00:00
serviceAccountName: flannel
2018-06-05 11:15:20 +00:00
nodeSelector:
beta.kubernetes.io/os: linux
2017-08-25 07:07:50 +00:00
containers:
- name: kube-flannel
image: {{ flannel_image_repo }}:{{ flannel_image_tag }}
imagePullPolicy: {{ k8s_image_pull_policy }}
resources:
limits:
cpu: {{ flannel_cpu_limit }}
memory: {{ flannel_memory_limit }}
requests:
cpu: {{ flannel_cpu_requests }}
memory: {{ flannel_memory_requests }}
2018-03-16 18:44:36 +00:00
command: [ "/opt/bin/flanneld", "--ip-masq", "--kube-subnet-mgr"{% if flannel_interface is defined %}, "--iface={{ flannel_interface }}"{% endif %}{% if flannel_interface_regexp is defined %}, "--iface-regex={{ flannel_interface_regexp }}"{% endif %} ]
2017-08-25 07:07:50 +00:00
securityContext:
privileged: true
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
2018-10-01 07:06:13 +00:00
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
2017-08-25 07:07:50 +00:00
volumeMounts:
- name: run
mountPath: /run
- name: cni
mountPath: /etc/cni/net.d
- name: flannel-cfg
mountPath: /etc/kube-flannel/
- name: install-cni
image: {{ flannel_cni_image_repo }}:{{ flannel_cni_image_tag }}
command: ["/install-cni.sh"]
env:
# The CNI network config to install on each node.
- name: CNI_NETWORK_CONFIG
valueFrom:
configMapKeyRef:
name: kube-flannel-cfg
key: cni-conf.json
- name: CNI_CONF_NAME
value: "10-flannel.conflist"
volumeMounts:
- name: cni
mountPath: /host/etc/cni/net.d
- name: host-cni-bin
mountPath: /host/opt/cni/bin/
hostNetwork: true
2019-06-05 10:17:56 +00:00
dnsPolicy: ClusterFirstWithHostNet
2017-08-25 07:07:50 +00:00
tolerations:
2018-09-27 12:28:54 +00:00
- operator: Exists
# Mark pod as critical for rescheduling (Will have no effect starting with kubernetes 1.12)
- key: CriticalAddonsOnly
operator: "Exists"
2017-08-25 07:07:50 +00:00
volumes:
- name: run
hostPath:
path: /run
- name: cni
hostPath:
path: /etc/cni/net.d
- name: flannel-cfg
configMap:
name: kube-flannel-cfg
- name: host-cni-bin
hostPath:
path: /opt/cni/bin
updateStrategy:
rollingUpdate:
2017-09-15 12:19:37 +00:00
maxUnavailable: {{ serial | default('20%') }}
type: RollingUpdate