multicloud/k8s.git
3 years agoCorrect Query API endpoint registration 65/118965/1
Konrad Bańka [Tue, 9 Mar 2021 14:57:37 +0000 (15:57 +0100)]
Correct Query API endpoint registration

Apart from corrections, corrected handling of name-only query requests
as well as provided bunch of UTs.

Issue-ID: MULTICLOUD-1307
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: Ida3d3e434525f323bd8c40ddc7ffd58df9c5e831

3 years agoMerge "Add k8splugin releases file for 0.8.0"
Ritu Sood [Fri, 26 Feb 2021 20:40:29 +0000 (20:40 +0000)]
Merge "Add k8splugin releases file for 0.8.0"

3 years agoAdd k8splugin releases file for 0.8.0 24/118424/3
Lukasz Rajewski [Wed, 24 Feb 2021 17:54:54 +0000 (18:54 +0100)]
Add k8splugin releases file for 0.8.0

Add k8splugin releases file for 0.8.0

Issue-ID: MULTICLOUD-1294
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
Change-Id: I30991d735fc96054b0fd726a42b3b1f7d69c7201

3 years agoProvide Healthcheck API MVP 41/118441/4 0.8.0
Konrad Bańka [Wed, 24 Feb 2021 23:08:05 +0000 (00:08 +0100)]
Provide Healthcheck API MVP

Implements basic functionality of running starting Healthcheck.
Results can be inspected so-far without dedicated API, by using, for
example, Query API.

Issue-ID: MULTICLOUD-1233
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: Ia4d96d936d573173d7d8f41e6c39d059bf5f8b1f

3 years agoMerge "Update k8splugin for H release"
Ritu Sood [Thu, 25 Feb 2021 14:17:56 +0000 (14:17 +0000)]
Merge "Update k8splugin for H release"

3 years agoMerge "Provide Query API for CNF Instances"
Ritu Sood [Thu, 25 Feb 2021 14:17:19 +0000 (14:17 +0000)]
Merge "Provide Query API for CNF Instances"

3 years agoProvide Query API for CNF Instances 18/118418/4
Konrad Bańka [Wed, 24 Feb 2021 17:28:56 +0000 (18:28 +0100)]
Provide Query API for CNF Instances

Query API doesn't directly use Status API code, in order to allow for
querying derived resources that might not be typically returned by
Status API like replicasets for deployment.

Issue-ID: MULTICLOUD-1305
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: If15adce23845880f3e6771cc8eab78a78ab13517

3 years agoUpdate k8splugin for H release 17/118417/1
Lukasz Rajewski [Wed, 24 Feb 2021 17:17:00 +0000 (18:17 +0100)]
Update k8splugin for H release

Update image version of k8splugin to 0.8.0-SNAPSHOT
This will be then be used to create the release image

Issue-ID: MULTICLOUD-1294
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
Change-Id: I0216c83ad9ffaa2cd11236b4462d01eed84b0764

3 years agoMerge "Move Day2 Config Values API to new endpoint"
Bin Yang [Wed, 24 Feb 2021 13:04:48 +0000 (13:04 +0000)]
Merge "Move Day2 Config Values API to new endpoint"

3 years agoCorrect pip url due to using python2.7 23/118323/2
Konrad Bańka [Tue, 23 Feb 2021 21:48:08 +0000 (22:48 +0100)]
Correct pip url due to using python2.7

Issue-ID: MULTICLOUD-1255
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: I800c4bdbe1fecc61f196ac3098910ae4278bf0cf

3 years agoMove Day2 Config Values API to new endpoint 12/118312/2
Konrad Bańka [Tue, 23 Feb 2021 19:35:59 +0000 (20:35 +0100)]
Move Day2 Config Values API to new endpoint

Issue-ID: MULTICLOUD-1280
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: Ibeb0920b4ce083f4294b83c887fc7c793a2c3df5

3 years agoget-pip.py error on Python 2.7 52/117252/1
Ritu Sood [Fri, 29 Jan 2021 18:31:54 +0000 (10:31 -0800)]
get-pip.py error on Python 2.7

invalid syntax error when KUD is deployed
sys.stderr.write(f"ERROR: {exc}") SyntaxError: invalid syntax

Issue-ID: MULTICLOUD-1255
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Change-Id: Ia4ecbad5735617a5606cbce2ed93a58cb7322cb5

3 years agoMerge "Fix the nodeSelector indent and define name"
Ritu Sood [Sun, 24 Jan 2021 01:13:31 +0000 (01:13 +0000)]
Merge "Fix the nodeSelector indent and define name"

3 years agoProvide simple v3 chart mock test 88/116788/2
Konrad Bańka [Wed, 13 Jan 2021 12:39:53 +0000 (13:39 +0100)]
Provide simple v3 chart mock test

Issue-ID: MULTICLOUD-1267
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: Ib05167a6e0e2c69268bcd85c0ae3fa30fdd78e39

3 years agoRollback helm library to version not failing v3 charts 19/116419/2
Konrad Bańka [Wed, 16 Dec 2020 09:57:29 +0000 (10:57 +0100)]
Rollback helm library to version not failing v3 charts

This change reverts fef2f1a959341d2abaea6dadaecccc4952c284c9 commit that
updated helm library to a version, that no longer allowed helm v3 charts
by explicitly failing when parsing them. Proper support of helm v3 is
still not implemented in k8splugin, but at least it shouldn't fail on v3
packages that don't implement v3-specific features.
Also apart from revert, go.mod/sum have been also tidied.

