Skip to content

Commit

Permalink
update kube-router v0.2.0-beta.9
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Aug 12, 2018
1 parent c7e4ac7 commit e10b9e6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
10 changes: 5 additions & 5 deletions down/offline_images
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ mirrorgooglecontainers/k8s-dns-sidecar-amd64:1.14.10
# metrics-server 插件
mirrorgooglecontainers/metrics-server-amd64:v0.2.1
# calico 网络插件
calico/node:v3.0.6
calico/cni:v2.0.5
calico/kube-controllers:v2.0.4
calico/node:v3.1.3
calico/cni:v3.1.3
calico/kube-controllers:v3.1.3
# flannel 网络插件
jmgao1983/flannel:v0.10.0-amd64
# kube-router 网络插件
cloudnativelabs/kube-router
busybox
cloudnativelabs/kube-router:v0.2.0-beta.9
busybox:1.28.4
# dashboard 插件
mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.8.3
# pause 基础容器镜像
Expand Down
6 changes: 4 additions & 2 deletions roles/kube-router/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ FIREWALL_ENABLE: "true"
SERVICE_PROXY: "false"

# kube-router 镜像版本
IMAGE: "cloudnativelabs/kube-router"
kube_router_ver: "v0.2.0-beta.9"
busybox_ver: "1.28.4"
PullPolicy: "IfNotPresent"

# kube-router 离线镜像tar包
kuberouter_offline: "kube-router_v0.2.0-beta.7.tar"
kuberouter_offline: "kube-router_{{ kube_router_ver }}.tar"
busybox_offline: "busybox_{{ busybox_ver }}.tar"
17 changes: 8 additions & 9 deletions roles/kube-router/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
template: src=kuberouter.yaml.j2 dest=/opt/kube/kube-system/kube-router/kuberouter.yaml
when: 'SERVICE_PROXY != "true"'

# kube-router 带service proxy (IPVS/LVS)
- name: 停止 kube-proxy 服务
service: name=kube-proxy state=stopped enabled=no
when: 'SERVICE_PROXY == "true"'
Expand All @@ -28,7 +29,6 @@
when: 'SERVICE_PROXY == "true"'
ignore_errors: true

# kube-router 带service proxy (IPVS/LVS)
- name: 准备配置 kube-router DaemonSet (with IPVS)
template: src=kuberouter-all.yaml.j2 dest=/opt/kube/kube-system/kube-router/kuberouter.yaml
when: 'SERVICE_PROXY == "true"'
Expand All @@ -39,6 +39,7 @@
with_items:
- "pause_3.1.tar"
- "{{ kuberouter_offline }}"
- "{{ busybox_offline }}"
ignore_errors: true

- name: 获取目录下离线镜像信息
Expand All @@ -47,14 +48,12 @@

# 如果目录下有离线镜像,就把它导入到node节点上
- name: 导入 kube-router的离线镜像(若执行失败,可忽略)
shell: "{{ bin_dir }}/docker load -i /opt/kube/images/{{ kuberouter_offline }}"
when: 'kuberouter_offline in image_info.stdout'
ignore_errors: true

# 如果目录下有离线镜像,就把它导入到node节点上
- name: 导入 pause的离线镜像(若执行失败,可忽略)
shell: "{{ bin_dir }}/docker load -i /opt/kube/images/pause_3.1.tar"
when: '"pause_3" in image_info.stdout'
shell: "{{ bin_dir }}/docker load -i /opt/kube/images/{{ item }}"
when: 'item in image_info.stdout'
with_items:
- "pause_3.1.tar"
- "{{ kuberouter_offline }}"
- "{{ busybox_offline }}"
ignore_errors: true

# 只需单节点执行一次
Expand Down
4 changes: 2 additions & 2 deletions roles/kube-router/templates/kuberouter-all.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
serviceAccountName: kube-router
containers:
- name: kube-router
image: {{ IMAGE }}
image: cloudnativelabs/kube-router:{{ kube_router_ver }}
imagePullPolicy: {{ PullPolicy }}
args:
- "--run-router=true"
Expand Down Expand Up @@ -93,7 +93,7 @@ spec:
readOnly: true
initContainers:
- name: install-cni
image: busybox
image: busybox:{{ busybox_ver }}
imagePullPolicy: {{ PullPolicy }}
command:
- /bin/sh
Expand Down
4 changes: 2 additions & 2 deletions roles/kube-router/templates/kuberouter.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
serviceAccountName: kube-router
containers:
- name: kube-router
image: {{ IMAGE }}
image: cloudnativelabs/kube-router:{{ kube_router_ver }}
imagePullPolicy: {{ PullPolicy }}
args:
- "--run-router=true"
Expand Down Expand Up @@ -70,7 +70,7 @@ spec:
mountPath: /etc/cni/net.d
initContainers:
- name: install-cni
image: busybox
image: busybox:{{ busybox_ver }}
imagePullPolicy: {{ PullPolicy }}
command:
- /bin/sh
Expand Down

0 comments on commit e10b9e6

Please sign in to comment.