[k8s] Adjust scenario for bionic
[fuel.git] / mcp / reclass / classes / cluster / mcp-k8s-calico-noha / infra / config.yml.j2
1 ##############################################################################
2 # Copyright (c) 2019 Mirantis Inc., Enea AB and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
8 {%- import 'net_map.j2' as nm with context %}
9 ---
10 classes:
11   - system.reclass.storage.salt
12   - system.reclass.storage.system.kubernetes_control_single
13 {%- if nm.cluster.has_baremetal_nodes %}
14   - system.reclass.storage.system.infra_maas_single
15 {%- endif %}
16   - system.salt.master.api
17   - system.salt.master.single
18   - system.salt.minion.ca.salt_master
19   - system.salt.minion.cert.k8s_server_single
20   - cluster.mcp-k8s-calico-noha
21 parameters:
22   _param:
23     salt_master_environment_repository: 'https://github.com/salt-formulas'
24     salt_master_environment_revision: master
25     reclass_data_repository: local
26     salt_master_base_environment: prd
27     salt_master_host: 127.0.0.1
28     salt_minion_ca_host: ${linux:network:fqdn}
29     # yamllint disable-line rule:line-length
30     salt_api_password_hash: "$6$sGnRlxGf$al5jMCetLP.vfI/fTl3Z0N7Za1aeiexL487jAtyRABVfT3NlwZxQGVhO7S1N8OwS/34VHYwZQA8lkXwKMN/GS1"
31     kubernetes_control_node01_deploy_address: ${_param:opnfv_openstack_control_node01_pxe_admin_address}
32     kubernetes_control_system_codename: bionic
33   linux:
34     system:
35       user:
36         salt:
37           home: /home/salt
38   salt:
39     master:
40       accept_policy: open_mode
41       file_recv: true
42       worker_threads: 4
43       command_timeout: 20
44     minion:
45       mine:
46         module:
47           x509.get_pem_entries: ['/etc/pki/all_cas/*']
48   reclass:
49     storage:
50       data_source:
51         engine: local
52       node:
53         kubernetes_control_node01:
54           params:
55             pxe_admin_interface: {{ nm.ctl01.nic_admin }}
56             pxe_admin_address: ${_param:opnfv_openstack_control_node01_pxe_admin_address}
57         # We support per-node (not only per-role) compute configuration via IDF
58 {%- for cmp in range(1, nm.cmp_nodes + 1) %}
59   {%- set n = '%02d' | format(cmp) %}
60   {%- set i = nm.cmp001.idx + cmp - 1 %}
61
62   {%- set admin = nm.net_admin_hosts | length + nm.start_ip[nm.net_admin] + loop.index %}
63   {%- set mgmt = nm.net_mgmt_hosts | length + nm.start_ip[nm.net_mgmt] + loop.index %}
64   {%- set pub = nm.net_public_hosts | length + nm.start_ip[nm.net_public] + loop.index %}
65   {%- set pri = nm.net_private_hosts | length + nm.start_ip[nm.net_private] + loop.index %}
66         kubernetes_compute_node{{ n }}:
67           name: cmp{{ '%03d' | format(cmp) }}
68           domain: ${_param:cluster_domain}
69           classes:
70             - cluster.${_param:cluster_name}.kubernetes.compute
71           params:
72             pxe_admin_address: {{ nm.net_admin | ipnet_hostaddr(admin) }}
73             pxe_admin_interface: {{ conf.idf.fuel.network.node[i].interfaces[nm.idx_admin] }}
74             single_address: {{ nm.net_mgmt | ipnet_hostaddr(mgmt) }}
75             tenant_address: {{ nm.net_private | ipnet_hostaddr(pri) }}
76             external_address: {{ nm.net_public | ipnet_hostaddr(pub) }}
77             salt_master_host: ${_param:reclass_config_master}
78             linux_system_codename: ${_param:kubernetes_control_system_codename}
79 {%- endfor %}