Gate: place role default vars within the role

This PS places the role default vars within the appropriate role,
in addition it exposes kubeadm's selfhosted param and deploys the
kubeadm binary to master nodes.

This PS exposes the selfhosted param, and deploys kubeadm to master
nodes.

Change-Id: I5ad1b593a711ffe353b012394d54044dede0691d
This commit is contained in:
Pete Birley 2018-05-09 22:56:03 -05:00
parent 12965b1615
commit be3f300623
13 changed files with 182 additions and 68 deletions

View File

@ -12,53 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
version:
kubernetes: v1.10.2
helm: v2.8.2
cni: v0.6.0
proxy:
http: null
https: null
noproxy: null
images:
kubernetes:
kubeadm_aio: openstackhelm/kubeadm-aio:dev
kubernetes:
network:
default_device: null
cluster:
cni: calico
pod_subnet: 192.168.0.0/16
domain: cluster.local
nodes:
labels:
primary:
- name: openstack-helm-node-class
value: primary
nodes:
- name: openstack-helm-node-class
value: general
all:
- name: openstack-control-plane
value: enabled
- name: openstack-compute-node
value: enabled
- name: openvswitch
value: enabled
- name: linuxbridge
value: enabled
- name: ceph-mon
value: enabled
- name: ceph-osd
value: enabled
- name: ceph-mds
value: enabled
- name: ceph-rgw
value: enabled
- name: ceph-mgr
value: enabled
null: null

View File

@ -0,0 +1,16 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version:
helm: v2.8.2

View File

@ -0,0 +1,27 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version:
kubernetes: v1.10.2
helm: v2.8.2
cni: v0.6.0
proxy:
http: null
https: null
noproxy: null
images:
kubernetes:
kubeadm_aio: openstackhelm/kubeadm-aio:dev

View File

@ -0,0 +1,18 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
proxy:
http: null
https: null
noproxy: null

View File

@ -0,0 +1,51 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
kubernetes_cluster_cni: calico
kubernetes_cluster_pod_subnet: 192.168.0.0/16
kubernetes_cluster_domain: cluster.local
kubernetes_network_default_device: null
kubernetes_selfhosted: false
images:
kubernetes:
kubeadm_aio: openstackhelm/kubeadm-aio:dev
nodes:
labels:
primary:
- name: openstack-helm-node-class
value: primary
nodes:
- name: openstack-helm-node-class
value: general
all:
- name: openstack-control-plane
value: enabled
- name: openstack-compute-node
value: enabled
- name: openvswitch
value: enabled
- name: linuxbridge
value: enabled
- name: ceph-mon
value: enabled
- name: ceph-osd
value: enabled
- name: ceph-mds
value: enabled
- name: ceph-rgw
value: enabled
- name: ceph-mgr
value: enabled

View File

@ -40,12 +40,12 @@
USER_UID="{{ playbook_user_id }}"
USER_GID="{{ playbook_group_id }}"
USER_HOME="{{ playbook_user_dir }}"
CNI_ENABLED="{{ kubernetes.cluster.cni }}"
CNI_ENABLED="{{ kubernetes_cluster_cni }}"
PVC_SUPPORT_CEPH=true
PVC_SUPPORT_NFS=true
NET_SUPPORT_LINUXBRIDGE=true
KUBE_NET_POD_SUBNET="{{ kubernetes.cluster.pod_subnet }}"
KUBE_NET_DNS_DOMAIN="{{ kubernetes.cluster.domain }}"
KUBE_NET_POD_SUBNET="{{ kubernetes_cluster_pod_subnet }}"
KUBE_NET_DNS_DOMAIN="{{ kubernetes_cluster_domain }}"
CONTAINER_RUNTIME=docker
register: kubeadm_master_deploy
ignore_errors: True

View File

@ -21,9 +21,9 @@
kubernetes_default_address: null
- name: if we have defined a custom interface for kubernetes use that
when: kubernetes.network.default_device is defined and kubernetes.network.default_device
when: kubernetes_network_default_device is defined and kubernetes_network_default_device
set_fact:
kubernetes_default_device: "{{ kubernetes.network.default_device }}"
kubernetes_default_device: "{{ kubernetes_network_default_device }}"
- name: if we are in openstack infra use the private IP for kubernetes
when: (nodepool is defined) and (nodepool.private_ipv4 is defined)

View File

@ -42,14 +42,15 @@
USER_UID="{{ playbook_user_id }}"
USER_GID="{{ playbook_group_id }}"
USER_HOME="{{ playbook_user_dir }}"
CNI_ENABLED="{{ kubernetes.cluster.cni }}"
CNI_ENABLED="{{ kubernetes_cluster_cni }}"
PVC_SUPPORT_CEPH=true
PVC_SUPPORT_NFS=true
NET_SUPPORT_LINUXBRIDGE=true
KUBE_NET_POD_SUBNET="{{ kubernetes.cluster.pod_subnet }}"
KUBE_NET_DNS_DOMAIN="{{ kubernetes.cluster.domain }}"
KUBE_NET_POD_SUBNET="{{ kubernetes_cluster_pod_subnet }}"
KUBE_NET_DNS_DOMAIN="{{ kubernetes_cluster_domain }}"
CONTAINER_RUNTIME=docker
KUBELET_NODE_LABELS="{{ kubeadm_kubelet_labels }}"
KUBE_SELF_HOSTED="{{ kubernetes_selfhosted }}"
register: kubeadm_master_deploy
rescue:
- name: "getting logs for {{ kubeadm_aio_action }} action"

View File

@ -0,0 +1,17 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
images:
kubernetes:
kubeadm_aio: openstackhelm/kubeadm-aio:dev

View File

@ -0,0 +1,18 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
proxy:
http: null
https: null
noproxy: null

View File

@ -0,0 +1,18 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
proxy:
http: null
https: null
noproxy: null

View File

@ -12,10 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
kubernetes:
network:
default_device: docker0
cluster:
cni: calico
pod_subnet: 192.168.0.0/16
domain: cluster.local
kubernetes_network_default_device: docker0

View File

@ -215,15 +215,18 @@
delegate_to: 127.0.0.1
command: kubeadm alpha phase selfhosting convert-from-staticpods --kubeconfig /mnt/rootfs/etc/kubernetes/admin.conf --config /mnt/rootfs/etc/kubernetes/kubeadm-conf.yaml
- name: setting up kubectl client on host
- name: setting up kubectl client and kubeadm on host
block:
- name: kubectl | copying kubectl binary to host
copy:
src: /usr/bin/kubectl
dest: /usr/bin/kubectl
src: "/usr/bin/{{ item }}"
dest: "/usr/bin/{{ item }}"
owner: root
group: root
mode: 0555
with_items:
- kubectl
- kubeadm
- name: kubectl | master | ensure kube config directory exists for user
file:
path: "{{ item }}"