From b542f886b12edcebc6ac156e02e14ece84f4d799 Mon Sep 17 00:00:00 2001 From: Krisztian Lengyel Date: Thu, 19 Sep 2019 13:53:26 -0400 Subject: [PATCH] Remove DANM TenantConfig creation TenantConfig will be moved to infra chart. DANM also updated to include latest performance improvements. Depends-On: I40a5d2ca5c3ec8eb6cd82385bde41e6760611aff Change-Id: I6f90c7434c79a331c1ca11c48b360bf9d7157b63 Signed-off-by: Krisztian Lengyel --- SPECS/caas-danm.spec | 4 +- SPECS/caas-hyperdanm.spec | 4 +- ansible/roles/danm_setup/defaults/main.yaml | 6 --- .../danm_setup/tasks/danm-tenant-configs.yaml | 24 --------- ansible/roles/danm_setup/tasks/main.yaml | 3 -- .../templates/danm_tenant_config.yaml.j2 | 61 ---------------------- 6 files changed, 4 insertions(+), 98 deletions(-) delete mode 100644 ansible/roles/danm_setup/tasks/danm-tenant-configs.yaml delete mode 100644 ansible/roles/danm_setup/templates/danm_tenant_config.yaml.j2 diff --git a/SPECS/caas-danm.spec b/SPECS/caas-danm.spec index 4a0b62b..b2890d3 100644 --- a/SPECS/caas-danm.spec +++ b/SPECS/caas-danm.spec @@ -15,8 +15,8 @@ %define COMPONENT danm %define RPM_NAME caas-%{COMPONENT} %define RPM_MAJOR_VERSION 4.0.0 -%define RPM_MINOR_VERSION 6 -%define DANM_VERSION 687031341573550f387e109b273d8dd0cebf93bf +%define RPM_MINOR_VERSION 7 +%define DANM_VERSION 7b0634aa1693c1d91ef5cfb025f2deda77941155 %define CNI_VERSION 0.8.1 %define go_version 1.12.9 %define SRIOV_VERSION 9e4c973b2ac517c64867e33d61aee152d70dc330 diff --git a/SPECS/caas-hyperdanm.spec b/SPECS/caas-hyperdanm.spec index d03bfc0..315a937 100644 --- a/SPECS/caas-hyperdanm.spec +++ b/SPECS/caas-hyperdanm.spec @@ -15,8 +15,8 @@ %define COMPONENT hyperdanm %define RPM_NAME caas-%{COMPONENT} %define RPM_MAJOR_VERSION 4.0.0 -%define RPM_MINOR_VERSION 4 -%define DANM_VERSION 687031341573550f387e109b273d8dd0cebf93bf +%define RPM_MINOR_VERSION 5 +%define DANM_VERSION 7b0634aa1693c1d91ef5cfb025f2deda77941155 %define go_version 1.12.9 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION} %define danm_components netwatcher svcwatcher webhook diff --git a/ansible/roles/danm_setup/defaults/main.yaml b/ansible/roles/danm_setup/defaults/main.yaml index bc5f321..c540e38 100644 --- a/ansible/roles/danm_setup/defaults/main.yaml +++ b/ansible/roles/danm_setup/defaults/main.yaml @@ -12,9 +12,3 @@ # 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. -caas_provider_network_profiles: "{{ network_profiles | filter_network_profiles_by_type('provider_network_interfaces', 'caas') }}" -caas_sriov_network_profiles: "{{ network_profiles | filter_network_profiles_by_type('sriov_provider_networks', 'caas') }}" - -attached_caas_provider_network_profiles: "{{ hosts[hostname]['network_profiles'] | intersect(caas_provider_network_profiles.keys()) }}" -attached_caas_sriov_network_profiles: "{{ hosts[hostname]['network_profiles'] | intersect(caas_sriov_network_profiles.keys()) }}" -all_attached_caas_provider_network_profiles: "{{ attached_caas_provider_network_profiles | union(attached_caas_sriov_network_profiles) }}" diff --git a/ansible/roles/danm_setup/tasks/danm-tenant-configs.yaml b/ansible/roles/danm_setup/tasks/danm-tenant-configs.yaml deleted file mode 100644 index dd696b7..0000000 --- a/ansible/roles/danm_setup/tasks/danm-tenant-configs.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -# Copyright 2019 Nokia -# -# 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: template DANM tenant configs - template: - src: "danm_tenant_config.yaml.j2" - dest: "{{ caas.manifests_directory }}/danm-tenant-config.yaml" - -- name: create DANM tenant configs - kubectl: - manifest: "{{ caas.manifests_directory }}/danm-tenant-config.yaml" - state: present diff --git a/ansible/roles/danm_setup/tasks/main.yaml b/ansible/roles/danm_setup/tasks/main.yaml index e900209..0eff56c 100644 --- a/ansible/roles/danm_setup/tasks/main.yaml +++ b/ansible/roles/danm_setup/tasks/main.yaml @@ -32,6 +32,3 @@ retries: 60 delay: 6 with_items: "{{ created_crds.results }}" - -- name: create tenant config - include_tasks: danm-tenant-configs.yaml diff --git a/ansible/roles/danm_setup/templates/danm_tenant_config.yaml.j2 b/ansible/roles/danm_setup/templates/danm_tenant_config.yaml.j2 deleted file mode 100644 index 97f8888..0000000 --- a/ansible/roles/danm_setup/templates/danm_tenant_config.yaml.j2 +++ /dev/null @@ -1,61 +0,0 @@ -#jinja2: lstrip_blocks: True -{# -Copyright 2019 Nokia - -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. -#} -{%- macro make_host_devices(devices, provider_network) %} - {% for device in devices %} -- name: {{ device }} - {{ make_vni_config(provider_network) | indent(2) }} - {% endfor %} -{% endmacro -%} - -{%- macro make_vni_config(provider_network) %} - {% set vlan_ranges = provider_network.get('vlan_ranges', '') %} - {% set vxlan_ranges = provider_network.get('vxlan_ranges', '') %} - {% if vlan_ranges %} -vniType: vlan -vniRange: {{ vlan_ranges | replace(':', '-') }} - {% elif vxlan_ranges %} -vniType: vxlan -vniRange: {{ vxlan_ranges | replace(':', '-') }} - {% endif %} -{% endmacro -%} - ---- -apiVersion: danm.k8s.io/v1 -kind: TenantConfig -metadata: - name: danm-tenant-config -hostDevices: -{% if all_attached_caas_provider_network_profiles %} - {% for profile_name in all_attached_caas_provider_network_profiles %} - {% set profile = network_profiles[profile_name] %} - {% set caas_provider_networks = profile.get('provider_network_interfaces', {}) | filter_provider_networks_by_type('caas') %} - {% set caas_sriov_provider_networks = profile.get('sriov_provider_networks', {}) | filter_provider_networks_by_type('caas') %} - {% for tenant_network in caas.get('tenant_networks', []) %} - {% if tenant_network in caas_provider_networks | get_provider_networks %} - {{ make_host_devices(caas_provider_networks.keys(), networking['provider_networks'][tenant_network]) | indent(2) -}} - {% elif tenant_network in caas_sriov_provider_networks %} - {% set sriov_interaces = caas_sriov_provider_networks | extract_sriov_provider_network_interfaces %} - {% set sriov_device_pools = sriov_interaces | map('regex_replace', '(.*)', 'nokia.k8s.io/sriov_\\1') | list %} - {{ make_host_devices(sriov_device_pools, networking['provider_networks'][tenant_network]) | indent(2) -}} - {% endif %} - {% endfor %} - {% endfor %} -{%- else %} - [] -{% endif %} -networkIds: - flannel: flannel -- 2.16.6