update flannel v0.21.4

pull/1282/head
gjmzj 2023-04-24 20:01:19 +08:00
parent cc897950c8
commit f9185ab56a
2 changed files with 109 additions and 92 deletions

16
ezdown
View File

@ -32,7 +32,7 @@ pauseVer=3.9
# images not downloaded by default(only download with '-X') # images not downloaded by default(only download with '-X')
ciliumVer=1.13.2 ciliumVer=1.13.2
flannelVer=v0.19.2 flannelVer=v0.21.4
nfsProvisionerVer=v4.0.2 nfsProvisionerVer=v4.0.2
promChartVer=39.11.0 promChartVer=39.11.0
@ -390,16 +390,16 @@ function get_extra_images() {
# flannel # flannel
if [[ ! -f "$imageDir/flannel_$flannelVer.tar" ]];then if [[ ! -f "$imageDir/flannel_$flannelVer.tar" ]];then
docker pull "rancher/mirrored-flannelcni-flannel:$flannelVer" && \ docker pull "flannel/flannel:$flannelVer" && \
docker pull "rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.0" && \ docker pull "flannel/flannel-cni-plugin:v1.1.2" && \
docker save -o "$imageDir/flannel_$flannelVer.tar" "rancher/mirrored-flannelcni-flannel:$flannelVer" "rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.0" docker save -o "$imageDir/flannel_$flannelVer.tar" "flannel/flannel:$flannelVer" "flannel/flannel-cni-plugin:v1.1.2"
else else
docker load -i "$imageDir/flannel_$flannelVer.tar" docker load -i "$imageDir/flannel_$flannelVer.tar"
fi fi
docker tag "rancher/mirrored-flannelcni-flannel:$flannelVer" "easzlab.io.local:5000/flannelcni/flannel:$flannelVer" docker tag "flannel/flannel:$flannelVer" "easzlab.io.local:5000/flannel/flannel:$flannelVer"
docker push "easzlab.io.local:5000/flannelcni/flannel:$flannelVer" docker push "easzlab.io.local:5000/flannel/flannel:$flannelVer"
docker tag "rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.0" "easzlab.io.local:5000/flannelcni/flannel-cni-plugin:v1.1.0" docker tag "flannel/flannel-cni-plugin:v1.1.2" "easzlab.io.local:5000/flannel/flannel-cni-plugin:v1.1.2"
docker push "easzlab.io.local:5000/flannelcni/flannel-cni-plugin:v1.1.0" docker push "easzlab.io.local:5000/flannel/flannel-cni-plugin:v1.1.2"
# nfs-provisioner # nfs-provisioner
if [[ ! -f "$imageDir/nfs-provisioner_$nfsProvisionerVer.tar" ]];then if [[ ! -f "$imageDir/nfs-provisioner_$nfsProvisionerVer.tar" ]];then

View File

@ -1,7 +1,17 @@
--- ---
kind: ClusterRole apiVersion: v1
apiVersion: rbac.authorization.k8s.io/v1 kind: ServiceAccount
metadata: metadata:
labels:
k8s-app: flannel
name: flannel
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
k8s-app: flannel
name: flannel name: flannel
rules: rules:
- apiGroups: - apiGroups:
@ -15,6 +25,7 @@ rules:
resources: resources:
- nodes - nodes
verbs: verbs:
- get
- list - list
- watch - watch
- apiGroups: - apiGroups:
@ -23,10 +34,19 @@ rules:
- nodes/status - nodes/status
verbs: verbs:
- patch - patch
- apiGroups:
- networking.k8s.io
resources:
- clustercidrs
verbs:
- list
- watch
--- ---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata: metadata:
labels:
k8s-app: flannel
name: flannel name: flannel
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
@ -38,19 +58,6 @@ subjects:
namespace: kube-system namespace: kube-system
--- ---
apiVersion: v1 apiVersion: v1
kind: ServiceAccount
metadata:
name: flannel
namespace: kube-system
---
kind: ConfigMap
apiVersion: v1
metadata:
name: kube-flannel-cfg
namespace: kube-system
labels:
tier: node
app: flannel
data: data:
cni-conf.json: | cni-conf.json: |
{ {
@ -82,24 +89,35 @@ data:
"Type": "{{ FLANNEL_BACKEND }}" "Type": "{{ FLANNEL_BACKEND }}"
} }
} }
kind: ConfigMap
metadata:
labels:
app: flannel
k8s-app: flannel
tier: node
name: kube-flannel-cfg
namespace: kube-system
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
labels:
app: flannel
k8s-app: flannel
tier: node
name: kube-flannel-ds name: kube-flannel-ds
namespace: kube-system namespace: kube-system
labels:
tier: node
app: flannel
spec: spec:
selector: selector:
matchLabels: matchLabels:
app: flannel app: flannel
k8s-app: flannel
template: template:
metadata: metadata:
labels: labels:
tier: node
app: flannel app: flannel
k8s-app: flannel
tier: node
spec: spec:
affinity: affinity:
nodeAffinity: nodeAffinity:
@ -110,56 +128,12 @@ spec:
operator: In operator: In
values: values:
- linux - linux
hostNetwork: true
priorityClassName: system-node-critical
tolerations:
- operator: Exists
effect: NoSchedule
serviceAccountName: flannel
initContainers:
- name: install-cni-plugin
image: easzlab.io.local:5000/flannelcni/flannel-cni-plugin:v1.1.0
command:
- cp
args:
- -f
- /flannel
- /opt/cni/bin/flannel
volumeMounts:
- name: cni-plugin
mountPath: /opt/cni/bin
- name: install-cni
image: easzlab.io.local:5000/flannelcni/flannel:{{ flannel_ver }}
command:
- cp
args:
- -f
- /etc/kube-flannel/cni-conf.json
- /etc/cni/net.d/10-flannel.conflist
volumeMounts:
- name: cni
mountPath: /etc/cni/net.d
- name: flannel-cfg
mountPath: /etc/kube-flannel/
containers: containers:
- name: kube-flannel - args:
image: easzlab.io.local:5000/flannelcni/flannel:{{ flannel_ver }}
command:
- /opt/bin/flanneld
args:
- --ip-masq - --ip-masq
- --kube-subnet-mgr - --kube-subnet-mgr
resources: command:
requests: - /opt/bin/flanneld
cpu: "100m"
memory: "50Mi"
limits:
cpu: "100m"
memory: "50Mi"
securityContext:
privileged: false
capabilities:
add: ["NET_ADMIN", "NET_RAW"]
env: env:
- name: POD_NAME - name: POD_NAME
valueFrom: valueFrom:
@ -171,27 +145,70 @@ spec:
fieldPath: metadata.namespace fieldPath: metadata.namespace
- name: EVENT_QUEUE_DEPTH - name: EVENT_QUEUE_DEPTH
value: "5000" value: "5000"
image: easzlab.io.local:5000/flannel/flannel:{{ flannel_ver }}
name: kube-flannel
resources:
requests:
cpu: 100m
memory: 50Mi
securityContext:
capabilities:
add:
- NET_ADMIN
- NET_RAW
privileged: false
volumeMounts: volumeMounts:
- name: run - mountPath: /run/flannel
mountPath: /run/flannel name: run
- name: flannel-cfg - mountPath: /etc/kube-flannel/
mountPath: /etc/kube-flannel/ name: flannel-cfg
- name: xtables-lock - mountPath: /run/xtables.lock
mountPath: /run/xtables.lock name: xtables-lock
hostNetwork: true
initContainers:
- args:
- -f
- /flannel
- /opt/cni/bin/flannel
command:
- cp
image: easzlab.io.local:5000/flannel/flannel-cni-plugin:v1.1.2
name: install-cni-plugin
volumeMounts:
- mountPath: /opt/cni/bin
name: cni-plugin
- args:
- -f
- /etc/kube-flannel/cni-conf.json
- /etc/cni/net.d/10-flannel.conflist
command:
- cp
image: easzlab.io.local:5000/flannel/flannel:{{ flannel_ver }}
name: install-cni
volumeMounts:
- mountPath: /etc/cni/net.d
name: cni
- mountPath: /etc/kube-flannel/
name: flannel-cfg
priorityClassName: system-node-critical
serviceAccountName: flannel
tolerations:
- effect: NoSchedule
operator: Exists
volumes: volumes:
- name: run - hostPath:
hostPath:
path: /run/flannel path: /run/flannel
- name: cni-plugin name: run
hostPath: - hostPath:
path: /opt/cni/bin path: /opt/cni/bin
- name: cni name: cni-plugin
hostPath: - hostPath:
path: /etc/cni/net.d path: /etc/cni/net.d
- name: flannel-cfg name: cni
configMap: - configMap:
name: kube-flannel-cfg name: kube-flannel-cfg
- name: xtables-lock name: flannel-cfg
hostPath: - hostPath:
path: /run/xtables.lock path: /run/xtables.lock
type: FileOrCreate type: FileOrCreate
name: xtables-lock