improve composability

* remove need for `k8s-cluster` parent group
* rename kubernetes/preinstall to kubernetes/common
* make kubernetes/common a dep for both node and master
* move all kubernetes defaults to kubernetes/common
* had python errors with new apps role ... feature flagged it off
This commit is contained in:
Paul Czarkowski 2016-06-05 17:03:40 -05:00 committed by Smana
parent ee7ac22f0d
commit 49488e1a86
21 changed files with 52 additions and 35 deletions

1
Vagrantfile vendored
View file

@ -105,7 +105,6 @@ Vagrant.configure("2") do |config|
"kube-master" => ["k8s-0[1:2]"],
# all nodes should be kube nodes
"kube-node" => ["k8s-0[1:#{$num_instances}]"],
"k8s-cluster:children" => ["kube-master", "kube-node"],
}
end
end

View file

@ -1,20 +1,30 @@
---
- hosts: k8s-cluster
- hosts: etcd
roles:
- { role: kubernetes/preinstall, tags: preinstall }
- { role: etcd, tags: etcd }
- { role: docker, tags: docker }
- { role: kubernetes/node, tags: node }
- { role: network_plugin, tags: network }
- role: etcd
tags: etcd
- hosts: kube-node
roles:
- role: kubernetes/node
tags: node
- role: docker
tags: docker
- role: network_plugin
tags: network
- hosts: kube-master
roles:
- { role: kubernetes/master, tags: master }
- role: kubernetes/master
tags: master
- hosts: k8s-cluster
- hosts: ['kube-master','kube-node']
roles:
- { role: dnsmasq, tags: dnsmasq }
- role: dnsmasq
tags: dnsmasq
- hosts: kube-master[0]
roles:
- {role: kubernetes-apps, tags: apps}
- role: kubernetes-apps
tags: apps
when: kpm_enabled|default('False')|bool

View file

@ -1,4 +1,5 @@
---
kpm_enabled: False
kpm_registry: "https://api.kpm.sh"
kpm_namespace: "default"
kpm_packages: []
kpm_packages: []

View file

@ -1,3 +1,13 @@
---
run_gitinfos: false
common_required_pkgs:
- python-httplib2
- openssl
- curl
- rsync
- bash-completion
# This directory is where all the additional scripts go
# that Kubernetes normally puts in /srv/kubernetes.
# This puts them in a sane location
@ -44,3 +54,12 @@ dns_server: "{{ kube_service_addresses|ipaddr('net')|ipaddr(253)|ipaddr('address
# kube_api_runtime_config:
# - extensions/v1beta1/daemonsets=true
# - extensions/v1beta1/deployments=true
# For the openstack integration kubelet will need credentials to access
# openstack apis like nova and cinder. Per default this values will be
# read from the environment.
openstack_auth_url: "{{ lookup('env','OS_AUTH_URL') }}"
openstack_username: "{{ lookup('env','OS_USERNAME') }}"
openstack_password: "{{ lookup('env','OS_PASSWORD') }}"
openstack_region: "{{ lookup('env','OS_REGION_NAME') }}"
openstack_tenant_id: "{{ lookup('env','OS_TENANT_ID') }}"

View file

@ -0,0 +1,4 @@
---
dependencies:
- role: adduser
user: "{{ addusers.kube }}"

View file

@ -4,5 +4,7 @@ dependencies:
file: "{{ downloads.kubernetes_kubectl }}"
- role: download
file: "{{ downloads.kubernetes_apiserver }}"
- { role: etcd }
- { role: kubernetes/node }
- role: etcd
- role: kubernetes/common
tags: kubernetes-common
- role: kubernetes/node

View file

@ -3,4 +3,4 @@ namespace_kubesystem:
apiVersion: v1
kind: Namespace
metadata:
name: kube-system
name: kube-system

View file

@ -2,4 +2,6 @@
dependencies:
- role: download
file: "{{ downloads.kubernetes_kubelet }}"
- role: kubernetes/common
tags: kubernetes-common
- role: kubernetes/secrets

View file

@ -1,20 +0,0 @@
---
run_gitinfos: false
common_required_pkgs:
- python-httplib2
- openssl
- curl
- rsync
- bash-completion
# For the openstack integration kubelet will need credentials to access
# openstack apis like nova and cinder. Per default this values will be
# read from the environment.
openstack_auth_url: "{{ lookup('env','OS_AUTH_URL') }}"
openstack_username: "{{ lookup('env','OS_USERNAME') }}"
openstack_password: "{{ lookup('env','OS_PASSWORD') }}"
openstack_region: "{{ lookup('env','OS_REGION_NAME') }}"
openstack_tenant_id: "{{ lookup('env','OS_TENANT_ID') }}"