Skip to content

Commit e9a9df3

Browse files
author
Dmitriy Rabotyagov
committed
[doc] Move all variables to group_vars
Makes sense to be consistent and follow suggestion to use group_vars where applicable. There is a bug in vexxhost collection which prevents from doing so, unfortunatelly. For this to be accurate doc, a patch to vexxhost collection should land first: vexxhost/ansible-collection-kubernetes#136 Change-Id: I5f48e913436bf5d6a8d6c0a9f77c58886e451d1f
1 parent 551f75c commit e9a9df3

File tree

5 files changed

+68
-49
lines changed

5 files changed

+68
-49
lines changed

mcapi_vexxhost/README.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,13 @@ in `/etc/openstack_deploy/group_vars/k8s_all/haproxy_service.yml`
110110
Configure the LXC container that will host the control plane k8s cluster to
111111
be suitable for running nested containers in `/etc/openstack_deploy/group_vars/k8s_all/main.yml`
112112

113+
There you can also set config-overrides for the control plane of the k8s cluster,
114+
which integrate the control plane k8s deployment with the rest of the openstack-ansible deployment.
115+
113116
.. literalinclude:: ../../mcapi_vexxhost/playbooks/files/openstack_deploy/group_vars/k8s_all/main.yml
114117
:language: yaml
115118

116-
Set up config-overrides for the magnum service in `/etc/openstack_deploy/user_variables_magnum.yml`.
119+
Set up config-overrides for the magnum service in `/etc/openstack_deploy/group_vars/magnum_all/main.yml`.
117120
Adjust the images and flavors here as necessary, these are just for demonstration. Upload as many
118121
images as you need for the different workload cluster kubernetes versions.
119122

@@ -123,14 +126,7 @@ service and cluster-api can be configured to interact with either the external o
123126
internal endpoint and must trust the SSL certificiate. Depending on the environment,
124127
these may be derived from different certificate authorities.
125128

126-
.. literalinclude:: ../../mcapi_vexxhost/playbooks/files/openstack_deploy/user_variables_z_magnum.yml
127-
:language: yaml
128-
129-
Set up config-overrides for the control plane k8s cluster in /etc/openstack_deploy/user_variables_k8s.yml`
130-
These variables integrate the control plane k8s deployment with the rest of the
131-
openstack-ansible deployment.
132-
133-
.. literalinclude:: ../../mcapi_vexxhost/playbooks/files/openstack_deploy/user_variables_k8s.yml
129+
.. literalinclude:: ../../mcapi_vexxhost/playbooks/files/openstack_deploy/group_vars/magnum_all/main.yml
134130
:language: yaml
135131

136132
Run the deployment
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
1+
---
2+
# Run ansible modules in a venv on the target hosts
3+
ansible_collection_kubernetes_target_venv: /opt/mcapi_ansible_venv
4+
5+
# Pick a range of addresses for cilium that do not collide with anything else
6+
cilium_ipv4_cidr: 172.29.200.0/22
7+
8+
# wire OSA group, host and network addresses into k8s deployment
9+
kubelet_hostname: "{{ ansible_facts['hostname'] | lower }}"
10+
kubelet_node_ip: "{{ management_address }}"
11+
kubernetes_control_plane_group: k8s_container
12+
kubernetes_hostname: "{{ internal_lb_vip_address }}"
13+
kubernetes_non_init_namespace: true
14+
15+
# Define custom k8s version for the control cluster
16+
# kubernetes_version: 1.31
17+
18+
# Define LXC container overrides
119
lxc_container_config_list:
220
- "lxc.apparmor.profile=unconfined"
321

422
lxc_container_mount_auto:
523
- "proc:rw"
624
- "sys:rw"
25+
26+
# Set this manually, or kube-proxy will try to do this - not possible
27+
# in a non-init namespace and will fail in LXC
28+
openstack_host_nf_conntrack_max: 1572864
29+
30+
# OSA containers dont run ssh by default so cannot use synchronize
31+
upload_helm_chart_method: copy
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
# Copyright 2020, VEXXHOST, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
magnum_magnum_cluster_api_git_install_branch: v0.22.1
17+
18+
# install magnum-cluster-api and kubernetes python package into magnum venv
19+
magnum_user_pip_packages:
20+
- "git+https://github.com/vexxhost/magnum-cluster-api@{{ magnum_magnum_cluster_api_git_install_branch }}#egg=magnum-cluster-api"
21+
- kubernetes
22+
23+
# ensure that the internal VIP CA is trusted by the CAPI driver
24+
magnum_config_overrides:
25+
drivers:
26+
# Supply a custom CA file which will be passed and used exclusively on all workload nodes
27+
# System trust will be used by default
28+
openstack_ca_file: '/usr/local/share/ca-certificates/ExampleCorpRoot.crt'
29+
capi_client:
30+
# Supply a CA that will be used exclusively for connections towards
31+
# OpenStack public and internal endpoints.
32+
ca_file: '/usr/local/share/ca-certificates/ExampleCorpRoot.crt'
33+
endpoint: 'internalURL'
34+
cluster_template:
35+
kubernetes_allowed_network_drivers: 'calico'
36+
kubernetes_default_network_driver: 'calico'
37+
certificates:
38+
cert_manager_type: x509keypair

mcapi_vexxhost/playbooks/files/openstack_deploy/user_variables_k8s.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

mcapi_vexxhost/playbooks/files/openstack_deploy/user_variables_z_magnum.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
magnum_magnum_cluster_api_git_install_branch: v0.22.1
17-
18-
# install magnum-cluster-api and kubernetes python package into magnum venv
19-
magnum_user_pip_packages:
20-
- "git+https://github.com/vexxhost/magnum-cluster-api@{{ magnum_magnum_cluster_api_git_install_branch }}#egg=magnum-cluster-api"
21-
- kubernetes
22-
23-
# ensure that the internal VIP CA is trusted by the CAPI driver
24-
# TODO - this is too hardwired somehow
25-
magnum_config_overrides:
26-
drivers:
27-
openstack_ca_file: '/usr/local/share/ca-certificates/ExampleCorpRoot.crt'
28-
capi_client:
29-
ca_file: '/usr/local/share/ca-certificates/ExampleCorpRoot.crt'
30-
endpoint: 'internalURL'
31-
cluster_template:
32-
kubernetes_allowed_network_drivers: 'calico'
33-
kubernetes_default_network_driver: 'calico'
34-
certificates:
35-
cert_manager_type: x509keypair
36-
3716
# use the openstack_resources role in the capi functional test rather than os_magnum
3817
# to create the test resources
3918
magnum_glance_images: []

0 commit comments

Comments
 (0)