Issue-ID: MULTICLOUD-1267
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: I992004d30802134039f0a6aca2d07a42db9c2459

3 years agoMerge "MULTICLOUD-1257 updated gui flow"
Ritu Sood [Tue, 15 Dec 2020 00:35:33 +0000 (00:35 +0000)]
Merge "MULTICLOUD-1257 updated gui flow"

3 years agoMerge "Containerized base installation directory change"
Eric Multanen [Thu, 10 Dec 2020 00:44:02 +0000 (00:44 +0000)]
Merge "Containerized base installation directory change"

3 years agoRun all addon tests even when one fails 52/116052/3
Todd Malsbary [Wed, 2 Dec 2020 21:00:45 +0000 (13:00 -0800)]
Run all addon tests even when one fails

Previously the installer would exit immediately after a failure by one
of the addon tests.  Now, record the failure and run subsequent tests,
then exit if any fail.

Issue-ID: MULTICLOUD-1258
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I4fcad9b51b58277344de4fed0e40e87493dc3663

3 years agoMerge "Fix broken virtlet image URL"
Eric Multanen [Thu, 10 Dec 2020 00:21:49 +0000 (00:21 +0000)]
Merge "Fix broken virtlet image URL"

3 years agoMerge "Fix sriov test in baremetal deploy"
Eric Multanen [Thu, 10 Dec 2020 00:21:09 +0000 (00:21 +0000)]
Merge "Fix sriov test in baremetal deploy"

3 years agoMerge "Remove duplicate dict key"
Eric Multanen [Thu, 10 Dec 2020 00:19:52 +0000 (00:19 +0000)]
Merge "Remove duplicate dict key"

3 years agoMerge "Enable pod security policies"
Eric Multanen [Thu, 10 Dec 2020 00:19:11 +0000 (00:19 +0000)]
Merge "Enable pod security policies"

3 years agoRemove duplicate dict key 71/116271/1
Todd Malsbary [Thu, 3 Dec 2020 01:31:38 +0000 (17:31 -0800)]
Remove duplicate dict key

Issue-ID: MULTICLOUD-1262
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: Ie83fad2ad8146b3b33d3a3f0438ff7fe1ac4e475

3 years agoEnable pod security policies 14/115214/6
Todd Malsbary [Fri, 20 Nov 2020 23:42:54 +0000 (15:42 -0800)]
Enable pod security policies

The intention with this change is to disable CAP_NET_RAW (which can be
a security vulnerability) for created Pods.

kubespray provides the podsecuritypolicy_enabled variable for enabling
privileged (for kube-system) and restricted (for everyone else)
policies.  Enabling this requires binding the KUD_ADDONs to the
privileged policy and specifying the security context correctly for
Pods running in the default namespace.

As of this change, the only difference between the privileged and
restricted security policies is the dropping of CAP_NET_RAW in the
restricted policy.  To use the default restricted policy provided with
kubespray, additional changes must be made to the Pods that are run in
the default namespace (such as runing as a non-root user, not
requesting privileged mode, etc.).

Issue-ID: MULTICLOUD-1256
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I7d6add122ad4046f9116ef03a249f5c9da1d7eec

3 years agoFix QAT addon deploy and test 85/116185/1
Todd Malsbary [Thu, 3 Dec 2020 00:09:36 +0000 (16:09 -0800)]
Fix QAT addon deploy and test

Note that as mentioned in install_qat.sh, the kernel command line must
include "intel_iommu=on iommu=pt" for the deploy and test to succeed.

The underlying issue is that the playbook was expecting to be run on
the same host it executed on and was looking for files in the wrong
places.

Issue-ID: MULTICLOUD-1261
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I5f59b9147f34f077fcdc63d7fc5f80b56977054c

3 years agoFix sriov test in baremetal deploy 90/116090/2
Todd Malsbary [Thu, 3 Dec 2020 00:09:14 +0000 (16:09 -0800)]
Fix sriov test in baremetal deploy

The test incorrectly checked the node running the test for sriov
feature support.  This fix now checks the cluster for it.

Issue-ID: MULTICLOUD-1260
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I869823cc062968c8ac7b9fa037d425244a03799c

3 years agoFix broken virtlet image URL 53/116053/1
Todd Malsbary [Thu, 3 Dec 2020 00:07:28 +0000 (16:07 -0800)]
Fix broken virtlet image URL

Issue-ID: MULTICLOUD-1259
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I92cc722818b9023b4aa29d191cf92e2c319f957b

3 years agoMULTICLOUD-1257 updated gui flow 95/116195/1
vikaskumar [Thu, 26 Nov 2020 07:41:45 +0000 (13:11 +0530)]
MULTICLOUD-1257 updated gui flow

Issue-ID: MULTICLOUD-1257
Change-Id: I5c1432c037952abeed6066cb067192076031f9cd
Signed-off-by: vikaskumar <vkumar@aarnanetworks.com>
3 years agoFix the nodeSelector indent and define name 09/114809/4
Le Yao [Thu, 12 Nov 2020 09:24:24 +0000 (09:24 +0000)]
Fix the nodeSelector indent and define name

Deploy the sdewan controller on master node
Change sdewan-contoller-manager to sdewan-crd-controller

