diff options
author | chenjie1 <chenjie.xu@intel.com> | 2020-06-28 15:36:51 +0800 |
---|---|---|
committer | mid_one <chenjie.xu@intel.com> | 2020-08-10 22:53:41 +0800 |
commit | 785bd33551123ac71a8eea6e8052620fb0a38de2 (patch) | |
tree | 0d8a7c447958e05eddb85254c27a8c29cdfd4349 /kud/deployment_infra/playbooks | |
parent | 39b7d2f8a79f23141301e7b9abf7bf3a0f2e8f21 (diff) |
Integrate Topology Manager
Integrate topology manager by utilizing ansible
scripts from openness.
Issue-ID: MULTICLOUD-1102
Signed-off-by: ChenjieXu <chenjie.xu@intel.com>
Change-Id: Ibaaf77e44c97edffe1ae03bf77c2422c89783e75
Diffstat (limited to 'kud/deployment_infra/playbooks')
-rw-r--r-- | kud/deployment_infra/playbooks/configure-topology-manager.yml | 66 | ||||
-rw-r--r-- | kud/deployment_infra/playbooks/kud-vars.yml | 7 |
2 files changed, 73 insertions, 0 deletions
diff --git a/kud/deployment_infra/playbooks/configure-topology-manager.yml b/kud/deployment_infra/playbooks/configure-topology-manager.yml new file mode 100644 index 00000000..012bc8b0 --- /dev/null +++ b/kud/deployment_infra/playbooks/configure-topology-manager.yml @@ -0,0 +1,66 @@ +--- +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2020 +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +- hosts: kube-node + tasks: + - name: Load kud variables + include_vars: + file: kud-vars.yml + + - name: creating kubelet config + become: yes + blockinfile: + path: "{{ kubernetes_config_file }}" + marker: "# {mark} OpenNESS configuration - General" + create: yes + block: | + featureGates: + TopologyManager: {{ False if topology_manager.policy == 'none' else True }} + notify: + - enable and restart kubelet + + - name: customize kubelet config - CPU Manager + become: yes + blockinfile: + path: "{{ kubernetes_config_file }}" + marker: "# {mark} OpenNESS configuration - CPU Manager" + block: | + cpuManagerPolicy: {{ cpu_manager.policy }} + state: "{{ 'present' if cpu_manager.policy == 'static' else 'absent' }}" + notify: + - remove cpu manager checkpoint file + - enable and restart kubelet + + - name: customize kubelet config - Topology Manager + become: yes + blockinfile: + path: "{{ kubernetes_config_file }}" + marker: "# {mark} OpenNESS configuration - Topology Manager" + block: | + topologyManagerPolicy: {{ topology_manager.policy }} + state: "{{ 'absent' if topology_manager.policy == 'none' else 'present' }}" + notify: + - enable and restart kubelet + + handlers: + - name: enable and restart kubelet + become: yes + systemd: + name: kubelet + daemon_reload: yes + enabled: yes + masked: no + state: restarted + + - name: remove cpu manager checkpoint file + become: yes + file: + path: "{{ cpu_manager.checkpoint_file }}" + state: absent diff --git a/kud/deployment_infra/playbooks/kud-vars.yml b/kud/deployment_infra/playbooks/kud-vars.yml index 4988a473..30e54f03 100644 --- a/kud/deployment_infra/playbooks/kud-vars.yml +++ b/kud/deployment_infra/playbooks/kud-vars.yml @@ -79,3 +79,10 @@ optane_ipmctl_source_type: "tarball" optane_ipmctl_version: 02.00.00.3474 optane_ipmctl_url: "https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/ipmctl/{{ optane_package }}.tar.xz" optane_ipmctl_package: ipmctl_02.00.00.3474+really01.00.00.3469.orig + +kubernetes_config_file: "/etc/kubernetes/kubelet-config.yaml" +cpu_manager: + policy: "static" # Options: none (disabled), static (default) + checkpoint_file: "/var/lib/kubelet/cpu_manager_state" +topology_manager: + policy: "best-effort" # Options: none (disabled), best-effort (default), restricted, single-numa-node |