Browse Source

add bootstrap for debian (#1726)

pull/1734/merge
Matthew Mosesohn 7 years ago
committed by GitHub
parent
commit
e42cb43ca5
4 changed files with 29 additions and 2 deletions
  1. 3
      .gitlab-ci.yml
  2. 23
      roles/bootstrap-os/tasks/bootstrap-debian.yml
  3. 3
      roles/bootstrap-os/tasks/main.yml
  4. 2
      roles/kubernetes/master/templates/manifests/kube-controller-manager.manifest.j2

3
.gitlab-ci.yml

@ -81,7 +81,7 @@ before_script:
- echo $GCE_CREDENTIALS > $HOME/.ssh/gce.json
- chmod 400 $HOME/.ssh/id_rsa
- ansible-playbook --version
- export PYPATH=$([ $BOOTSTRAP_OS = none ] && echo /usr/bin/python || echo /opt/bin/python)
- export PYPATH=$([ "$BOOTSTRAP_OS" != "coreos" ] && echo /usr/bin/python || echo /opt/bin/python)
script:
- pwd
- ls
@ -345,6 +345,7 @@ before_script:
CLOUD_IMAGE: debian-8-kubespray
CLOUD_REGION: us-central1-b
CLUSTER_MODE: default
BOOTSTRAP_OS: debian
STARTUP_SCRIPT: ""
.coreos_canal_variables: &coreos_canal_variables

23
roles/bootstrap-os/tasks/bootstrap-debian.yml

@ -0,0 +1,23 @@
---
# raw: cat /etc/issue.net | grep '{{ bootstrap_versions }}'
- name: Bootstrap | Check if bootstrap is needed
raw: which "{{ item }}"
register: need_bootstrap
failed_when: false
with_items:
- python
- pip
- dbus-daemon
tags: facts
- name: Bootstrap | Install python 2.x, pip, and dbus
raw:
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y python-minimal python-pip dbus
when:
"{{ need_bootstrap.results | map(attribute='rc') | sort | last | bool }}"
- set_fact:
ansible_python_interpreter: "/usr/bin/python"
tags: facts

3
roles/bootstrap-os/tasks/main.yml

@ -2,6 +2,9 @@
- include: bootstrap-ubuntu.yml
when: bootstrap_os == "ubuntu"
- include: bootstrap-debian.yml
when: bootstrap_os == "debian"
- include: bootstrap-coreos.yml
when: bootstrap_os == "coreos"

2
roles/kubernetes/master/templates/manifests/kube-controller-manager.manifest.j2

@ -50,7 +50,7 @@ spec:
{% if kube_network_plugin is defined and kube_network_plugin == 'cloud' %}
- --configure-cloud-routes=true
{% endif %}
{% if kube_network_plugin is defined and kube_network_plugin in ["cloud", "flannel"] %}
{% if kube_network_plugin is defined and kube_network_plugin in ["cloud", "flannel", "canal"] %}
- --allocate-node-cidrs=true
- --cluster-cidr={{ kube_pods_subnet }}
- --service-cluster-ip-range={{ kube_service_addresses }}

Loading…
Cancel
Save