Issue-ID: MULTICLOUD-1253
Signed-off-by: Le Yao <le.yao@intel.com>
Change-Id: Ic55744914266278f1c344c10af587d41f4426918

3 years agoFix CrashLoopBackoff in emco-fluentd Pod 61/114461/2
Todd Malsbary [Wed, 21 Oct 2020 16:37:37 +0000 (09:37 -0700)]
Fix CrashLoopBackoff in emco-fluentd Pod

The emco-fluentd pod is stuck in CrashLoopBackOff due to a failure to
resolve the "cluster.local" name.  Explicitly set the
fluentd.clusterDomain value to the actual cluster name during helm
install.

Issue-ID: MULTICLOUD-1244
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: Ia6424e7ce8d4544511ad88c478e65fa8c4df0c52

3 years agoMerge "Build and deploy sriov module only on supported hosts."
Ritu Sood [Thu, 19 Nov 2020 18:13:07 +0000 (18:13 +0000)]
Merge "Build and deploy sriov module only on supported hosts."

3 years agoMerge "Update multus-daemonset.yml to that of multus-cni v3.6 release"
Ritu Sood [Thu, 19 Nov 2020 18:12:34 +0000 (18:12 +0000)]
Merge "Update multus-daemonset.yml to that of multus-cni v3.6 release"

3 years agoMerge "Upgrade kubespray from 2.12.6 to 2.14.1"
Ritu Sood [Thu, 19 Nov 2020 18:12:18 +0000 (18:12 +0000)]
Merge "Upgrade kubespray from 2.12.6 to 2.14.1"

3 years agoMerge "Update images used in onap4k8s and emco helm charts"
Ritu Sood [Thu, 19 Nov 2020 18:11:07 +0000 (18:11 +0000)]
Merge "Update images used in onap4k8s and emco helm charts"

3 years agoMerge "Use same host in both copy and run of deploy_optane.sh"
Ritu Sood [Thu, 19 Nov 2020 18:09:16 +0000 (18:09 +0000)]
Merge "Use same host in both copy and run of deploy_optane.sh"

3 years agoMerge "Ignore 404 when deleting non-existent project in emco.sh"
Ritu Sood [Thu, 19 Nov 2020 18:08:50 +0000 (18:08 +0000)]
Merge "Ignore 404 when deleting non-existent project in emco.sh"

3 years agoMerge "Wait for service to be listening before running tests"
Ritu Sood [Thu, 19 Nov 2020 18:08:35 +0000 (18:08 +0000)]
Merge "Wait for service to be listening before running tests"

3 years agoMerge "Properly escape query string to jq"
Ritu Sood [Thu, 19 Nov 2020 18:08:24 +0000 (18:08 +0000)]
Merge "Properly escape query string to jq"

3 years agoMerge "Move test inside if block to prevent premature exit"
Ritu Sood [Thu, 19 Nov 2020 18:08:12 +0000 (18:08 +0000)]
Merge "Move test inside if block to prevent premature exit"

3 years agoMerge "Fix typo in deployments/helm/v2/emco/Chart.yaml"
Ritu Sood [Thu, 19 Nov 2020 18:07:37 +0000 (18:07 +0000)]
Merge "Fix typo in deployments/helm/v2/emco/Chart.yaml"

3 years agoImprove early-detection of empty template 07/114807/3
Konrad Bańka [Thu, 12 Nov 2020 08:13:37 +0000 (09:13 +0100)]
Improve early-detection of empty template

Previous empty template detection pattern matched only against templates
resolved to empty-or-whitespace-only files. This change makes it handle
other case of empty yaml correctly, namely, yaml containing comments
only.

Issue-ID: MULTICLOUD-1252
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: I9132e167ec607c8a4a4ca5584141ed043c6ddd4f

3 years agoUpdate multus-daemonset.yml to that of multus-cni v3.6 release 65/114465/2
Todd Malsbary [Fri, 30 Oct 2020 20:31:04 +0000 (13:31 -0700)]
Update multus-daemonset.yml to that of multus-cni v3.6 release

The only change to the upstream yml is the removal of the
kube-multus-ds-ppc64le DaemonSet and the replacement of
"default-cni-network" with "cni0".

Note also that the v3.6 yml actually uses the v3.4.1 image tag.  The
yml now points to a v3.4.1 image with the addition of code to merge
the results from all delegates to support Virtlet.

Issue-ID: MULTICLOUD-1230
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I0e18644a567facfac1fd7dc1c053002b2d906288

3 years agoUpgrade kubespray from 2.12.6 to 2.14.1 64/114464/1
Todd Malsbary [Tue, 27 Oct 2020 21:46:29 +0000 (14:46 -0700)]
Upgrade kubespray from 2.12.6 to 2.14.1

- Replace move of ansible.cfg from kubespray distribution to
  /etc/ansible with ANSIBLE_CONFIG environment variable.  Ansible
  modifies ansible.cfg during installation, and the paths in it are
  relative.

- kubespray 2.14.1 requires a kubernetes version > 1.16.  Use the
  default versions of kubernetes and helm provided by kubespray
  2.14.1.

- kubespray 2.14.1 replaces helm 2 with helm 3.  This removes support
  for helm init and helm serve.  It is no longer necessary to call
  helm init, and the helm serve repository is replaced with file
  relative URLs.  This also triggered a subsequent update of the
  kubernetes-helm ansible module to include the newer helm versions.

