Merge pull request #858 from bradbeam/calicoctl-canal

Misc updates for canal
This commit is contained in:
Bogdan Dobrelya 2017-01-10 12:24:59 +01:00 committed by GitHub
commit 79aeb10431
3 changed files with 37 additions and 0 deletions

View file

@ -14,6 +14,9 @@ canal_log_level: "info"
canal_cert_dir: /etc/canal/certs canal_cert_dir: /etc/canal/certs
etcd_cert_dir: /etc/ssl/etcd/ssl etcd_cert_dir: /etc/ssl/etcd/ssl
# Canal Network Policy directory
canal_policy_dir: /etc/kubernetes/policy
# Limits for apps # Limits for apps
calico_node_memory_limit: 500M calico_node_memory_limit: 500M
calico_node_cpu_limit: 200m calico_node_cpu_limit: 200m
@ -23,3 +26,8 @@ flannel_memory_limit: 500M
flannel_cpu_limit: 200m flannel_cpu_limit: 200m
flannel_memory_requests: 256M flannel_memory_requests: 256M
flannel_cpu_requests: 100m flannel_cpu_requests: 100m
calicoctl_memory_limit: 170M
calicoctl_cpu_limit: 100m
calicoctl_memory_requests: 70M
calicoctl_cpu_requests: 50m

View file

@ -59,3 +59,17 @@
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
changed_when: false changed_when: false
tags: [hyperkube, upgrade] tags: [hyperkube, upgrade]
- name: Canal | Install calicoctl container script
template:
src: calicoctl-container.j2
dest: "{{ bin_dir }}/calicoctl"
mode: 0755
owner: root
group: root
changed_when: false
- name: Canal | Create network policy directory
file:
path: "{{ canal_policy_dir }}"
state: directory

View file

@ -0,0 +1,15 @@
#!/bin/bash
{{ docker_bin_dir }}/docker run -i --privileged --rm \
--net=host --pid=host \
-e ETCD_ENDPOINTS={{ etcd_access_endpoint }} \
-e ETCD_CA_CERT_FILE={{ canal_cert_dir }}/ca_cert.crt \
-e ETCD_CERT_FILE={{ canal_cert_dir }}/cert.crt \
-e ETCD_KEY_FILE={{ canal_cert_dir }}/key.pem \
-v {{ docker_bin_dir }}/docker:{{ docker_bin_dir }}/docker \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/run/calico:/var/run/calico \
-v {{ canal_cert_dir }}:{{ canal_cert_dir }}:ro \
-v {{ canal_policy_dir }}:{{ canal_policy_dir }}:ro \
--memory={{ calicoctl_memory_limit|regex_replace('Mi', 'M') }} --cpu-shares={{ calicoctl_cpu_limit|regex_replace('m', '') }} \
{{ calicoctl_image_repo }}:{{ calicoctl_image_tag}} \
$@