Sometimes multinode nodesets consist of nodes with private IPs from different L2 segments. So they can not communicate with each other using their IPs assigned to their gateway interfaces. This PR sets up VXLAN overlay using nodes inventory public IPs (those IPs used by zuul to get access to nodes). So nodes are convinced they are in the same L2 segment. We can use this overlay for internal K8s communication. For this we have to disable overlay setup in a CNI implementation (Calico, Cilium, etc.) and use the overlay interface for internal Openstack communication. Also: - Upgrade Kubeadm config API version to kubeadm.k8s.io/v1beta4 - Ignore single cpu kubeadm errors. By default Kubeadm requires at least 2 cpus on nodes. Change-Id: I34663de277951135c44607f093f8f1f93eafab86 Signed-off-by: Vladimir Kozhukalov <kozhukalov@gmail.com>
112 lines
3.0 KiB
YAML
112 lines
3.0 KiB
YAML
# 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.
|
|
|
|
---
|
|
- name: Include prerequisites tasks
|
|
include_tasks:
|
|
file: prerequisites.yaml
|
|
|
|
- name: Overlay network
|
|
include_tasks:
|
|
file: overlay.yaml
|
|
when: overlay_network_setup
|
|
|
|
- name: Configure /etc/hosts
|
|
template:
|
|
src: files/hosts
|
|
dest: /etc/hosts
|
|
|
|
- name: Loop devices
|
|
include_tasks:
|
|
file: loopback_devices.yaml
|
|
when: loopback_setup and inventory_hostname in (groups['k8s_cluster'] | default([]))
|
|
|
|
- name: Deploy Containerd
|
|
include_tasks:
|
|
file: containerd.yaml
|
|
|
|
- name: Include K8s common tasks
|
|
include_tasks:
|
|
file: k8s_common.yaml
|
|
when: inventory_hostname in (groups['k8s_cluster'] | default([]))
|
|
|
|
- name: Include K8s control-plane tasks
|
|
include_tasks:
|
|
file: k8s_control_plane.yaml
|
|
when: inventory_hostname in (groups['k8s_control_plane'] | default([]))
|
|
|
|
- name: Join workload nodes to cluster
|
|
command: "{{ (groups['k8s_control_plane'] | map('extract', hostvars, ['join_command', 'stdout_lines', 0]))[0] }}"
|
|
when: inventory_hostname in (groups['k8s_nodes'] | default([]))
|
|
|
|
- name: Include K8s client tasks
|
|
include_tasks:
|
|
file: k8s_client.yaml
|
|
when: inventory_hostname in (groups['primary'] | default([]))
|
|
|
|
- name: Include Calico tasks
|
|
include_tasks:
|
|
file: calico.yaml
|
|
when: calico_setup
|
|
|
|
- name: Include Cilium tasks
|
|
include_tasks:
|
|
file: cilium.yaml
|
|
when: cilium_setup
|
|
|
|
- name: Include Flannel tasks
|
|
include_tasks:
|
|
file: flannel.yaml
|
|
when: flannel_setup
|
|
|
|
- name: Include coredns resolver tasks
|
|
include_tasks:
|
|
file: coredns_resolver.yaml
|
|
when: coredns_resolver_setup
|
|
|
|
- name: Include Openstack provider gateway tasks
|
|
include_tasks:
|
|
file: openstack_provider_gateway.yaml
|
|
when:
|
|
- openstack_provider_gateway_setup
|
|
- inventory_hostname in (groups['k8s_control_plane'] | default([]))
|
|
|
|
- name: Include Metallb tasks
|
|
include_tasks:
|
|
file: metallb.yaml
|
|
when: metallb_setup
|
|
|
|
- name: Include Openstack Metallb endpoint tasks
|
|
include_tasks:
|
|
file: openstack_metallb_endpoint.yaml
|
|
when:
|
|
- metallb_setup
|
|
- inventory_hostname in (groups['primary'] | default([]))
|
|
|
|
- name: Include client-to-cluster tunnel tasks
|
|
include_tasks:
|
|
file: client_cluster_tunnel.yaml
|
|
when: (groups['primary'] | difference(groups['k8s_control_plane']) | length > 0)
|
|
|
|
- name: Include client-to-cluster ssh key tasks
|
|
include_tasks:
|
|
file: client_cluster_ssh.yaml
|
|
when: client_cluster_ssh_setup
|
|
|
|
- name: Include ingress tasks
|
|
include_tasks:
|
|
file: ingress.yaml
|
|
when:
|
|
- ingress_setup
|
|
- inventory_hostname in (groups['primary'] | default([]))
|
|
...
|