- Add "storageType: hostPath" to etcd/values.yaml.  Helm deploy of
  etcd will fail without this due to nil
  PersistentVolume.metadata.labels.type.

- The mitogen module used by kubespray/ansible requires python2 on the
  hosts.  Use the linear strategy to bypass mitogen and install
  python2 on the cluster hosts.

Issue-ID: MULTICLOUD-1230
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I9f50bb4e123fdcacab6b6a97e79cd09fb5c96634

3 years agoUse same host in both copy and run of deploy_optane.sh 63/114463/1
Todd Malsbary [Fri, 23 Oct 2020 23:18:58 +0000 (16:18 -0700)]
Use same host in both copy and run of deploy_optane.sh

NOTE: This is not a complete fix, it is only a workaround so that
installer.sh can succeed when Optane hardware is not present.

Without this, "No such file or directory" is reported during the
"Apply Optane PMEM CSI Daemonset" task of the configure-optane
playbook.  This error was observed with kubespray 2.14.1 and not with
2.12.6.

Issue-ID: MULTICLOUD-1234
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I1e23741d704ab117a84b4ed11e2f7ac02f0f2ec2

3 years agoUpdate images used in onap4k8s and emco helm charts 62/114462/1
Todd Malsbary [Thu, 22 Oct 2020 23:57:56 +0000 (16:57 -0700)]
Update images used in onap4k8s and emco helm charts

This was triggered by the failure of plugin_fw.sh when run via the
containerized installer.

The full list of changes is:
- etcd-amd64: 3.2.24 => 3.3.17.  Note that 3.4.9 is the latest as of
  this commit, but 3.4.9 removed the coreutils necessary to run the
  k8s Command (i.e. hostname, seq, ...).
- readiness-check: 2.0.0 => 2.2.2
- mongo: 4.0.8 => 4.4.1
- nfs-provisioner: 1.0.8 => 2.3.0
- filebeat: 5.5.0 => 7.9.3
- multicloud-k8s: 0.5.0 => 0.7.0
- fluentd: 1.10.2-debian-10-r11 => 1.11.4-debian-10-r7

Issue-ID: MULTICLOUD-1245
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: Ic0454086c390f6b24a77fcf2ea0e5d24507fa153

3 years agoIgnore 404 when deleting non-existent project in emco.sh 60/114460/1
Todd Malsbary [Tue, 20 Oct 2020 22:36:16 +0000 (15:36 -0700)]
Ignore 404 when deleting non-existent project in emco.sh

The delete is run at the start of the test, it is expected that the
resource does not exist.

Issue-ID: MULTICLOUD-1243
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I1b060ec8f17fd4b9b76ed03d8dc3bd7c21756690

3 years agoWait for service to be listening before running tests 59/114459/1
Todd Malsbary [Tue, 20 Oct 2020 21:40:37 +0000 (14:40 -0700)]
Wait for service to be listening before running tests

Issue-ID: MULTICLOUD-1242
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I5aa45daf92ebfbee32d154dc17f7d2afd72bf255

3 years agoProperly escape query string to jq 58/114458/1
Todd Malsbary [Tue, 20 Oct 2020 19:20:26 +0000 (12:20 -0700)]
Properly escape query string to jq

Without this change, the '.request.release-name' query causes jq to
get confused by the '-' and fail the test script:

    jq: error: name/0 is not defined at <top-level>, line 1:
    .request.release-name
    jq: 1 compile error

Issue-ID: MULTICLOUD-1241
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I386cd46db8e44c92bc24d8eb8a9e3964d9b87d39

3 years agoMove test inside if block to prevent premature exit 57/114457/1
Todd Malsbary [Tue, 20 Oct 2020 18:14:33 +0000 (11:14 -0700)]
Move test inside if block to prevent premature exit

grep returns a non-zero error code if the pattern is not found.  This
would cause the topology-manager.sh test to exit prematurely instead
of capturing and logging the error and returning zero as intended.

Issue-ID: MULTICLOUD-1240
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I29c4d30630c0f803325c2ed024d4c0b9e8a0e911

3 years agoFix typo in deployments/helm/v2/emco/Chart.yaml 56/114456/1
Todd Malsbary [Tue, 20 Oct 2020 16:50:34 +0000 (09:50 -0700)]
Fix typo in deployments/helm/v2/emco/Chart.yaml

Issue-ID: MULTICLOUD-1239
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: Ibf7c7d2a64889b72cdc67a587548fb6a0dac6ba0

3 years agoMerge "Update EMCO OpenAPI spec with DCM APIs"
Eric Multanen [Fri, 16 Oct 2020 23:27:28 +0000 (23:27 +0000)]
Merge "Update EMCO OpenAPI spec with DCM APIs"

3 years agoMerge "Restore commented unit test TestDeleteLogicalCloud"
Eric Multanen [Fri, 16 Oct 2020 23:25:49 +0000 (23:25 +0000)]
Merge "Restore commented unit test TestDeleteLogicalCloud"

3 years agoMerge "delete should return 404 error for invalid name"
Eric Multanen [Fri, 16 Oct 2020 23:22:22 +0000 (23:22 +0000)]
Merge "delete should return 404 error for invalid name"

