Merge pull request #8735 from hakman/kube-router-0.4.0

Update kube-router to v0.4.0
This commit is contained in:
Kubernetes Prow Robot 2020-03-13 09:30:40 -07:00 committed by GitHub
commit d9eaec6281
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 70 additions and 72 deletions

View File

@ -1,6 +1,5 @@
# Pulled and modified from https://github.com/cloudnativelabs/kube-router/blob/v0.3.1/daemonset/generic-kuberouter-all-features.yaml # Pulled and modified from https://github.com/cloudnativelabs/kube-router/blob/v0.4.0/daemonset/generic-kuberouter-all-features.yaml
---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
@ -12,19 +11,19 @@ metadata:
data: data:
cni-conf.json: | cni-conf.json: |
{ {
"cniVersion":"0.3.0", "cniVersion":"0.3.0",
"name":"mynet", "name":"mynet",
"plugins":[ "plugins":[
{ {
"name":"kubernetes", "name":"kubernetes",
"type":"bridge", "type":"bridge",
"bridge":"kube-bridge", "bridge":"kube-bridge",
"isDefaultGateway":true, "isDefaultGateway":true,
"ipam":{ "ipam":{
"type":"host-local" "type":"host-local"
} }
} }
] ]
} }
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
@ -45,12 +44,12 @@ spec:
labels: labels:
k8s-app: kube-router k8s-app: kube-router
tier: node tier: node
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec: spec:
priorityClassName: system-node-critical
serviceAccountName: kube-router
containers: containers:
- name: kube-router - name: kube-router
image: cloudnativelabs/kube-router:v0.3.1 image: docker.io/cloudnativelabs/kube-router:v0.4.0
args: args:
- --run-router=true - --run-router=true
- --run-firewall=true - --run-firewall=true
@ -82,9 +81,6 @@ spec:
readOnly: true readOnly: true
- name: cni-conf-dir - name: cni-conf-dir
mountPath: /etc/cni/net.d mountPath: /etc/cni/net.d
- name: kubeconfig
mountPath: /var/lib/kube-router/kubeconfig
readOnly: true
initContainers: initContainers:
- name: install-cni - name: install-cni
image: busybox image: busybox
@ -93,36 +89,35 @@ spec:
- -c - -c
- set -e -x; - set -e -x;
if [ ! -f /etc/cni/net.d/10-kuberouter.conflist ]; then if [ ! -f /etc/cni/net.d/10-kuberouter.conflist ]; then
if [ -f /etc/cni/net.d/*.conf ]; then if [ -f /etc/cni/net.d/*.conf ]; then
rm -f /etc/cni/net.d/*.conf; rm -f /etc/cni/net.d/*.conf;
fi; fi;
TMP=/etc/cni/net.d/.tmp-kuberouter-cfg; TMP=/etc/cni/net.d/.tmp-kuberouter-cfg;
cp /etc/kube-router/cni-conf.json ${TMP}; cp /etc/kube-router/cni-conf.json ${TMP};
mv ${TMP} /etc/cni/net.d/10-kuberouter.conflist; mv ${TMP} /etc/cni/net.d/10-kuberouter.conflist;
fi fi
volumeMounts: volumeMounts:
- name: cni-conf-dir - mountPath: /etc/cni/net.d
mountPath: /etc/cni/net.d name: cni-conf-dir
- name: kube-router-cfg - mountPath: /etc/kube-router
mountPath: /etc/kube-router name: kube-router-cfg
hostNetwork: true hostNetwork: true
priorityClassName: system-node-critical
serviceAccountName: kube-router
tolerations: tolerations:
- key: CriticalAddonsOnly - key: CriticalAddonsOnly
operator: Exists operator: Exists
- effect: NoSchedule - effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/not-ready
operator: Exists operator: Exists
volumes: volumes:
- hostPath: - name: lib-modules
path: /lib/modules
name: lib-modules
- hostPath:
path: /etc/cni/net.d
name: cni-conf-dir
- name: kubeconfig
hostPath: hostPath:
path: /var/lib/kube-router/kubeconfig path: /lib/modules
- name: cni-conf-dir
hostPath:
path: /etc/cni/net.d
- name: kube-router-cfg - name: kube-router-cfg
configMap: configMap:
name: kube-router-cfg name: kube-router-cfg
@ -133,38 +128,40 @@ metadata:
name: kube-router name: kube-router
namespace: kube-system namespace: kube-system
--- ---
# Kube-router roles
kind: ClusterRole kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
metadata: metadata:
name: kube-router name: kube-router
namespace: kube-system namespace: kube-system
rules: rules:
- apiGroups: [""] - apiGroups:
resources: - ""
- namespaces resources:
- pods - namespaces
- services - pods
- nodes - services
- endpoints - nodes
verbs: - endpoints
- get verbs:
- list - list
- watch - get
- apiGroups: ["networking.k8s.io"] - watch
resources: - apiGroups:
- networkpolicies - "networking.k8s.io"
verbs: resources:
- get - networkpolicies
- list verbs:
- watch - list
- apiGroups: ["extensions"] - get
resources: - watch
- networkpolicies - apiGroups:
verbs: - extensions
- get resources:
- list - networkpolicies
- watch verbs:
- get
- list
- watch
--- ---
kind: ClusterRoleBinding kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
@ -178,5 +175,3 @@ subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: kube-router name: kube-router
namespace: kube-system namespace: kube-system
- kind: User
name: system:kube-router

View File

@ -795,7 +795,10 @@ func (b *BootstrapChannelBuilder) buildAddons() *channelsapi.Addons {
if b.cluster.Spec.Networking.Kuberouter != nil { if b.cluster.Spec.Networking.Kuberouter != nil {
key := "networking.kuberouter" key := "networking.kuberouter"
version := "0.3.1-kops.3" versions := map[string]string{
"k8s-1.6": "3.1.0-kops.3",
"k8s-1.12": "0.4.0-kops.1",
}
{ {
location := key + "/k8s-1.6.yaml" location := key + "/k8s-1.6.yaml"
@ -803,7 +806,7 @@ func (b *BootstrapChannelBuilder) buildAddons() *channelsapi.Addons {
addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{ addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{
Name: fi.String(key), Name: fi.String(key),
Version: fi.String(version), Version: fi.String(versions[id]),
Selector: networkingSelector, Selector: networkingSelector,
Manifest: fi.String(location), Manifest: fi.String(location),
KubernetesVersion: "<1.12.0", KubernetesVersion: "<1.12.0",
@ -817,7 +820,7 @@ func (b *BootstrapChannelBuilder) buildAddons() *channelsapi.Addons {
addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{ addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{
Name: fi.String(key), Name: fi.String(key),
Version: fi.String(version), Version: fi.String(versions[id]),
Selector: networkingSelector, Selector: networkingSelector,
Manifest: fi.String(location), Manifest: fi.String(location),
KubernetesVersion: ">=1.12.0", KubernetesVersion: ">=1.12.0",