diff options
Diffstat (limited to 'kud')
37 files changed, 1678 insertions, 53 deletions
diff --git a/kud/deployment_infra/images/qat_plugin_privileges.yaml b/kud/deployment_infra/images/qat_plugin_privileges.yaml new file mode 100644 index 00000000..af98f367 --- /dev/null +++ b/kud/deployment_infra/images/qat_plugin_privileges.yaml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: intel-qat-kernel-plugin + labels: + app: intel-qat-kernel-plugin +spec: + selector: + matchLabels: + app: intel-qat-kernel-plugin + template: + metadata: + labels: + app: intel-qat-kernel-plugin + spec: + containers: + - name: intel-qat-kernel-plugin + securityContext: + privileged: true + image: akhilak/intel-qat-plugin:0.15.0 + imagePullPolicy: IfNotPresent + command: ["/usr/local/bin/intel_qat_device_plugin", "-mode", "kernel"] + volumeMounts: + - name: devfs + mountPath: /dev + - name: etcdir + mountPath: /etc + readOnly: true + - name: kubeletsockets + mountPath: /var/lib/kubelet/device-plugins + volumes: + - name: etcdir + hostPath: + path: /etc + - name: kubeletsockets + hostPath: + path: /var/lib/kubelet/device-plugins + - name: devfs + hostPath: + path: /dev diff --git a/kud/deployment_infra/playbooks/configure-qat.yml b/kud/deployment_infra/playbooks/configure-qat.yml new file mode 100644 index 00000000..1225b3d4 --- /dev/null +++ b/kud/deployment_infra/playbooks/configure-qat.yml @@ -0,0 +1,15 @@ +--- +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 +# 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 +############################################################################## + +- import_playbook: preconfigure-qat.yml +- hosts: localhost + tasks: + - name: Apply QAT plugin previleges Daemonset + command: "/usr/local/bin/kubectl apply -f {{ playbook_dir }}/../images/qat_plugin_privileges.yaml" diff --git a/kud/deployment_infra/playbooks/install_qat.sh b/kud/deployment_infra/playbooks/install_qat.sh new file mode 100644 index 00000000..57adb923 --- /dev/null +++ b/kud/deployment_infra/playbooks/install_qat.sh @@ -0,0 +1,238 @@ +#!/bin/bash + +# Precondition: +# QAT device installed, such as lspci | grep 37c8 +# Enable grub with "intel_iommu=on iommu=pt" + +ROOT= + +MV=mv +RM=rm +ECHO=echo +SLEEP=sleep +INSTALL="/usr/bin/install -c" +MKDIR_P="mkdir -p" +libdir=/usr/local/lib +bindir=/usr/local/bin + +am__append_1="drivers/crypto/qat/qat_dh895xcc/qat_dh895xcc.ko\ + drivers/crypto/qat/qat_dh895xccvf/qat_dh895xccvf.ko" + +am__append_2="qat_895xcc.bin qat_895xcc_mmp.bin" +am__append_3="dh895xcc_dev0.conf dh895xcc_dev1.conf dh895xccvf_dev0.conf.vm" + +# Kernel modules list +KO_MODULES_LIST="drivers/crypto/qat/qat_common/intel_qat.ko \ + drivers/crypto/qat/qat_c62x/qat_c62x.ko \ + drivers/crypto/qat/qat_c62xvf/qat_c62xvf.ko \ + drivers/crypto/qat/qat_d15xx/qat_d15xx.ko \ + drivers/crypto/qat/qat_d15xxvf/qat_d15xxvf.ko \ + drivers/crypto/qat/qat_c3xxx/qat_c3xxx.ko \ + drivers/crypto/qat/qat_c3xxxvf/qat_c3xxxvf.ko $am__append_1" + +# Firmwares list +BIN_LIST="qat_c3xxx.bin qat_c3xxx_mmp.bin qat_c62x.bin \ + qat_c62x_mmp.bin qat_mmp.bin qat_d15xx.bin qat_d15xx_mmp.bin \ + $am__append_2" +CONFIG_LIST="c3xxx_dev0.conf \ + c3xxxvf_dev0.conf.vm \ + c6xx_dev0.conf \ + c6xx_dev1.conf \ + c6xx_dev2.conf \ + c6xxvf_dev0.conf.vm \ + d15xx_dev0.conf \ + d15xxpf_dev0.conf \ + d15xxvf_dev0.conf.vm \ + $am__append_3" + +QAT_DH895XCC_NUM_VFS=32 +QAT_DHC62X_NUM_VFS=16 +QAT_DHD15XX_NUM_VFS=16 +QAT_DHC3XXX_NUM_VFS=16 + +# Device information variables +INTEL_VENDORID="8086" +DH895_DEVICE_NUMBER="0435" +DH895_DEVICE_NUMBER_VM="0443" +C62X_DEVICE_NUMBER="37c8" +C62X_DEVICE_NUMBER_VM="37c9" +D15XX_DEVICE_NUMBER="6f54" +D15XX_DEVICE_NUMBER_VM="6f55" +C3XXX_DEVICE_NUMBER="19e2" +C3XXX_DEVICE_NUMBER_VM="19e3" +numC62xDevice=`lspci -vnd 8086: | egrep -c "37c8|37c9"` +numD15xxDevice=`lspci -vnd 8086: | egrep -c "6f54|6f55"` +numDh895xDevice=`lspci -vnd 8086: | egrep -c "0435|0443"` +numC3xxxDevice=`lspci -vnd 8086: | egrep -c "19e2|19e3"` +numDh895xDevicesP=`lspci -n | egrep -c "$INTEL_VENDORID:$DH895_DEVICE_NUMBER"` +numDh895xDevicesV=`lspci -n | egrep -c "$INTEL_VENDORID:$DH895_DEVICE_NUMBER_VM"` +numC62xDevicesP=`lspci -n | egrep -c "$INTEL_VENDORID:$C62X_DEVICE_NUMBER"` +numD15xxDevicesP=`lspci -n | egrep -c "$INTEL_VENDORID:$D15XX_DEVICE_NUMBER"` +numC3xxxDevicesP=`lspci -n | egrep -c "$INTEL_VENDORID:$C3XXX_DEVICE_NUMBER"` +MODPROBE_BLACKLIST_FILE="blacklist-qat-vfs.conf" + +# load vfio-pci +$ECHO "Loading module vfio-pci" +modprobe vfio-pci + +# qat-driver +$ECHO "Installing driver in `\uname -r`" +INSTALL_MOD_DIR=/lib/modules/`\uname -r`/updates/ +for ko in $KO_MODULES_LIST; do + base=${ko%/*}; + file=${ko##*/}; + mkdir -p $ROOT$INSTALL_MOD_DIR$base + $INSTALL $file $ROOT$INSTALL_MOD_DIR$base +done + +# qat-adf-ctl +if [ ! -d $ROOT$bindir ]; then + $MKDIR_P $ROOT$bindir; +fi; +$INSTALL -D -m 750 adf_ctl $ROOT$bindir/adf_ctl; + +# qat-service +if [ ! -d $ROOT/lib/firmware/qat_fw_backup ]; then + $MKDIR_P $ROOT/lib/firmware/qat_fw_backup; +fi; + +for bin in $BIN_LIST; do + if [ -e $ROOT/lib/firmware/$bin ]; then + mv $ROOT/lib/firmware/$bin $ROOT/lib/firmware/qat_fw_backup/$bin; + fi; + if [ -e $bin ]; then + $INSTALL -D -m 750 $bin $ROOT/lib/firmware/$bin; + fi; +done; + +if [ ! -d $ROOT/etc/qat_conf_backup ]; then + $MKDIR_P $ROOT/etc/qat_conf_backup; +fi; +$MV $ROOT/etc/dh895xcc*.conf $ROOT/etc/qat_conf_backup/ 2>/dev/null; +$MV $ROOT/etc/c6xx*.conf $ROOT/etc/qat_conf_backup/ 2>/dev/null; +$MV $ROOT/etc/d15xx*.conf $ROOT/etc/qat_conf_backup/ 2>/dev/null; +$MV $ROOT/etc/c3xxx*.conf $ROOT/etc/qat_conf_backup/ 2>/dev/null; + +for ((dev=0; dev<$numDh895xDevicesP; dev++)); do + $INSTALL -D -m 640 dh895xcc_dev0.conf $ROOT/etc/dh895xcc_dev$dev.conf; + for ((vf_dev = 0; vf_dev<$QAT_DH895XCC_NUM_VFS; vf_dev++)); do + vf_dev_num=$(($dev * $QAT_DH895XCC_NUM_VFS + $vf_dev)); + $INSTALL -D -m 640 dh895xccvf_dev0.conf.vm $ROOT/etc/dh895xccvf_dev$vf_dev_num.conf; + done; +done; + +for ((dev=0; dev<$numC62xDevicesP; dev++)); do + $INSTALL -D -m 640 c6xx_dev$(($dev%3)).conf $ROOT/etc/c6xx_dev$dev.conf; + for ((vf_dev = 0; vf_dev<$QAT_DHC62X_NUM_VFS; vf_dev++)); do + vf_dev_num=$(($dev * $QAT_DHC62X_NUM_VFS + $vf_dev)); + $INSTALL -D -m 640 c6xxvf_dev0.conf.vm $ROOT/etc/c6xxvf_dev$vf_dev_num.conf; + done; +done; + +for ((dev=0; dev<$numD15xxDevicesP; dev++)); do + $INSTALL -D -m 640 d15xx_dev$(($dev%3)).conf $ROOT/etc/d15xx_dev$dev.conf; + for ((vf_dev = 0; vf_dev<$QAT_DHD15XX_NUM_VFS; vf_dev++)); do + vf_dev_num=$(($dev * $QAT_DHD15XX_NUM_VFS + $vf_dev)); + $INSTALL -D -m 640 d15xxvf_dev0.conf.vm $ROOT/etc/d15xxvf_dev$vf_dev_num.conf; + done; +done; + +for ((dev=0; dev<$numC3xxxDevicesP; dev++)); do + $INSTALL -D -m 640 c3xxx_dev0.conf $ROOT/etc/c3xxx_dev$dev.conf; + for ((vf_dev = 0; vf_dev<$QAT_DHC3XXX_NUM_VFS; vf_dev++)); do + vf_dev_num=$(($dev * $QAT_DHC3XXX_NUM_VFS + $vf_dev)); + $INSTALL -D -m 640 c3xxxvf_dev0.conf.vm $ROOT/etc/c3xxxvf_dev$vf_dev_num.conf; + done; +done; + +$ECHO "Creating startup and kill scripts"; +if [ ! -d $ROOT/etc/modprobe.d ]; then + $MKDIR_P $ROOT/etc/modprobe.d; +fi; +$INSTALL -D -m 750 qat_service $ROOT/etc/init.d/qat_service; +$INSTALL -D -m 750 qat_service_vfs $ROOT/etc/init.d/qat_service_vfs; +$INSTALL -D -m 750 qat $ROOT/etc/default/qat; +if [ -e $ROOT/etc/modprobe.d/$MODPROBE_BLACKLIST_FILE ] ; then + $RM $ROOT/etc/modprobe.d/$MODPROBE_BLACKLIST_FILE; +fi; + +if [ $numDh895xDevicesP != 0 ];then + $ECHO "blacklist qat_dh895xccvf" >> $ROOT/etc/modprobe.d/$MODPROBE_BLACKLIST_FILE; +fi; +if [ $numC3xxxDevicesP != 0 ];then + $ECHO "blacklist qat_c3xxxvf" >> $ROOT/etc/modprobe.d/$MODPROBE_BLACKLIST_FILE; +fi; +if [ $numC62xDevicesP != 0 ];then + $ECHO "blacklist qat_c62xvf" >> $ROOT/etc/modprobe.d/$MODPROBE_BLACKLIST_FILE; +fi; +if [ $numD15xxDevicesP != 0 ];then + $ECHO "blacklist qat_d15xxvf" >> $ROOT/etc/modprobe.d/$MODPROBE_BLACKLIST_FILE; +fi; + +if [ ! -d $ROOT$libdir ]; then + $MKDIR_P $ROOT$libdir; +fi; +if [ ! -d $ROOT/etc/ld.so.conf.d ]; then + $MKDIR_P $ROOT/etc/ld.so.conf.d; +fi; +if [ ! -d $ROOT/lib/modules/`\uname -r`/kernel/drivers ]; then + $MKDIR_P $ROOT/lib/modules/`\uname -r`/kernel/drivers; +fi; +if [ ! -d $ROOT/etc/udev/rules.d ]; then + $MKDIR_P $ROOT/etc/udev/rules.d; +fi; + +$ECHO "Copying libqat_s.so to $ROOT$libdir"; +$INSTALL -D -m 755 libqat_s.so $ROOT$libdir/libqat_s.so; +$ECHO "Copying libusdm_drv_s.so to $ROOT$libdir"; +$INSTALL -D -m 755 libusdm_drv_s.so $ROOT$libdir/libusdm_drv_s.so; +$ECHO $libdir > $ROOT/etc/ld.so.conf.d/qat.conf; ldconfig; + +$ECHO "Copying usdm module to system drivers"; +$INSTALL usdm_drv.ko "$ROOT/lib/modules/`\uname -r`/kernel/drivers"; +$INSTALL qat_api.ko "$ROOT/lib/modules/`\uname -r`/kernel/drivers"; +$ECHO "Creating udev rules"; +if [ ! -e $ROOT/etc/udev/rules.d/00-qat.rules ]; then + echo 'KERNEL=="qat_adf_ctl" MODE="0660" GROUP="qat"' > $ROOT/etc/udev/rules.d/00-qat.rules; + echo 'KERNEL=="qat_dev_processes" MODE="0660" GROUP="qat"' >> $ROOT/etc/udev/rules.d/00-qat.rules; + echo 'KERNEL=="usdm_drv" MODE="0660" GROUP="qat"' >> $ROOT/etc/udev/rules.d/00-qat.rules; + echo 'KERNEL=="uio*" MODE="0660" GROUP="qat"' >> $ROOT/etc/udev/rules.d/00-qat.rules; + echo 'KERNEL=="hugepages" MODE="0660" GROUP="qat"' >> $ROOT/etc/udev/rules.d/00-qat.rules; +fi; +$ECHO "Creating module.dep file for QAT released kernel object"; +$ECHO "This will take a few moments"; +depmod -a; +if [ `lsmod | grep "usdm_drv" | wc -l` != "0" ]; then + $ECHO "rmmod usdm_drv"; + rmmod usdm_drv; +fi; +if [ -e /sbin/chkconfig ] ; then + chkconfig --add qat_service; +elif [ -e /usr/sbin/update-rc.d ]; then + $ECHO "update-rc.d qat_service defaults"; + update-rc.d qat_service defaults; +fi; + +$ECHO "Starting QAT service"; +/etc/init.d/qat_service shutdown; +$SLEEP 3; +/etc/init.d/qat_service start; +/etc/init.d/qat_service_vfs start; + +# load kernel vf module for QAT device plugin +numC62xDevicesV=`lspci -n | egrep -c "$INTEL_VENDORID:$C62X_DEVICE_NUMBER_VM"` +numD15xxDevicesV=`lspci -n | egrep -c "$INTEL_VENDORID:$D15XX_DEVICE_NUMBER_VM"` +numC3xxxDevicesV=`lspci -n | egrep -c "$INTEL_VENDORID:$C3XXX_DEVICE_NUMBER_VM"` +if [ $numC62xDevicesV != 0 ];then + $ECHO "Loading qat_c62xvf"; + modprobe qat_c62xvf +fi +if [ $numC3xxxDevicesV != 0 ];then + $ECHO "Loading qat_c3xxxvf"; + modprobe qat_c3xxxvf +fi +if [ $numD15xxDevicesV != 0 ];then + $ECHO "Loading qat_d15xxvf"; + modprobe qat_d15xxvf +fi + diff --git a/kud/deployment_infra/playbooks/kud-vars.yml b/kud/deployment_infra/playbooks/kud-vars.yml index 2a25049a..a592a909 100644 --- a/kud/deployment_infra/playbooks/kud-vars.yml +++ b/kud/deployment_infra/playbooks/kud-vars.yml @@ -39,14 +39,14 @@ istio_source_type: "tarball" istio_version: 1.0.3 istio_url: "https://github.com/istio/istio/releases/download/{{ istio_version }}/istio-{{ istio_version }}-linux.tar.gz" -sriov_dest: "{{ base_dest }}/sriov" -driver_source_type: "tarball" -driver_version: 3.7.34 -driver_url: "https://downloadmirror.intel.com/28943/eng/iavf-{{ driver_version }}.tar.gz" -package: iavf-3.7.34 - go_version: '1.12.5' kubespray_version: 2.10.4 helm_client_version: 2.13.1 # kud playbooks not compatible with 2.8.0 - see MULTICLOUD-634 ansible_version: 2.7.10 + +qat_dest: "{{ base_dest }}/qat" +qat_driver_source_type: "tarball" +qat_driver_version: 1.7.l.4.6.0-00025 +qat_driver_url: "https://01.org/sites/default/files/downloads/{{ qat_package }}.tar.gz" +qat_package: qat1.7.l.4.6.0-00025 diff --git a/kud/deployment_infra/playbooks/preconfigure-qat.yml b/kud/deployment_infra/playbooks/preconfigure-qat.yml new file mode 100644 index 00000000..f5d797f1 --- /dev/null +++ b/kud/deployment_infra/playbooks/preconfigure-qat.yml @@ -0,0 +1,144 @@ +--- +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 +# 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: localhost + become: yes + pre_tasks: + - name: Load kud variables + include_vars: + file: kud-vars.yml + tasks: + - name: Create QAT dest folder + file: + state: directory + path: "{{ qat_dest }}" + - name: Fetching QAT driver + block: + - name: Download QAT driver tarball + get_url: + url: "{{ qat_driver_url }}" + dest: "{{ qat_dest }}/{{ qat_package }}.tar.gz" + +- hosts: kube-node + become: yes + pre_tasks: + - name: Load kud variables + include_vars: + file: kud-vars.yml + tasks: + - name: Create a destination for driver folder in the target's /tmp + file: + state: directory + path: "{{ item }}" + with_items: + - "{{ base_dest }}/quick-assist/{{ qat_package }}" + - name: Create QAT dest folder + file: + state: directory + path: "qat" + - name: Register QAT env variable + shell: "echo {{ QAT_ENABLED | default(False) }}" + - name: Create QAT check script + copy: + dest: "qat/qat.sh" + content: | + #!/bin/bash + qat_device=$( for i in 0434 0435 37c8 6f54 19e2; \ + do lspci -d 8086:$i -m; done |\ + grep -i "Quick*" | head -n 1 | cut -d " " -f 5 ) + if [ -z "$qat_device" ]; then + echo "False" + exit 0 + else + echo "True" + fi + - name: Changing perm of "sh", adding "+x" + shell: "chmod +x qat.sh" + args: + chdir: "qat" + warn: False + - name: Run the script and re-evaluate the variable. + command: "./qat.sh" + args: + chdir: "qat" + register: output + - debug: + var: output.stdout_lines + - set_fact: + QAT_ENABLED: "{{ output.stdout }}" + - debug: + var: output + - name: Clean the script and folder. + file: + path: qat + state: absent + - name: bootstrap | install qat compilation packages + package: + name: "{{ item }}" + state: present + with_items: + - pciutils + - build-essential + - libudev-dev + - pkg-config + when: QAT_ENABLED + - copy: + src: "{{ qat_dest }}/{{ qat_package }}.tar.gz" + dest: "{{ base_dest }}/quick-assist" + remote_src: no + when: QAT_ENABLED + - name: Extract QAT source code + unarchive: + src: "{{ qat_dest }}/{{ qat_package }}.tar.gz" + dest: "{{ base_dest }}/quick-assist/{{ qat_package }}" + when: QAT_ENABLED + - name: Configure the target + command: ./configure --enable-icp-sriov=host + args: + chdir: "{{ base_dest }}/quick-assist/{{ qat_package }}" + when: QAT_ENABLED + - name: build qat driver + make: + chdir: "{{ base_dest }}/quick-assist/{{ qat_package }}" + target: "{{ item }}" + loop: + - clean + - uninstall + - install + when: QAT_ENABLED + - name: Create QAT driver folder in the target destination + file: + state: directory + path: "{{ item }}" + with_items: + - qat_driver_dest + when: QAT_ENABLED + - name: Copy QAT build directory qat target destination + command: "cp -r {{ base_dest }}/quick-assist/{{ qat_package }}/build/ /root/qat_driver_dest/" + when: QAT_ENABLED + - name: Copy QAT driver install script to target folder + command: "cp {{ playbook_dir }}/install_qat.sh /root/qat_driver_dest/build/install.sh" + when: QAT_ENABLED + - name: Copy QAT to target folder + command: "cp /etc/default/qat /root/qat_driver_dest/build" + when: QAT_ENABLED + - name: Changing perm of "install.sh", adding "+x" + file: dest=~/qat_driver_dest/build/install.sh mode=a+x + when: QAT_ENABLED + - name: Run a script with arguments + command: ./install.sh chdir=/root/qat_driver_dest/build + when: QAT_ENABLED + - name: get qat devices + shell: /usr/local/bin/adf_ctl status | grep up | awk '{print $4 substr($1, 4)}' | tr -d ',' + register: qat_devices + when: QAT_ENABLED + - name: Updating the qat device SSL values to avoid duplication + command: "./substitute.sh chdir={{ playbook_dir }}" + when: QAT_ENABLED diff --git a/kud/deployment_infra/playbooks/substitute.sh b/kud/deployment_infra/playbooks/substitute.sh new file mode 100755 index 00000000..f6907a42 --- /dev/null +++ b/kud/deployment_infra/playbooks/substitute.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 +# 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 +############################################################################## + +for file in $(find /etc/*.conf -type f -name "c6xxvf_dev*.conf"); do + device_id=$( echo $file | cut -d '_' -f 2 | tr -cd '[[:digit:]]') + echo $device_id + cat /etc/c6xxvf_dev${device_id}.conf + sed -i "s/\[SSL\]/\[SSL${device_id}\]/g" /etc/c6xxvf_dev${device_id}.conf +done + +for file in $(find /etc/*.conf -type f -name "c6xx_dev*.conf"); do + dev_id=$( echo $file | cut -d '_' -f 2 | tr -cd '[[:digit:]]') + echo $dev_id + cat /etc/c6xx_dev${dev_id}.conf + sed -i "s/\[SSL\]/\[SSL${dev_id}\]/g" /etc/c6xx_dev${dev_id}.conf +done diff --git a/kud/hosting_providers/vagrant/README.md b/kud/hosting_providers/vagrant/README.md index 00f0a70f..f0210149 100644 --- a/kud/hosting_providers/vagrant/README.md +++ b/kud/hosting_providers/vagrant/README.md @@ -4,7 +4,7 @@ This project offers a means for deploying a Kubernetes cluster that satisfies the requirements of [ONAP multicloud/k8s plugin][1]. Its -ansible playbooks allow to provision a deployment on Virtual Machines. +ansible playbooks allow provisioning a deployment on Virtual Machines. ![Diagram](../../../docs/img/diagram.png) @@ -21,16 +21,22 @@ Linux instructions to install dependencies and plugins required for its usage. This script supports two Virtualization technologies (Libvirt and VirtualBox). - $ ./setup.sh -p libvirt + $ sudo ./setup.sh -p libvirt Once Vagrant is installed, it's possible to provision a cluster using the following instructions: $ vagrant up && vagrant up installer +In-depth documentation and use cases of various Vagrant commands [Vagrant commands][3] +is available on the Vagrant site. + ## License Apache-2.0 [1]: https://git.onap.org/multicloud/k8s + [2]: https://www.vagrantup.com/ + +[3]: https://www.vagrantup.com/docs/cli/ diff --git a/kud/hosting_providers/vagrant/installer.sh b/kud/hosting_providers/vagrant/installer.sh index 15974863..e14974a8 100755 --- a/kud/hosting_providers/vagrant/installer.sh +++ b/kud/hosting_providers/vagrant/installer.sh @@ -155,13 +155,13 @@ function install_addons { _install_ansible sudo ansible-galaxy install $verbose -r $kud_infra_folder/galaxy-requirements.yml --ignore-errors ansible-playbook $verbose -i $kud_inventory $kud_playbooks/configure-kud.yml | sudo tee $log_folder/setup-kud.log - for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov}; do + for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov qat}; do echo "Deploying $addon using configure-$addon.yml playbook.." ansible-playbook $verbose -i $kud_inventory $kud_playbooks/configure-${addon}.yml | sudo tee $log_folder/setup-${addon}.log done echo "Run the test cases if testing_enabled is set to true." if [[ "${testing_enabled}" == "true" ]]; then - for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov}; do + for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov qat}; do pushd $kud_tests bash ${addon}.sh popd diff --git a/kud/tests/_common.sh b/kud/tests/_common.sh index 92c09b0d..cd704c53 100755 --- a/kud/tests/_common.sh +++ b/kud/tests/_common.sh @@ -1158,3 +1158,15 @@ function populate_CSAR_fw_rbdefinition { popd } +function populate_CSAR_composite_app_helm { + _checks_args "$1" + pushd "${CSAR_DIR}/$1" + print_msg "Create Helm Chart Archives for compositeApp" + rm -f *.tar.gz + tar -czf collectd.tar.gz -C $test_folder/vnfs/comp-app/collection/app1/helm . + tar -czf prometheus.tar.gz -C $test_folder/vnfs/comp-app/collection/app2/helm . + tar -czf collectd_profile.tar.gz -C $test_folder/vnfs/comp-app/collection/app1/profile . + tar -czf prometheus_profile.tar.gz -C $test_folder/vnfs/comp-app/collection/app2/profile . + popd +} + diff --git a/kud/tests/plugin_collection_v2.sh b/kud/tests/plugin_collection_v2.sh new file mode 100755 index 00000000..068864d7 --- /dev/null +++ b/kud/tests/plugin_collection_v2.sh @@ -0,0 +1,392 @@ +# /* +# * Copyright 2020 Intel Corporation, Inc +# * +# * 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. +# */ + +set -o errexit +set -o nounset +set -o pipefail +#set -o xtrace + +source _common_test.sh +source _functions.sh +source _common.sh + +if [ ${1:+1} ]; then + if [ "$1" == "--external" ]; then + master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \ + awk -F ":" '{print $2}' | awk -F "//" '{print $2}') + onap_svc_node_port=30498 + base_url="http://$master_ip:$onap_svc_node_port/v1" + fi +fi + +base_url=${base_url:-"http://localhost:9015/v2"} +kubeconfig_path="$HOME/.kube/config" +csar_id=cb009bfe-bbee-11e8-9766-525400435678 + + +project_name="test_project" +project_description="test_project_description" +userData1="user1" +userData2="user2" + +composite_app_name="test_composite_app" +composite_app_description="test_project_description" +composite_app_version="test_composite_app_version" +app1_helm_path="$CSAR_DIR/$csar_id/collectd.tar.gz" +app2_helm_path="$CSAR_DIR/$csar_id/prometheus.tar.gz" +app1_profile_path="$CSAR_DIR/$csar_id/collectd_profile.tar.gz" +app2_profile_path="$CSAR_DIR/$csar_id/prometheus_profile.tar.gz" + +app1_name="collectd" +app2_name="prometheus" +app1_desc="collectd_desc" +app2_desc="prometheus_desc" + +main_composite_profile_name="main_composite_profile" +sub_composite_profile_name1="test_composite_profile1" +sub_composite_profile_name2="test_composite_profile2" +composite_profile_description="test_composite_profile_description" + +genericPlacementIntentName1="test_gen_placement_intent1" +genericPlacementIntentName2="test_gen_placement_intent2" +genericPlacementIntentDesc="test_gen_placement_intent_desc" +logicalCloud="logical_cloud_name" +clusterName1="edge1" +clusterName2="edge2" +clusterLabelName1="east-us1" +clusterLabelName2="east-us2" + +deploymentIntentGroupName="test_deployment_intent_group" +deploymentIntentGroupNameDesc="test_deployment_intent_group_desc" + +chart_name="edgex" +profile_name="test_profile" +release_name="test-release" +namespace="plugin-tests-namespace" +cloud_region_id="kud" +cloud_region_owner="localhost" + +# Setup +install_deps +populate_CSAR_composite_app_helm "$csar_id" + +# BEGIN: Register project API +print_msg "Registering project" +payload="$(cat <<EOF +{ + "metadata": { + "name": "${project_name}", + "description": "${project_description}", + "userData1": "${userData1}", + "userData2": "${userData2}" + } +} +EOF +)" +call_api -d "${payload}" "${base_url}/projects" +# END: Register project API + +# BEGIN: Register composite-app API +print_msg "Registering composite-app" +payload="$(cat <<EOF +{ + "metadata": { + "name": "${composite_app_name}", + "description": "${composite_app_description}", + "userData1": "${userData1}", + "userData2": "${userData2}" + }, + "spec":{ + "version":"${composite_app_version}" + } +} +EOF +)" +call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps" +# END: Register composite-app API + + + + +# BEGIN: Create entries for app1&app2 in the database +print_msg "Making app entry in the database" +payload="$(cat <<EOF +{ + "metadata": { + "name": "${app1_name}", + "description": "${app1_desc}", + "userData1": "${userData1}", + "userData2": "${userData2}" + } +} +EOF +)" + +call_api -F "metadata=$payload" \ + -F "file=@$app1_helm_path" \ + "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/apps" + + +# BEGIN: Create an entry for app2 in the database +print_msg "Making app entry in the database" +payload="$(cat <<EOF +{ + "metadata": { + "name": "${app2_name}", + "description": "${app2_desc}", + "userData1": "${userData1}", + "userData2": "${userData2}" + } +} +EOF +)" + +call_api -F "metadata=$payload" \ + -F "file=@$app2_helm_path" \ + "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/apps" +# END: Create entries for app1&app2 in the database + + +# BEGIN: Register the main composite-profile +print_msg "Registering the main composite-profile" +payload="$(cat <<EOF +{ + "metadata":{ + "name":"${main_composite_profile_name}", + "description":"${composite_profile_description}", + "userData1":"${userData1}", + "userData2":"${userData2}" + } +} +EOF +)" +call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/composite-profiles" +# BEGIN: Register the main composite-profile + + +# BEGIN : Adding profile to each of the two apps - app1(collectd) and app2(prometheus) +print_msg "Registering profile with app1(collectd)" +payload="$(cat <<EOF +{ + "metadata":{ + "name":"${sub_composite_profile_name1}", + "description":"${composite_profile_description}", + "userData1":"${userData1}", + "userData2":"${userData2}" + }, + "spec":{ + "app-name": "${app1_name}" + } +} +EOF +)" + +call_api -F "metadata=$payload" \ + -F "file=@$app1_profile_path" \ + "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/composite-profiles/${main_composite_profile_name}/profiles" + +print_msg "Registering profile with app2(prometheus)" +payload="$(cat <<EOF +{ + "metadata":{ + "name":"${sub_composite_profile_name2}", + "description":"${composite_profile_description}", + "userData1":"${userData1}", + "userData2":"${userData2}" + }, + "spec":{ + "app-name": "${app2_name}" + } +} +EOF +)" + +call_api -F "metadata=$payload" \ + -F "file=@$app2_profile_path" \ + "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/composite-profiles/${main_composite_profile_name}/profiles" +# END : Adding profile to each of the two apps - app1(collectd) and app2(prometheus) + +# BEGIN: Register GenericPlacementIntents with the database +print_msg "Registering GenericPlacementIntent for app1" +payload="$(cat <<EOF +{ + "metadata":{ + "name":"${genericPlacementIntentName1}", + "description":"${genericPlacementIntentDesc}", + "userData1":"${userData1}", + "userData2":"${userData2}" + }, + "spec":{ + "logical-cloud":"${logicalCloud}" + } +} +EOF +)" +call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/generic-placement-intents" + + +print_msg "Registering GenericPlacementIntent for app2" +payload="$(cat <<EOF +{ + "metadata":{ + "name":"${genericPlacementIntentName2}", + "description":"${genericPlacementIntentDesc}", + "userData1":"${userData1}", + "userData2":"${userData2}" + }, + "spec":{ + "logical-cloud":"${logicalCloud}" + } +} +EOF +)" +call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/generic-placement-intents" +# END: Register GenericPlacementIntents with the database + +# BEGIN: Adding placement intent for each app in the composite app. +print_msg "Adding placement intent for app1(collectd)" +payload="$(cat <<EOF +{ + "metadata":{ + "name":"${genericPlacementIntentName1}", + "description":"${genericPlacementIntentDesc}", + "userData1":"${userData1}", + "userData2":"${userData2}" + }, + "spec":{ + "app-name":"${app1_name}", + "intent":{ + "allOf":[ + { + "cluster-name":"${clusterName1}" + }, + { + "cluster-name":"${clusterName2}" + }, + { + "anyOf":[ + { + "cluster-label-name":"${clusterLabelName1}" + }, + { + "cluster-label-name":"${clusterLabelName2}" + } + ] + } + ] + } + } +} +EOF +)" +call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/generic-placement-intents/${genericPlacementIntentName1}/app-intents" + +print_msg "Adding placement intent for app2(prometheus)" +payload="$(cat <<EOF +{ + "metadata":{ + "name":"${genericPlacementIntentName2}", + "description":"${genericPlacementIntentDesc}", + "userData1":"${userData1}", + "userData2":"${userData2}" + }, + "spec":{ + "app-name":"${app2_name}", + "intent":{ + "allOf":[ + { + "cluster-name":"${clusterName1}" + }, + { + "cluster-name":"${clusterName2}" + }, + { + "anyOf":[ + { + "cluster-label-name":"${clusterLabelName1}" + }, + { + "cluster-label-name":"${clusterLabelName2}" + } + ] + } + ] + } + } +} +EOF +)" +call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/generic-placement-intents/${genericPlacementIntentName2}/app-intents" +# END: Adding placement intent for each app in the composite app. + +# BEGIN: Registering DeploymentIntentGroup in the database +print_msg "Registering DeploymentIntentGroup" +payload="$(cat <<EOF +{ + "metadata":{ + "name":"${deploymentIntentGroupName}", + "description":"${deploymentIntentGroupNameDesc}", + "userData1":"${userData1}", + "userData2":"${userData2}" + }, + "spec":{ + "profile":"${main_composite_profile_name}", + "version":"${composite_app_version}", + "override-values":[ + { + "app-name":"${app1_name}", + "values": + { + "imageRepository":"registry.hub.docker.com" + } + }, + { + "app-name":"${app2_name}", + "values": + { + "imageRepository":"registry.hub.docker.com" + } + } + ] + } +} +EOF +)" +call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/deployment-intent-groups" +# END: Registering DeploymentIntentGroup in the database + +# BEGIN: Adding intents to an intent group +print_msg "Adding two intents to the intent group" +payload="$(cat <<EOF +{ + "metadata":{ + "name":"${deploymentIntentGroupName}", + "description":"${deploymentIntentGroupNameDesc}", + "userData1":"${userData1}", + "userData2":"${userData2}" + }, + "spec":{ + "intent":{ + "generic-placement-intent":"${genericPlacementIntentName1}", + "generic-placement-intent":"${genericPlacementIntentName2}" + } + } +} +EOF +)" +call_api -d "${payload}" "${base_url}/projects/${project_name}/composite-apps/${composite_app_name}/${composite_app_version}/deployment-intent-groups/${deploymentIntentGroupName}/intents" +# END: Adding intents to an intent group + diff --git a/kud/tests/qat.sh b/kud/tests/qat.sh new file mode 100755 index 00000000..71769ae3 --- /dev/null +++ b/kud/tests/qat.sh @@ -0,0 +1,86 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 +# 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 +############################################################################## + +set -o pipefail + +qat_device=$( for i in 0434 0435 37c8 6f54 19e2; \ + do lspci -d 8086:$i -m; done |\ + grep -i "Quick*" | head -n 1 | cut -d " " -f 5 ) +#Checking if the QAT device is on the node +if [ -z "$qat_device" ]; then + echo "False. This test case cannot run. Qat device unavailable." + QAT_ENABLED=False + exit 0 +else + echo "True. Can run QAT on this device." + QAT_ENABLED=True +fi + +pod_name=pod-case-01 +rm -f $HOME/$pod_name.yaml +kubectl delete pod $pod_name --ignore-not-found=true --now --wait +allocated_node_resource=$(kubectl describe node | grep "qat.intel.com" | tail -n1 |awk '{print $(NF)}') +echo "The allocated resource of the node is: " $allocated_node_resource +cat << POD > $HOME/$pod_name.yaml +kind: Pod +apiVersion: v1 +metadata: + name: pod-case-01 +spec: + containers: + - name: pod-case-01 + image: openssl-test:latest + imagePullPolicy: IfNotPresent + volumeMounts: + - mountPath: /dev + name: dev-mount + - mountPath: /etc/c6xxvf_dev0.conf + name: dev0 + command: [ "/bin/bash", "-c", "--" ] + args: [ "while true; do sleep 300000; done;" ] + resources: + requests: + qat.intel.com/cy2_dc2: '1' + limits: + qat.intel.com/cy2_dc2: '1' + volumes: + - name: dev-mount + hostPath: + path: /dev + - name: dev0 + hostPath: + path: /etc/c6xxvf_dev0.conf +POD +kubectl create -f $HOME/$pod_name.yaml --validate=false + for pod in $pod_name; do + status_phase="" + while [[ $status_phase != "Running" ]]; do + new_phase=$(kubectl get pods $pod | awk 'NR==2{print $3}') + if [[ $new_phase != $status_phase ]]; then + echo "$(date +%H:%M:%S) - $pod : $new_phase" + status_phase=$new_phase + fi + if [[ $new_phase == "Running" ]]; then + echo "Pod is up and running.." + fi + if [[ $new_phase == "Err"* ]]; then + exit 1 + fi + done + done + +allocated_node_resource=$(kubectl describe node | grep "qat.intel.com" | tail -n1 |awk '{print $(NF)}') +echo "The allocated resource of the node is: " $allocated_node_resource +adf_ctl restart +systemctl restart qat_service +kubectl exec -it pod-case-01 -- openssl engine -c -t qat + +kubectl delete pod $pod_name --now +echo "Test complete." diff --git a/kud/tests/sdwan/build/commands.lua b/kud/tests/sdwan/build/commands.lua deleted file mode 100644 index d99f4579..00000000 --- a/kud/tests/sdwan/build/commands.lua +++ /dev/null @@ -1,43 +0,0 @@ --- Licensed to the public under the GNU General Public License v2. - -module("luci.controller.commands", package.seeall) - -sys = require "luci.sys" -ut = require "luci.util" -io = require "io" - -ip = "ip -4 " - -function index() - entry({"admin", "config", "command"}, - call("execute")).dependent = false -end - -function trim(s) - return s:match("^%s*(.-)%s*$") -end - -function split_and_trim(str, sep) - local array = {} - local reg = string.format("([^%s]+)", sep) - for item in string.gmatch(str, reg) do - item_trimed = trim(item) - if string.len(item_trimed) > 0 then - table.insert(array, item_trimed) - end - end - return array -end - -function execute() - local commands = luci.http.formvalue("command") - io.stderr:write("Execute command: %s\n" % commands) - - local command_array = split_and_trim(commands, ";") - for index, command in ipairs(command_array) do - sys.exec(command) - end - - luci.http.prepare_content("application/json") - luci.http.write_json("{'status':'ok'}") -end diff --git a/kud/tests/vnfs/comp-app/collection/.helmignore b/kud/tests/vnfs/comp-app/collection/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/.helmignore b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/.helmignore new file mode 100644 index 00000000..f0c13194 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/Chart.yaml b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/Chart.yaml new file mode 100644 index 00000000..fcdcfde9 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/Chart.yaml @@ -0,0 +1,19 @@ +# Copyright 2019 Intel Corporation, Inc +# +# 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. + +apiVersion: v1 +appVersion: "7.1.0" +description: Collectd Helm Chart +name: collectd +version: 0.2.0 diff --git a/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/resources/collectd.conf b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/resources/collectd.conf new file mode 100644 index 00000000..b023b320 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/resources/collectd.conf @@ -0,0 +1,44 @@ +FQDNLookup false +LoadPlugin cpu +LoadPlugin memory +LoadPlugin cpufreq +LoadPlugin disk +LoadPlugin ethstat +LoadPlugin ipc +LoadPlugin ipmi +LoadPlugin load +LoadPlugin numa +LoadPlugin processes +LoadPlugin df +LoadPlugin turbostat +LoadPlugin uptime +LoadPlugin contextswitch +LoadPlugin irq +LoadPlugin df +LoadPlugin swap +LoadPlugin write_prometheus + +LoadPlugin logfile +<Plugin logfile> + LogLevel info + File "/var/log/collectd.log" + Timestamp true + PrintSeverity false +</Plugin> +<Plugin "cpu"> + Interval 5 + ReportByState false + ReportByCpu false +</Plugin> + +<Plugin "memory"> + Interval 30 + ValuesAbsolute false + ValuesPercentage true +</Plugin> + +<Plugin "write_prometheus"> + Port "{{ .Values.collectd_prometheus.service.targetPort }}" +</Plugin> + +#Last line (collectd requires ā\nā at the last line) diff --git a/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/NOTES.txt b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/NOTES.txt new file mode 100644 index 00000000..06ca128b --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/NOTES.txt @@ -0,0 +1,34 @@ +# Copyright (c) 2019 Intel Corporation. +# +# 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. + + +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} +{{- else if contains "NodePort" .Values.collectd_prometheus.service.type }} + NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "name" . }}) + NODE_IPS=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[*].status.addresses[0].address}") + visit http://NODE_IP:NODE_PORT +{{- else if contains "LoadBalancer" .Values.collectd_prometheus.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "name" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "name" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} +{{- else if contains "ClusterIP" .Values.collectd_prometheus.service.type }} + CLUSTER_NODE_IPS=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[*].status.addresses[0].address}") + CLUSTER_NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].port}" services {{ include "name" . }}) + visit http://CLUSTER_NODE_IP:CLUSTER_NODE_PORT +{{- end }} diff --git a/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/_helpers.tpl b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/_helpers.tpl new file mode 100644 index 00000000..b5e98086 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/_helpers.tpl @@ -0,0 +1,25 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* Workaround for https://github.com/helm/helm/issues/3117 */}} +{{- define "rangeskipempty" -}} +{{- range $key, $value := . }} +{{- if $value }} +{{ $key }}: {{ $value }} +{{- end }} +{{- end }} +{{- end }}
\ No newline at end of file diff --git a/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/configmap.yaml b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/configmap.yaml new file mode 100644 index 00000000..26d0fb5d --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/configmap.yaml @@ -0,0 +1,26 @@ +{{/* +# Copyright 2019 Intel Corporation, Inc +# +# 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. +*/}} + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }}-config + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} +data: + {{- tpl (.Files.Glob "resources/*").AsConfig . | nindent 2 }} diff --git a/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/daemonset.yaml b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/daemonset.yaml new file mode 100644 index 00000000..bc686381 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/daemonset.yaml @@ -0,0 +1,84 @@ +{{/* +# Copyright 2019 Intel Corporation, Inc +# +# 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. +*/}} + +apiVersion: extensions/v1beta1 +kind: DaemonSet +metadata: + name: {{ template "fullname" . }} + annotations: + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} +spec: + replicas: {{ .Values.replicaCount }} + updateStrategy: + type: RollingUpdate + template: + metadata: + labels: + app: {{ template "name" . }} + collector: collectd + release: {{ .Release.Name }} + spec: + hostNetwork: true + {{- if .Values.serviceAccountName }} + serviceAccountName: {{ .Values.serviceAccountName }} + {{- end }} +{{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | trim | indent 8 }} +{{- end }} +{{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | trim | indent 8 }} +{{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + securityContext: + allowPrivilegeEscalation: true + privileged: true +{{- if .Values.env }} + env: +{{ toYaml .Values.env | trim | indent 10 }} +{{- end }} +{{- if .Values.command }} + command: +{{ toYaml .Values.command | trim | indent 10 }} +{{- end }} +{{- if .Values.args }} + args: +{{ toYaml .Values.args | trim | indent 10 }} +{{- end }} + volumeMounts: + - name: {{ template "fullname" . }}-config + mountPath: {{ .Values.configMountPath }} +{{- if .Values.volumeMounts }} +{{ toYaml .Values.volumeMounts | trim | indent 10 }} +{{- end }} + resources: +{{- toYaml .Values.resources | trim | indent 12}} + volumes: + - name: {{ template "fullname" . }}-config + configMap: + name: {{ template "fullname" . }}-config + defaultMode: 0744 +{{- if .Values.volumeMounts }} +{{ toYaml .Values.volumes | indent 6 }} +{{- end }} diff --git a/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/service.yaml b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/service.yaml new file mode 100644 index 00000000..7571715d --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/templates/service.yaml @@ -0,0 +1,32 @@ +{{/* +# Copyright 2019 Intel Corporation, Inc +# +# 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. +*/}} + +apiVersion: v1 +kind: Service +metadata: + name: collectd + labels: + app: collectd + release: {{ .Release.Name }} +spec: + ports: + - name: collectd-prometheus + port: {{ .Values.collectd_prometheus.service.port }} + protocol: TCP + targetPort: {{ .Values.collectd_prometheus.service.targetPort }} + selector: +{{ include "rangeskipempty" .Values.collectd_prometheus.service.selector | indent 4 }} + type: ClusterIP diff --git a/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/values.yaml b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/values.yaml new file mode 100644 index 00000000..41d63cbf --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app1/helm/collectd/values.yaml @@ -0,0 +1,78 @@ +# Default values for collectd. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +ingress: + enabled: false +image: + repository: opnfv/barometer-collectd + tag: latest + pullPolicy: IfNotPresent +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + +#serviceAccountName: cmk-serviceaccount + +# Uncomment the following tolerations and/or nodeSelector to select the node collectd to be deployed +#tolerations: +# - operator: "Exists" +#nodeSelector: +# vcmts: "true" + +# Uncomment the following to set environment, command and args for the collectd container +#env: +#- name: CMK_PROC_FS +# value: "/host/proc" +#command: +#- "/bin/bash" +#- "-c" +#args: [ "/opt/bin/cmk isolate --conf-dir=/etc/cmk --pool=infra /script/collectd.sh" ] + +# all the files under the directory resource will be mount into the directory specified by 'configMountPath' inside the container. +# Besides that, users can specify any mount by using the 'volumeMounts' and 'volumes'. +configMountPath: /opt/collectd/etc +volumeMounts: +- name: proc + mountPath: /mnt/proc + readOnly: true +- name: root + mountPath: /hostfs + readOnly: true +- name: etc + mountPath: /mnt/etc + readOnly: true +- name: run + mountPath: /var/run/docker.sock + +volumes: +- name: proc + hostPath: + path: /proc +- name: root + hostPath: + path: / +- name: etc + hostPath: + path: /etc +- name: run + hostPath: + path: /var/run/docker.sock + +collectd_prometheus: + service: + type: ClusterIP + name: collectd + port: 9103 + targetPort: 9103 + selector: + app: collectd + collector: collectd diff --git a/kud/tests/vnfs/comp-app/collection/app1/profile/manifest.yaml b/kud/tests/vnfs/comp-app/collection/app1/profile/manifest.yaml new file mode 100644 index 00000000..4d381d02 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app1/profile/manifest.yaml @@ -0,0 +1,4 @@ +--- +version: v1 +type: + values: "override_values.yaml" diff --git a/kud/tests/vnfs/comp-app/collection/app1/profile/override_values.yaml b/kud/tests/vnfs/comp-app/collection/app1/profile/override_values.yaml new file mode 100644 index 00000000..304ae5de --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app1/profile/override_values.yaml @@ -0,0 +1,9 @@ +collectd_prometheus: + service: + type: ClusterIP + name: collectd-override + port: 9103 + targetPort: 9103 + selector: + app: collectd + collector: collectd
\ No newline at end of file diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/.helmignore b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/Chart.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/Chart.yaml new file mode 100644 index 00000000..6e7ddfbc --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: Prometheus instance with remote storage integrations. +name: prometheus +version: 0.1.0 diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/NOTES.txt b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/NOTES.txt new file mode 100644 index 00000000..f8882883 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/NOTES.txt @@ -0,0 +1,15 @@ +1. Get the application URL by running these commands: +{{ if contains "NodePort" .Values.prometheus.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "prometheus.fullname" . }}-prometheus) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.prometheus.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "prometheus.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "prometheus.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.prometheus.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "prometheus.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:9090 to use your application" + kubectl port-forward $POD_NAME 9090:80 +{{- end }} diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/_helpers.tpl b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/_helpers.tpl new file mode 100644 index 00000000..17b7e7bd --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/_helpers.tpl @@ -0,0 +1,57 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "prometheus.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "prometheus.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "prometheus.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* Create chart name and version as used by the chart label. */}} +{{- define "prometheus.chartref" -}} +{{- replace "+" "_" .Chart.Version | printf "%s-%s" .Chart.Name -}} +{{- end }} + +{{/* Generate basic labels */}} +{{- define "prometheus.labels" }} +chart: {{ template "prometheus.chartref" . }} +release: {{ .Release.Name | quote }} +heritage: {{ .Release.Service | quote }} +{{- if .Values.commonLabels}} +{{ toYaml .Values.commonLabels }} +{{- end }} +{{- end }} + + +{{/* Create the name of prometheus service account to use */}} +{{- define "prometheus.serviceAccountName" -}} +{{- if .Values.prometheus.serviceAccount.create -}} + {{ default (include "prometheus.fullname" .) .Values.prometheus.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.prometheus.serviceAccount.name }} +{{- end -}} +{{- end -}}
\ No newline at end of file diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/prometheus.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/prometheus.yaml new file mode 100644 index 00000000..53494920 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/prometheus.yaml @@ -0,0 +1,19 @@ +apiVersion: monitoring.coreos.com/v1 +kind: Prometheus +metadata: + name: {{ template "prometheus.fullname" . }}-prometheus + labels: + app: {{ template "prometheus.name" . }}-prometheus + "helm.sh/hook": post-install + "helm.sh/hook-weight": "2" +spec: + serviceAccountName: {{ template "prometheus.serviceAccountName" . }} + serviceMonitorSelector: + matchLabels: + app: {{ template "prometheus.name" . }}-prometheus + release: {{ .Release.Name }} + serviceMonitorNamespaceSelector: + matchNames: + - {{ .Release.Namespace | quote }} + resources: +{{ toYaml .Values.prometheus.resources | indent 4 }} diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/role.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/role.yaml new file mode 100644 index 00000000..dfb932d8 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/role.yaml @@ -0,0 +1,21 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ template "prometheus.fullname" . }}-prometheus + labels: + app: {{ template "prometheus.name" . }}-prometheus +{{ include "prometheus.labels" . | indent 4 }} +rules: +- apiGroups: + - "" + resources: + - nodes + - services + - endpoints + - pods + verbs: + - get + - list + - watch
\ No newline at end of file diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/rolebinding.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/rolebinding.yaml new file mode 100644 index 00000000..04932ee1 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/rolebinding.yaml @@ -0,0 +1,17 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "prometheus.fullname" . }}-prometheus + labels: + app: {{ template "prometheus.name" . }}-prometheus +{{ include "prometheus.labels" . | indent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ template "prometheus.fullname" . }}-prometheus +subjects: +- kind: ServiceAccount + name: {{ template "prometheus.serviceAccountName" . }} + namespace: {{ .Release.Namespace }}
\ No newline at end of file diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/service.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/service.yaml new file mode 100644 index 00000000..0114ed2e --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/service.yaml @@ -0,0 +1,38 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "prometheus.fullname" . }}-prometheus + labels: + app: {{ template "prometheus.name" . }}-prometheus +{{- if .Values.prometheus.service.annotations }} + annotations: +{{ toYaml .Values.prometheus.service.annotations | indent 4 }} +{{- end }} +spec: +{{- if .Values.prometheus.service.clusterIP }} + clusterIP: {{ .Values.prometheus.service.clusterIP }} +{{- end }} +{{- if .Values.prometheus.service.externalIPs }} + externalIPs: +{{ toYaml .Values.prometheus.service.externalIPs | indent 4 }} +{{- end }} +{{- if .Values.prometheus.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.prometheus.service.loadBalancerIP }} +{{- end }} +{{- if .Values.prometheus.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range $cidr := .Values.prometheus.service.loadBalancerSourceRanges }} + - {{ $cidr }} + {{- end }} +{{- end }} + ports: + - name: web + {{- if eq .Values.prometheus.service.type "NodePort" }} + nodePort: {{ .Values.global.nodePortPrefix }}{{ .Values.prometheus.service.nodePort }} + {{- end }} + port: 9090 + targetPort: web + selector: + app: prometheus + prometheus: {{ template "prometheus.fullname" . }}-prometheus + type: "{{ .Values.prometheus.service.type }}" diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/serviceaccount.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/serviceaccount.yaml new file mode 100644 index 00000000..82437523 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/serviceaccount.yaml @@ -0,0 +1,11 @@ +{{- if .Values.prometheus.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "prometheus.serviceAccountName" . }} + labels: + app: {{ template "prometheus.name" . }}-prometheus +{{ include "prometheus.labels" . | indent 4 }} +imagePullSecrets: +{{ toYaml .Values.global.imagePullSecrets | indent 2 }} +{{- end }} diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/servicemonitor.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/servicemonitor.yaml new file mode 100644 index 00000000..ea2b81b6 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/templates/servicemonitor.yaml @@ -0,0 +1,30 @@ +{{- if .Values.prometheus.additionalServiceMonitors }} +apiVersion: v1 +kind: List +items: +{{- range .Values.prometheus.additionalServiceMonitors }} + - apiVersion: "monitoring.coreos.com/v1" + kind: ServiceMonitor + metadata: + name: {{ .name }} + "helm.sh/hook": post-install + "helm.sh/hook-weight": "1" + labels: + app: {{ template "prometheus.name" $ }}-prometheus +{{ include "prometheus.labels" $ | indent 8 }} + {{- if .additionalLabels }} +{{ toYaml .additionalLabels | indent 8 }} + {{- end }} + spec: + endpoints: +{{ toYaml .endpoints | indent 8 }} + {{- if .jobLabel }} + jobLabel: {{ .jobLabel }} + {{- end }} + namespaceSelector: + matchNames: + - {{ $.Release.Namespace | quote }} + selector: +{{ toYaml .selector | indent 8 }} release: {{ $.Release.Name | quote }} +{{- end }} +{{- end }} diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/values.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/values.yaml new file mode 100644 index 00000000..e35c6735 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus/values.yaml @@ -0,0 +1,69 @@ +## Deploy a Prometheus instance +## +prometheus: + serviceAccount: + create: true + name: "" + additionalServiceMonitors: + - name: service-monitor-collectd + additionalLabels: + collector: collectd + jobLabel: collectd + selector: + matchLabels: + app: collectd + endpoints: + - port: collectd-prometheus + interval: 10s + path: /metrics + - name: service-monitor-node-exporter + additionalLabels: + collector: prometheus-node-exporter + jobLabel: node-exporter + selector: + matchLabels: + app: prometheus-node-exporter + endpoints: + - port: metrics + interval: 30s + - name: service-monitor-cadvisor + additionalLabels: + collector: cadvisor + jobLabel: cadvisor + selector: + matchLabels: + app: cadvisor + endpoints: + - port: cadvisor-prometheus + interval: 10s + path: /metrics + + resources: {} + service: + type: ClusterIP + annotations: {} + labels: {} + clusterIP: "" + + ## To be used with a proxy extraContainer port + targetPort: 9090 + + ## List of IP addresses at which the Prometheus server service is available + ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips + ## + externalIPs: [] + + ## Port to expose on each node + ## Only used if service.type is 'NodePort' + ## + # nodePort: 90 + + ## Loadbalancer IP + ## Only use if service.type is "loadbalancer" + loadBalancerIP: "" + loadBalancerSourceRanges: [] + ## Service type + ## + #type: NodePort + + sessionAffinity: "" diff --git a/kud/tests/vnfs/comp-app/collection/app2/profile/manifest.yaml b/kud/tests/vnfs/comp-app/collection/app2/profile/manifest.yaml new file mode 100644 index 00000000..4d381d02 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/profile/manifest.yaml @@ -0,0 +1,4 @@ +--- +version: v1 +type: + values: "override_values.yaml" diff --git a/kud/tests/vnfs/comp-app/collection/app2/profile/override_values.yaml b/kud/tests/vnfs/comp-app/collection/app2/profile/override_values.yaml new file mode 100644 index 00000000..6743ac5b --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/profile/override_values.yaml @@ -0,0 +1,6 @@ +service: + type: ClusterIP + name: Prometheus + annotations: {} + labels: {} + clusterIP: ""
\ No newline at end of file |