3 years agoRestore commented unit test TestDeleteLogicalCloud 49/113749/1
Igor D.C [Thu, 8 Oct 2020 18:44:14 +0000 (18:44 +0000)]
Restore commented unit test TestDeleteLogicalCloud

Restore the previously commented-out unit test TestDeleteLogicalCloud.
That test was disabled due to a failure introduced by interacting with
AppContext for the first time in module/logicalcloud.go and it not
being ready to do so.

This commit restores it and modifies code so dependent mocks can plug
in correctly. This was done in order to keep testing the code that was
previously being tested, not so much to add additional coverage.

Although it would be a significant undertaking, the different types and
interfaces in pkg/module should be redesigned to achieve better
decoupling and thus make unit testing more straightforward.

Issue-ID: MULTICLOUD-1143
Change-Id: I1e6b7bb9111fc6883f0c9cee887329a9e0b27fbd
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoUpdate EMCO OpenAPI spec with DCM APIs 61/111061/11
Igor D.C [Fri, 7 Aug 2020 23:29:02 +0000 (23:29 +0000)]
Update EMCO OpenAPI spec with DCM APIs

Update emco_apis.yaml with all new API paths provided by DCM and
its /logical-clouds URL prefix. Update schemas and parameters too.

Issue-ID: MULTICLOUD-1143
Change-Id: I9d94cb2954c2f0131ffb8c3061a87a6b6a235cba
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoFix mispelled key name in kubeconfig 07/113707/1
Igor D.C [Thu, 8 Oct 2020 23:50:55 +0000 (23:50 +0000)]
Fix mispelled key name in kubeconfig

Fixes the mispelled "currentcontext" with the right key name
"current-context" which was introduced as a regression with or
before the latest version of the kubeconfig code (probably a bad
search/replace).

This 1-character long bug was preventing the generated kubeconfigs
from being correctly interpreted by kubectl. Thus, kubectl couldn't
set any context of the kubeconfig as the current context.

Observable output before this fix:
$ kubectl get pods
The connection to the server localhost:8080 was refused - did you
specify the right host or port?

Issue-ID: MULTICLOUD-1143
Change-Id: I617d1e20b7be2567729b84d3746b22e4ceaf8b9d
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoUpdating the API definition 36/113136/5
Ritu Sood [Thu, 24 Sep 2020 20:35:02 +0000 (13:35 -0700)]
Updating the API definition

API definition updated to add
generic placemnent intent under
deployment group

Issue-ID: MULTICLOUD-1096
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Change-Id: Ida830de0f17038925651bc604440b11547b7320d

3 years agoMerge "Add k8splugin releases file for 0.7.0"
Ritu Sood [Thu, 8 Oct 2020 21:29:54 +0000 (21:29 +0000)]
Merge "Add k8splugin releases file for 0.7.0"

3 years agoAdd k8splugin releases file for 0.7.0 06/113706/1
Eric Multanen [Fri, 9 Oct 2020 04:37:14 +0000 (21:37 -0700)]
Add k8splugin releases file for 0.7.0

Add k8splugin file for 0.7.0

Issue-ID: MULTICLOUD-1213
Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
Change-Id: I54d7610f39be4d05e176ff7e2f67bd7594e50677

3 years agoMerge "Reduce duplication around DeleteCompositeApp calls"
Ritu Sood [Thu, 8 Oct 2020 21:12:12 +0000 (21:12 +0000)]
Merge "Reduce duplication around DeleteCompositeApp calls"

3 years agoUpdate k8splugin for G release 88/113688/1 0.7.0
Eric Multanen [Thu, 8 Oct 2020 20:50:55 +0000 (13:50 -0700)]
Update k8splugin for G release

Update image version of k8splugin to 0.7.0-SNAPSHOT
This will be then be used to create the release image

Issue-ID: MULTICLOUD-1213
Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
Change-Id: Ice57a61bc98397a2bbb5c313452459b02ec86139

3 years agoReduce duplication around DeleteCompositeApp calls 61/113661/1
Igor D.C [Thu, 8 Oct 2020 02:54:54 +0000 (02:54 +0000)]
Reduce duplication around DeleteCompositeApp calls

DCM's apply function had a lot of error handling code that cleans up
the AppContext if something goes wrong while adding to AppContext.

Most of that handling was using multiline duplicate code with the only
change being in the log/error strings. This commit attempts to reuse
all that error handling code and make it easier to follow main code.

Issue-ID: MULTICLOUD-1143
Change-Id: I3a35387b1ed46279c1b973dbd852352276ff5cc8
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoMerge "Apply corrections to EMCO v2 helm README"
Ritu Sood [Tue, 6 Oct 2020 21:06:21 +0000 (21:06 +0000)]
Merge "Apply corrections to EMCO v2 helm README"

3 years agoApply corrections to EMCO v2 helm README 90/113590/1
Igor D.C [Tue, 6 Oct 2020 20:45:19 +0000 (20:45 +0000)]
Apply corrections to EMCO v2 helm README

Mostly just make the identifiers consistent with each other
so copy-paste works without surprises. No more rel- prefix, just emco-.

Additionally suggest a 2nd workaround to the persistentvolumes issue.

Issue-ID: MULTICLOUD-1143
Change-Id: I7ad1d3a4b20f7563226a9d487c388275e56429b5
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoAdd DCM to Helm deployment folder 95/113395/4
Igor D.C [Wed, 30 Sep 2020 17:34:28 +0000 (17:34 +0000)]
Add DCM to Helm deployment folder

