Skip to content

Commit

Permalink
Merge pull request #6714 from sapcc/capi-qa-de-6
Browse files Browse the repository at this point in the history
[kube-flannel-capi] cni config
  • Loading branch information
xsen84 committed Jun 21, 2024
2 parents dab2c78 + ddb029d commit 037e5a1
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
20 changes: 17 additions & 3 deletions system/kube-flannel-capi/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ spec:
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
initContainers:
- name: flannel-cni
image: "{{ required ".Values.image.image is missing" .Values.image.image }}:{{ required ".Values.image.tag is missing" .Values.image.tag }}"
command:
- cp
args:
- -f
- /tmp/flannel/flannel-cni.conf
- /etc/cni/net.d/flannel-cni.conf
volumeMounts:
- name: flannel-cfg
mountPath: /tmp/flannel/
- name: cni-cfg
mountPath: /etc/cni/net.d
containers:
- name: kube-flannel
image: "{{ required ".Values.image.image is missing" .Values.image.image }}:{{ required ".Values.image.tag is missing" .Values.image.tag }}"
Expand Down Expand Up @@ -94,9 +108,6 @@ spec:
- name: run
hostPath:
path: /run
- name: flannel-cfg
hostPath:
path: /etc/kube-flannel/
- name: cni-cfg
hostPath:
path: /etc/cni/net.d
Expand All @@ -106,3 +117,6 @@ spec:
- name: kubelet-dir
hostPath:
path: /var/lib/kubelet
- name: flannel-cfg
configMap:
name: flannel-cfg
39 changes: 39 additions & 0 deletions system/kube-flannel-capi/templates/flannel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
kind: ConfigMap
apiVersion: v1
metadata:
name: flannel-cfg
namespace: kube-system
labels:
tier: node
app: flannel
data:
flannel-cni.conf: |
{
"name": "cbr0",
"cniVersion": "0.3.1",
"plugins": [
{
"type": "flannel",
"delegate": {
"bridge": "cbr0",
"hairpinMode": true,
"isDefaultGateway": true,
"mtu": 1500
}
},
{
"type": "portmap",
"capabilities": {
"portMappings": true
}
}
]
}
net-conf.json: |
{
"Network": "{{ .Values.clusterCIDR }}",
"Backend": {
"Type": "vxlan"
}
}

0 comments on commit 037e5a1

Please sign in to comment.