Skip to content

Commit

Permalink
Updated Flannel to v0.26.4 and fixed values for automation
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Bonafiglia <[email protected]>
  • Loading branch information
rbrtbnfgl committed Feb 5, 2025
1 parent 028d966 commit 92f09a7
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
sources:
-- https://github.com/flannel-io/flannel
+- https://github.com/rancher/rke2-charts
version: v0.26.3
version: v0.26.4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- charts-original/templates/daemonset.yaml
+++ charts/templates/daemonset.yaml
@@ -33,19 +33,13 @@
@@ -33,20 +33,13 @@
{{- end }}
serviceAccountName: flannel
initContainers:
Expand All @@ -17,23 +17,27 @@
volumeMounts:
- name: cni-plugin
- mountPath: /opt/cni/bin
- {{- if not .Values.flannel.skipCNIConfigInstallation }}
+ mountPath: /host/opt/cni/bin
- name: install-cni
- image: {{ .Values.flannel.image.repository }}:{{ .Values.flannel.image.tag }}
+ image: {{ template "system_default_registry" . }}{{ .Values.flannel.image.repository }}:{{ .Values.flannel.image.tag }}
command:
- cp
args:
@@ -59,7 +53,7 @@
@@ -58,10 +51,9 @@
mountPath: /etc/cni/net.d
- name: flannel-cfg
mountPath: /etc/kube-flannel/
- {{- end }}
containers:
- name: kube-flannel
- image: {{ .Values.flannel.image.repository }}:{{ .Values.flannel.image.tag }}
+ image: {{ template "system_default_registry" . }}{{ .Values.flannel.image.repository }}:{{ .Values.flannel.image.tag }}
command:
- "/opt/bin/flanneld"
{{- range .Values.flannel.args }}
@@ -70,7 +64,7 @@
@@ -72,7 +64,7 @@
cpu: "100m"
memory: "50Mi"
securityContext:
Expand All @@ -42,7 +46,7 @@
capabilities:
add: ["NET_ADMIN", "NET_RAW"]
env:
@@ -91,39 +85,14 @@
@@ -93,44 +85,14 @@
mountPath: /etc/kube-flannel/
- name: xtables-lock
mountPath: /run/xtables.lock
Expand All @@ -54,6 +58,11 @@
- {{- range .Values.netpol.args }}
- - {{ . | quote }}
- {{- end }}
- env:
- - name: MY_NODE_NAME
- valueFrom:
- fieldRef:
- fieldPath: spec.nodeName
- volumeMounts:
- - name: lib-modules
- mountPath: /lib/modules
Expand Down
23 changes: 13 additions & 10 deletions packages/rke2-flannel/generated-changes/patch/values.yaml.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- charts-original/values.yaml
+++ charts/values.yaml
@@ -1,21 +1,12 @@
@@ -1,24 +1,12 @@
---
-global:
- imagePullSecrets:
Expand All @@ -14,19 +14,22 @@
flannel:
# kube-flannel image
image:
- repository: docker.io/flannel/flannel
- tag: v0.26.3
- repository: ghcr.io/flannel-io/flannel
- tag: v0.26.4
+ repository: rancher/hardened-flannel
+ tag: v0.26.3-build20250108
+ tag: v0.26.4-build20250205
image_cni:
- repository: docker.io/flannel/flannel-cni-plugin
- tag: v1.6.0-flannel1
+ repository: rancher/hardened-cni-plugins
- repository: ghcr.io/flannel-io/flannel-cni-plugin
- tag: v1.6.2-flannel1
- # skipCNIConfigInstallation skips the installation of the flannel CNI config. This is useful when the CNI config is
- # provided externally.
- skipCNIConfigInstallation: false
+ repository: rancher/cni-plugins
+ tag: v1.6.2-build20250124
# flannel command arguments
enableNFTables: false
args:
@@ -26,14 +17,14 @@
@@ -29,14 +17,14 @@
# Documentation at https://github.com/flannel-io/flannel/blob/master/Documentation/backends.md
backend: "vxlan"
# Port used by the backend 0 means default value (VXLAN: 8472, Wireguard: 51821, UDP: 8285)
Expand All @@ -43,7 +46,7 @@
# Enable VXLAN Group Based Policy (Default false)
# GBP: false
# Enable direct routes (default is false)
@@ -55,16 +46,18 @@
@@ -58,16 +46,18 @@
# General daemonset configs
#
tolerations:
Expand All @@ -69,7 +72,7 @@
- - "--v=2"
- image:
- repository: registry.k8s.io/networking/kube-network-policies
- tag: v0.4.0
- tag: v0.7.0
+global:
+ systemDefaultRegistry: ""
+ clusterCIDRv4: ""
Expand Down
4 changes: 2 additions & 2 deletions packages/rke2-flannel/package.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
url: https://github.com/flannel-io/flannel/releases/download/v0.26.3/flannel.tgz
packageVersion: 02
url: https://github.com/flannel-io/flannel/releases/download/v0.26.4/flannel.tgz
packageVersion: 00
2 changes: 1 addition & 1 deletion updatecli/scripts/update-flannel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if [ -n "$FLANNEL_VERSION" ]; then
current_netpol_version=$(yq '.netpol.image.tag' workdir/flannel/values.yaml)
new_netpol_version=$(yq '.netpol.image.tag' workdir/flannel/values_new.yaml)
sed -i "s/ version: .*/ version: $app_version/g" packages/rke2-flannel/generated-changes/patch/Chart.yaml.patch
sed -i ":a;N;\$!ba;s/- repository: docker.io\\/flannel\\/flannel\\n- tag: $current_app_version/- repository: docker.io\\/flannel\\/flannel\\
sed -i ":a;N;\$!ba;s/- repository: ghcr.io\\/flannel-io\\/flannel\\n- tag: $current_app_version/- repository: ghcr.io\\/flannel-io\\/flannel\\
- tag: $app_version/g" packages/rke2-flannel/generated-changes/patch/values.yaml.patch
sed -i "s/+ tag: $current_flannel_version/+ tag: $FLANNEL_VERSION/g" packages/rke2-flannel/generated-changes/patch/values.yaml.patch
sed -i "s/- tag: $current_flannel_plugins_version/- tag: $new_flannel_plugins_version/g" packages/rke2-flannel/generated-changes/patch/values.yaml.patch
Expand Down

0 comments on commit 92f09a7

Please sign in to comment.