Also add DCM to cleanup-emco.sh.

Issue-ID: MULTICLOUD-1143
Change-Id: I2496c1fef2e2588c1c8e750105568afc210d54c3
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoMerge "Remove unused mongo db methods from emco code"
Ritu Sood [Mon, 5 Oct 2020 22:47:13 +0000 (22:47 +0000)]
Merge "Remove unused mongo db methods from emco code"

3 years agoMerge "Ovnaction and vfw updates for deploy api change"
Ritu Sood [Mon, 5 Oct 2020 22:45:38 +0000 (22:45 +0000)]
Merge "Ovnaction and vfw updates for deploy api change"

3 years agoMerge "Modify GenericPlacement APIs to include DepIntGrp"
Ritu Sood [Mon, 5 Oct 2020 22:45:20 +0000 (22:45 +0000)]
Merge "Modify GenericPlacement APIs to include DepIntGrp"

3 years agoBuild and deploy sriov module only on supported hosts. 49/113549/1
Todd Malsbary [Thu, 1 Oct 2020 21:17:59 +0000 (14:17 -0700)]
Build and deploy sriov module only on supported hosts.

Building on the target host fixes a couple issues:
- In the containerized installer, the container image does not include
  the necessary kernel headers to build the module.
- The build and target host must have the same kernel version.  There
  is no guarantee of this.

The deploy uses NFD, similar to the QAT playbook.

Issue-ID: MULTICLOUD-1228
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I58705b73b8ce6d381b4649d5a20b8644e51e1b13

3 years agoOvnaction and vfw updates for deploy api change 40/113440/4
Eric Multanen [Thu, 1 Oct 2020 05:38:59 +0000 (22:38 -0700)]
Ovnaction and vfw updates for deploy api change

Update the ovnaction controller APIs to support
the api change of including the deployment intent
group in the URL.  Also fixup:
- vfw and other test cases to support the change
- updates to emcoctl tool and examples

Issue-ID: MULTICLOUD-1218
Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
Change-Id: Icadacb5ec6d7c238bb3bf8a44a39c30692ecebee

3 years agoModify GenericPlacement APIs to include DepIntGrp 45/113145/6
Rajamohan Raj [Fri, 25 Sep 2020 03:16:40 +0000 (03:16 +0000)]
Modify GenericPlacement APIs to include DepIntGrp

Modify the genericPlacementIntent API such that deploymentIntentGroup
becomes a mandatory parameter.

Issue-ID: MULTICLOUD-1218
Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com>
Change-Id: I33d2eeac5b60228e9c08921c9347b1b6aa3f8d28

3 years agoDCM E2E testing fixes 50/113450/6
Igor D.C [Fri, 2 Oct 2020 01:40:09 +0000 (01:40 +0000)]
DCM E2E testing fixes

A set of small fixes after discovery during DCM's end-to-end testing:
- properly detect that a cert hasn't been issued yet (don't crash)
- in Monitor, don't pass namespace when querying for CSRs
- fixed incorrect /kubeconfig file encoding from yaml to json

Issue-ID: MULTICLOUD-1143
Change-Id: Ie813e377070b0751f0bfdabac8da50e3288090de
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoMerge "Set name of resources correctly in appcontext"
Ritu Sood [Fri, 2 Oct 2020 23:20:57 +0000 (23:20 +0000)]
Merge "Set name of resources correctly in appcontext"

3 years agoMerge "Reimplement Terminate to be compatible with Status"
Ritu Sood [Fri, 2 Oct 2020 23:20:30 +0000 (23:20 +0000)]
Merge "Reimplement Terminate to be compatible with Status"

3 years agoRemove unused mongo db methods from emco code 47/113447/2
Eric Multanen [Thu, 1 Oct 2020 23:29:08 +0000 (16:29 -0700)]
Remove unused mongo db methods from emco code

Remove the set of unused (legacy from v1) mongo
db methods so that they are not used in the emco
code base.

Issue-ID: MULTICLOUD-1227
Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
Change-Id: Ibe94892e5b1d0f33192be7ea3db5c55b3f8cbf60

3 years agoSet name of resources correctly in appcontext 49/113449/4
Igor D.C [Fri, 2 Oct 2020 00:20:09 +0000 (00:20 +0000)]
Set name of resources correctly in appcontext

Previously the DCM K8s resources in appcontext were in the format:
<logical cloud name>+<resource type>

Now they are in the correct format:
<resource name>+<ResourceType>

Issue-ID: MULTICLOUD-1143
Change-Id: I271c70587244921cc2ffb7ad571ad8eb162cb10f
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoReimplement Terminate to be compatible with Status 45/113445/4
Igor D.C [Thu, 1 Oct 2020 17:50:20 +0000 (17:50 +0000)]
Reimplement Terminate to be compatible with Status

This also includes modifying Apply and Delete, since there are
strict conditions that need to be met in each, to prevent
Logical Clouds (LCs) from entering a bad state.

Summary of what's being done here:
- When applying:
  - set tag 'lccontext' in the LC to the context ID (was already done)
  - and let rsync know about the appcontext (grpc) (was already done)
  - if tag was already set, check current context /status
  - if context /status is actually Terminated,  'lccontext' is set to
    new context ID and previous AppContext deleted
- When terminating:
  - lets rsync know about the termination request (grpc)
- When deleting:
  - checks whether the current context /status is Terminated
  - if it is, then it will remove the latest LC context

This particular commit disables the TestDeleteLogicalCloud test
until a known issue behind the test is resolved.

This commit does not leverage the full capacity of the Status
framework, but is sufficient to support all operations. A future
patch will entirely migrate DCM to the Status framework. Until
then, a known issue exists where DCM will forget about context IDs
previously associated to a particular Logical Cloud (only keeps last).

Issue-ID: MULTICLOUD-1143
Change-Id: I7a6034eba543c2a27daa41b7fe6298cb2a85f9ce
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoAdding CSR Approval functionality 44/113444/4
Ritu Sood [Thu, 1 Oct 2020 22:05:42 +0000 (15:05 -0700)]
Adding CSR Approval functionality

Update rsync to be able to approve CSR

Issue-ID: MULTICLOUD-1143
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Change-Id: I0b2bec3475a3453a2d8fc9c2e87cfc4531b0e2f3

3 years agoImprove DCM test script: apply, term, kubeconfig 48/113448/3
Igor D.C [Thu, 1 Oct 2020 23:44:46 +0000 (23:44 +0000)]
Improve DCM test script: apply, term, kubeconfig

Adds apply and terminate operations, while decoupling them in two
different script branches.

Add kubeconfig test into a third script branch.

Also, $cluster_2_name wasn't defined, so this fixes that.

Issue-ID: MULTICLOUD-1143
Change-Id: I574934078644ec83224bcac74b5b17783330aaaa
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoMerge "Fix rsync retry logic for unreachable cluster"
Ritu Sood [Fri, 2 Oct 2020 20:10:22 +0000 (20:10 +0000)]
Merge "Fix rsync retry logic for unreachable cluster"

3 years agoFix rsync retry logic for unreachable cluster 39/113439/1
Eric Multanen [Tue, 22 Sep 2020 18:10:32 +0000 (11:10 -0700)]
Fix rsync retry logic for unreachable cluster

Fix rsync to only retry reaching clusters until the
timeout occurs.

Issue-ID: MULTICLOUD-1226
Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
Change-Id: I5e8202358cfd8cdd15c9feb4fcbefe2683b7139a

3 years agoSubtle refactoring in a few functions 32/113432/2
Igor D.C [Wed, 30 Sep 2020 21:30:06 +0000 (21:30 +0000)]
Subtle refactoring in a few functions

In DCM.

Essentially refactored two different areas:
- rename apply/terminate functions in module to clarify what they do
- split gets from getAlls in API code of the 5 DCM resource types

And cleaned up here and there.

Issue-ID: MULTICLOUD-1143
Change-Id: I9b72c77ba34a1febd5df4a339e87968ddc4a7891
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoFix arg mismatch in GetLogicalCloudContext 08/113408/1
Igor D.C [Thu, 1 Oct 2020 00:18:45 +0000 (00:18 +0000)]
Fix arg mismatch in GetLogicalCloudContext

The previous commits were merged in the wrong order, which caused a bad
3-way merge resulting in the arg mismatch as witnessed below:

k8s/src/dcm/pkg/modulepkg/module/cluster.go:263:57: not enough arguments
in call to lcClient.GetLogicalCloudContext
        have (string)
        want (string, string)
Makefile:13: recipe for target 'all' failed
make: *** [all] Error 2

The CI merge job doesn't run tests before merging, so this slipped in.

Issue-ID: MULTICLOUD-1143
Change-Id: I0168345af6bac7886cba32d958f241687ab24a81
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoMerge "Implement Kubeconfig endpoint in DCM"
Ritu Sood [Wed, 30 Sep 2020 23:48:26 +0000 (23:48 +0000)]
Merge "Implement Kubeconfig endpoint in DCM"

3 years agoMerge "Update ResourceBundleState CRD and monitor-deploy"
Eric Multanen [Wed, 30 Sep 2020 23:28:04 +0000 (23:28 +0000)]
Merge "Update ResourceBundleState CRD and monitor-deploy"

3 years agoMerge "Fix Status API to actually provide instance status"
Eric Multanen [Wed, 30 Sep 2020 23:22:46 +0000 (23:22 +0000)]
Merge "Fix Status API to actually provide instance status"

3 years agoUpdate ResourceBundleState CRD and monitor-deploy 99/113399/2
Igor D.C [Wed, 30 Sep 2020 19:37:51 +0000 (19:37 +0000)]
Update ResourceBundleState CRD and monitor-deploy

Update ResourceBundleState CRD and monitor-deploy.yaml with
csrStatuses.

This was missing from the previous patch implementing CSR support
in Monitor. Depending on how the environment was brought up, attempting
to read the CSR would result in forbidden access.

Issue-ID: MULTICLOUD-1143
Change-Id: I86ffb8df8faa045e57fd553e5784d308e1900ee4
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoMerge "Add DCM to K8s deployment file"
Ritu Sood [Wed, 30 Sep 2020 17:45:29 +0000 (17:45 +0000)]
Merge "Add DCM to K8s deployment file"

3 years agodelete should return 404 error for invalid name 39/113139/3
Aditya Sharoff [Thu, 24 Sep 2020 22:45:15 +0000 (15:45 -0700)]
delete should return 404 error for invalid name

Issue-ID: MULTICLOUD-1150

Change-Id: I04c9584e35672b6b40047a67be4d2026002204e1
Signed-off-by: Aditya Sharoff <aditya.sharoff@intel.com>
3 years agoAdd DCM to K8s deployment file 93/113393/2
Igor D.C [Wed, 30 Sep 2020 17:09:28 +0000 (17:09 +0000)]
Add DCM to K8s deployment file

Issue-ID: MULTICLOUD-1143
Change-Id: Iaca9bd6cb3614e0ae825d9231476524ce09db550
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoFix Status API to actually provide instance status 71/113171/4
Konrad Bańka [Fri, 25 Sep 2020 14:35:02 +0000 (16:35 +0200)]
Fix Status API to actually provide instance status

Provide information about instance resources and Pods inside status
response.

Issue-ID: MULTICLOUD-1177
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: Iee6fd56120d091dddfa6b6d0e4aa7eb36d40e888

3 years agoUse project name provided by API in DCM 43/113343/2
Igor D.C [Tue, 29 Sep 2020 19:00:37 +0000 (19:00 +0000)]
Use project name provided by API in DCM

DCM apply/terminate code was still using a hardcoded "test-project"
string for the project name that logical clouds should associate to.

This simple patch makes DCM use the project name provided by the API.

It also checks that the project exists before creating a Logical Cloud.

Issue-ID: MULTICLOUD-1143
Change-Id: I05c8a2309ed07a7c96da30bf2461c43abaccc9d5
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoImplement Kubeconfig endpoint in DCM 04/113204/6
Igor D.C [Fri, 25 Sep 2020 05:28:09 +0000 (05:28 +0000)]
Implement Kubeconfig endpoint in DCM

The /kubeconfig API path allows a client to retrieve a kubeconfig
file for a specified cluster reference of a logical cloud.
- includes CA cert, address, user private key and signed cert.

This commit includes the "lazy-loading" implementation of certificate
retrieval per cluster from Rsync (which happens when clients call).

The certificate is read from the cluster status in appcontext.
Thus, Monitor and Rsync need to be configured and running.

Issue-ID: MULTICLOUD-1143
Change-Id: Ie94cd128e14c8a944861eced2bdc886d95fab6ed
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoMerge "Add plugin_fw.sh test for v2 and run as part of installer."
Ritu Sood [Tue, 29 Sep 2020 19:58:19 +0000 (19:58 +0000)]
Merge "Add plugin_fw.sh test for v2 and run as part of installer."

3 years agoMerge "Add a couple of sanity checks in DCM"
Ritu Sood [Mon, 28 Sep 2020 23:51:43 +0000 (23:51 +0000)]
Merge "Add a couple of sanity checks in DCM"

3 years agoRequest CSR approvals via /subresource level 07/113207/2
Igor D.C [Sat, 26 Sep 2020 02:54:02 +0000 (02:54 +0000)]
Request CSR approvals via /subresource level

Make use of the new /subresource level (under a resource) to
request rsync to process approvals (a K8s subresource) for CSRs.

Generic usage of instructions (order, dependency) for consistency.

This also introduces a 'subresources' package in 'appcontext' with
the first member being the approval subresource. Since subresources
aren't necessarily created with yaml, this package will allow
developers to specify what should be the "interface" in appcontext
for each type of subresource when the different services need to
exchange this data (e.g. DCM and rsync).

Issue-ID: MULTICLOUD-1143
Change-Id: I8c85b4ee8c5654036a1c7ebb39d111ba4518b468
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoMerge "Implement rest of Apply operation in DCM"
Ritu Sood [Mon, 28 Sep 2020 23:27:04 +0000 (23:27 +0000)]
Merge "Implement rest of Apply operation in DCM"

3 years agoMerge "Implement Terminate operation in DCM"
Ritu Sood [Mon, 28 Sep 2020 23:26:25 +0000 (23:26 +0000)]
Merge "Implement Terminate operation in DCM"

3 years agoFix special characters issue in quotas in DCM 42/113142/8
Igor D.C [Fri, 25 Sep 2020 00:15:58 +0000 (00:15 +0000)]
Fix special characters issue in quotas in DCM

Before this patch, any resource quotas, say, with a dot (like
limits.cpu), would not be stored properly in the database and thus
unusable and ignored by DCM logical cloud apply operation.

Issue-ID: MULTICLOUD-1143
Change-Id: I178e66756bc9bb2798427233d15196d0e2559a99
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
3 years agoImplement rest of Apply operation in DCM 06/113206/1
Igor D.C [Sat, 26 Sep 2020 02:19:38 +0000 (02:19 +0000)]
Implement rest of Apply operation in DCM

"Rest of" meaning the Apply operation now effectively
instantiates logical cloud resources on K8s cluster.

More specifically, this commit now enables:
- DCM calling rsync over gRPC on apply
- The following K8s resources are now being created per cluster:
  - namespace, csr, resourcequotas, roles, rolebindings
- Tested-working for multiple clusters simultaneously
- Generating and storing logical cloud user private key in MongoDB

This commit doesn't include any logic to request
or retrieve CSR approvals and signed user certificates.

Issue-ID: MULTICLOUD-1143
Change-Id: I92c4270678d05a5cb531791cef199a7dd79403d3
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>