Refactor EMCO deploy of addons 71/121671/3
authorTodd Malsbary <todd.malsbary@intel.com>
Wed, 2 Jun 2021 23:31:22 +0000 (16:31 -0700)
committerTodd Malsbary <todd.malsbary@intel.com>
Wed, 9 Jun 2021 17:03:51 +0000 (10:03 -0700)
Issue-ID: MULTICLOUD-1324
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I90b33cd99c42017b50f3174b6f9033a861e11dd3

14 files changed:
kud/deployment_infra/emco/composite-app.yaml [deleted file]
kud/deployment_infra/emco/examples/00-controllers.yaml [new file with mode: 0644]
kud/deployment_infra/emco/examples/01-cluster.yaml [new file with mode: 0644]
kud/deployment_infra/emco/examples/02-project.yaml [new file with mode: 0644]
kud/deployment_infra/emco/examples/03-addons-app.yaml [new file with mode: 0644]
kud/deployment_infra/emco/examples/04-addon-resources-app.yaml [new file with mode: 0644]
kud/deployment_infra/emco/examples/README.md
kud/deployment_infra/emco/examples/prerequisites.yaml [deleted file]
kud/deployment_infra/emco/examples/values-resources.yaml.example [deleted file]
kud/deployment_infra/emco/examples/values.yaml.example
kud/hosting_providers/containerized/addons/README.md.tmpl
kud/hosting_providers/containerized/addons/values-resources.yaml.tmpl [deleted file]
kud/hosting_providers/containerized/addons/values.yaml.tmpl
kud/hosting_providers/containerized/installer.sh

diff --git a/kud/deployment_infra/emco/composite-app.yaml b/kud/deployment_infra/emco/composite-app.yaml
deleted file mode 100644 (file)
index 869447a..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-# SPDX-License-Identifier: Apache-2.0
-# Copyright (c) 2020 Intel Corporation
-
----
-#creating composite app entry
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ .ProjectName }}/composite-apps
-metadata :
-  name: {{ .CompositeApp }}
-  description: "KUD addons"
-spec:
-  version: v1
-
-{{- range $index, $addon := .Apps }}
----
-#adding app to the composite app
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $.CompositeApp }}/v1/apps
-metadata :
-  name: {{ $addon }}
-file:
-  {{ $.PackagesPath }}/{{ $addon }}.tar.gz
-{{- end }}
-
----
-#creating composite profile entry
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .CompositeApp }}/v1/composite-profiles
-metadata :
-  name: {{ .CompositeProfile }}
-
-{{- range $index, $addon := .Apps }}
----
-#adding app profiles to the composite profile
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $.CompositeApp }}/v1/composite-profiles/{{ $.CompositeProfile }}/profiles
-metadata :
-  name: {{ $addon }}-profile
-spec:
-  app-name: {{ $addon }}
-file:
-  {{ $.PackagesPath }}/{{ $addon }}_profile.tar.gz
-{{- end }}
-
----
-#create deployment intent group
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .CompositeApp }}/v1/deployment-intent-groups
-metadata :
-  name: {{ .DeploymentIntentGroup }}
-  description: "description"
-spec:
-  profile: {{ .CompositeProfile }}
-  version: r1
-  logical-cloud: {{ .LogicalCloud }}
-  override-values: []
-
----
-#create intent in deployment intent group
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .CompositeApp }}/v1/deployment-intent-groups/{{ .DeploymentIntentGroup }}/intents
-metadata :
-  name: {{ .DeploymentIntent }}
-spec:
-  intent:
-    genericPlacementIntent: {{ .GenericPlacementIntent }}
-
----
-#create the generic placement intent
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .CompositeApp }}/v1/deployment-intent-groups/{{ .DeploymentIntentGroup }}/generic-placement-intents
-metadata :
-  name: {{ .GenericPlacementIntent }}
-spec:
-  logical-cloud: {{ .LogicalCloud }}
-
-{{- range $index, $addon := .Apps }}
----
-#add the app placement intent to the generic placement intent
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $.CompositeApp }}/v1/deployment-intent-groups/{{ $.DeploymentIntentGroup }}/generic-placement-intents/{{ $.GenericPlacementIntent }}/app-intents
-metadata:
-  name: {{ $addon }}-placement-intent
-spec:
-  app-name: {{ $addon }}
-  intent:
-    allOf:
-    - provider-name: {{ $.ClusterProvider }}
-      cluster-label-name: {{ $.ClusterLabel }}
-{{- end }}
-
----
-#Approve
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .CompositeApp }}/v1/deployment-intent-groups/{{ .DeploymentIntentGroup }}/approve
-
----
-#Instantiate
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .CompositeApp }}/v1/deployment-intent-groups/{{ .DeploymentIntentGroup }}/instantiate
diff --git a/kud/deployment_infra/emco/examples/00-controllers.yaml b/kud/deployment_infra/emco/examples/00-controllers.yaml
new file mode 100644 (file)
index 0000000..c023ab8
--- /dev/null
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: Apache-2.0
+# Copyright (c) 2020 Intel Corporation
+
+---
+#creating controller entries
+version: emco/v2
+resourceContext:
+  anchor: controllers
+metadata :
+   name: rsync
+spec:
+  host:  {{ .HostIP }}
+  port: {{ .RsyncPort }}
+
+---
+#creating controller entries
+version: emco/v2
+resourceContext:
+  anchor: controllers
+metadata :
+   name: gac
+spec:
+  host:  {{ .HostIP }}
+  port: {{ .GacPort }}
+  type: "action"
+  priority: 1
+
+---
+#creating controller entries
+version: emco/v2
+resourceContext:
+  anchor: controllers
+metadata :
+  name: ovnaction
+spec:
+  host: {{ .HostIP }}
+  port: {{ .OvnPort }}
+  type: "action"
+  priority: 1
+
+---
+#creating controller entries
+version: emco/v2
+resourceContext:
+  anchor: controllers
+metadata :
+  name: dtc
+spec:
+  host: {{ .HostIP }}
+  port: {{ .DtcPort }}
+  type: "action"
+  priority: 1
diff --git a/kud/deployment_infra/emco/examples/01-cluster.yaml b/kud/deployment_infra/emco/examples/01-cluster.yaml
new file mode 100644 (file)
index 0000000..6f7ce4b
--- /dev/null
@@ -0,0 +1,29 @@
+# SPDX-License-Identifier: Apache-2.0
+# Copyright (c) 2020 Intel Corporation
+
+---
+#creating cluster provider
+version: emco/v2
+resourceContext:
+  anchor: cluster-providers
+metadata :
+   name: {{ .ClusterProvider }}
+
+{{- range $index, $cluster := .Clusters }}
+---
+#creating cluster
+version: emco/v2
+resourceContext:
+  anchor: cluster-providers/{{ $.ClusterProvider }}/clusters
+metadata :
+   name: {{ $cluster.Name }}
+file:
+  {{ $cluster.KubeConfig }}
+
+---
+#Add label cluster
+version: emco/v2
+resourceContext:
+  anchor: cluster-providers/{{ $.ClusterProvider }}/clusters/{{ $cluster.Name }}/labels
+label-name: {{ $.ClustersLabel }}
+{{- end }}
\ No newline at end of file
diff --git a/kud/deployment_infra/emco/examples/02-project.yaml b/kud/deployment_infra/emco/examples/02-project.yaml
new file mode 100644 (file)
index 0000000..98ecfdb
--- /dev/null
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: Apache-2.0
+# Copyright (c) 2020 Intel Corporation
+
+---
+#create project
+version: emco/v2
+resourceContext:
+  anchor: projects
+metadata :
+   name: {{ .ProjectName }}
+
+---
+#create default logical cloud with admin permissions
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/logical-clouds
+metadata:
+  name: {{ .LogicalCloud }}
+spec:
+  level: "0"
+
+{{- range $index, $cluster := .Clusters }}
+---
+#add cluster reference to logical cloud
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ $.ProjectName }}/logical-clouds/{{ $.LogicalCloud }}/cluster-references
+metadata:
+  name: {{ $cluster.Name }}
+spec:
+  cluster-provider: {{ $.ClusterProvider }}
+  cluster-name: {{ $cluster.Name }}
+  loadbalancer-ip: "0.0.0.0"
+{{- end }}
+
+---
+#instantiate logical cloud
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/logical-clouds/{{ .LogicalCloud }}/instantiate
diff --git a/kud/deployment_infra/emco/examples/03-addons-app.yaml b/kud/deployment_infra/emco/examples/03-addons-app.yaml
new file mode 100644 (file)
index 0000000..0fd15e0
--- /dev/null
@@ -0,0 +1,110 @@
+# SPDX-License-Identifier: Apache-2.0
+# Copyright (c) 2020 Intel Corporation
+
+---
+#creating composite app entry
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps
+metadata :
+  name: {{ .AddonsApp }}
+  description: "KUD addons"
+spec:
+  version: v1
+
+{{- range $index, $addon := .Addons }}
+---
+#adding app to the composite app
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $.AddonsApp }}/v1/apps
+metadata :
+  name: {{ $addon }}
+file:
+  {{ $.PackagesPath }}/{{ $addon }}.tar.gz
+{{- end }}
+
+---
+#creating composite profile entry
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonsApp }}/v1/composite-profiles
+metadata :
+  name: {{ .AddonsProfile }}
+
+{{- range $index, $addon := .Addons }}
+---
+#adding app profiles to the composite profile
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $.AddonsApp }}/v1/composite-profiles/{{ $.AddonsProfile }}/profiles
+metadata :
+  name: {{ $addon }}-profile
+spec:
+  app-name: {{ $addon }}
+file:
+  {{ $.PackagesPath }}/{{ $addon }}_profile.tar.gz
+{{- end }}
+
+---
+#create deployment intent group
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonsApp }}/v1/deployment-intent-groups
+metadata :
+  name: {{ .AddonsDeploymentIntentGroup }}
+  description: "description"
+spec:
+  profile: {{ .AddonsProfile }}
+  version: r1
+  logical-cloud: {{ .LogicalCloud }}
+  override-values: []
+
+---
+#create intent in deployment intent group
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonsApp }}/v1/deployment-intent-groups/{{ .AddonsDeploymentIntentGroup }}/intents
+metadata :
+  name: {{ .AddonsDeploymentIntent }}
+spec:
+  intent:
+    genericPlacementIntent: {{ .AddonsPlacementIntent }}
+
+---
+#create the generic placement intent
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonsApp }}/v1/deployment-intent-groups/{{ .AddonsDeploymentIntentGroup }}/generic-placement-intents
+metadata :
+  name: {{ .AddonsPlacementIntent }}
+spec:
+  logical-cloud: {{ .LogicalCloud }}
+
+{{- range $index, $addon := .Addons }}
+---
+#add the app placement intent to the generic placement intent
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $.AddonsApp }}/v1/deployment-intent-groups/{{ $.AddonsDeploymentIntentGroup }}/generic-placement-intents/{{ $.AddonsPlacementIntent }}/app-intents
+metadata:
+  name: {{ $addon }}-placement-intent
+spec:
+  app-name: {{ $addon }}
+  intent:
+    allOf:
+    - provider-name: {{ $.ClusterProvider }}
+      cluster-label-name: {{ $.ClustersLabel }}
+{{- end }}
+
+---
+#Approve
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonsApp }}/v1/deployment-intent-groups/{{ .AddonsDeploymentIntentGroup }}/approve
+
+---
+#Instantiate
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonsApp }}/v1/deployment-intent-groups/{{ .AddonsDeploymentIntentGroup }}/instantiate
diff --git a/kud/deployment_infra/emco/examples/04-addon-resources-app.yaml b/kud/deployment_infra/emco/examples/04-addon-resources-app.yaml
new file mode 100644 (file)
index 0000000..92fd953
--- /dev/null
@@ -0,0 +1,110 @@
+# SPDX-License-Identifier: Apache-2.0
+# Copyright (c) 2020 Intel Corporation
+
+---
+#creating composite app entry
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps
+metadata :
+  name: {{ .AddonResourcesApp }}
+  description: "KUD addons"
+spec:
+  version: v1
+
+{{- range $index, $addon := .AddonResources }}
+---
+#adding app to the composite app
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $.AddonResourcesApp }}/v1/apps
+metadata :
+  name: {{ $addon }}
+file:
+  {{ $.PackagesPath }}/{{ $addon }}.tar.gz
+{{- end }}
+
+---
+#creating composite profile entry
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonResourcesApp }}/v1/composite-profiles
+metadata :
+  name: {{ .AddonResourcesProfile }}
+
+{{- range $index, $addon := .AddonResources }}
+---
+#adding app profiles to the composite profile
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $.AddonResourcesApp }}/v1/composite-profiles/{{ $.AddonResourcesProfile }}/profiles
+metadata :
+  name: {{ $addon }}-profile
+spec:
+  app-name: {{ $addon }}
+file:
+  {{ $.PackagesPath }}/{{ $addon }}_profile.tar.gz
+{{- end }}
+
+---
+#create deployment intent group
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonResourcesApp }}/v1/deployment-intent-groups
+metadata :
+  name: {{ .AddonResourcesDeploymentIntentGroup }}
+  description: "description"
+spec:
+  profile: {{ .AddonResourcesProfile }}
+  version: r1
+  logical-cloud: {{ .LogicalCloud }}
+  override-values: []
+
+---
+#create intent in deployment intent group
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonResourcesApp }}/v1/deployment-intent-groups/{{ .AddonResourcesDeploymentIntentGroup }}/intents
+metadata :
+  name: {{ .AddonResourcesDeploymentIntent }}
+spec:
+  intent:
+    genericPlacementIntent: {{ .AddonResourcesPlacementIntent }}
+
+---
+#create the generic placement intent
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonResourcesApp }}/v1/deployment-intent-groups/{{ .AddonResourcesDeploymentIntentGroup }}/generic-placement-intents
+metadata :
+  name: {{ .AddonResourcesPlacementIntent }}
+spec:
+  logical-cloud: {{ .LogicalCloud }}
+
+{{- range $index, $addon := .AddonResources }}
+---
+#add the app placement intent to the generic placement intent
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $.AddonResourcesApp }}/v1/deployment-intent-groups/{{ $.AddonResourcesDeploymentIntentGroup }}/generic-placement-intents/{{ $.AddonResourcesPlacementIntent }}/app-intents
+metadata:
+  name: {{ $addon }}-placement-intent
+spec:
+  app-name: {{ $addon }}
+  intent:
+    allOf:
+    - provider-name: {{ $.ClusterProvider }}
+      cluster-label-name: {{ $.ClustersLabel }}
+{{- end }}
+
+---
+#Approve
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonResourcesApp }}/v1/deployment-intent-groups/{{ .AddonResourcesDeploymentIntentGroup }}/approve
+
+---
+#Instantiate
+version: emco/v2
+resourceContext:
+  anchor: projects/{{ .ProjectName }}/composite-apps/{{ .AddonResourcesApp }}/v1/deployment-intent-groups/{{ .AddonResourcesDeploymentIntentGroup }}/instantiate
index b91cce1..203b83f 100644 (file)
@@ -27,33 +27,36 @@ needs to be installed and configured for the edge cluster.
 2. Customize values.yaml.
 
     `$ envsubst < values.yaml.example > values.yaml`
-    `$ envsubst < values-resources.yaml.example > values-resources.yaml`
 
 ## Create prerequisites to deploy addons
 
-Apply prerequisites.yaml. This creates controllers, one project, one
-cluster, and default logical cloud. This step is required to be done
-only once.
+Apply the prerequisites. This creates the controllers, one or more
+clusters, one project, and one default logical cloud. This step is
+required to be done only once.
 
-    `$ emcoctl apply -f prerequisites.yaml -v values.yaml`
+    `$ emcoctl apply -f 00-controllers.yaml -v values.yaml`
+    `$ emcoctl apply -f 01-cluster.yaml -v values.yaml`
+    `$ emcoctl apply -f 02-project.yaml -v values.yaml`
 
 ## Deploying addons
 
-Apply composite-app.yaml. This deploys the addons listed in the `Apps`
-value.
+This deploys the applications listed in the `Addons` and
+`AddonResources` values.
 
-    `$ emcoctl apply -f ../output/composite-app.yaml -v values.yaml`
-    `$ emcoctl apply -f ../output/composite-app.yaml -v values-resources.yaml`
+    `$ emcoctl apply -f 03-addons-app.yaml -v values.yaml`
+    `$ emcoctl apply -f 04-addon-resources-app.yaml -v values.yaml`
 
 ## Cleanup
 
 1. Delete addons.
 
-    `$ emcoctl delete -f ../output/composite-app.yaml -v values-resources.yaml`
-    `$ emcoctl delete -f ../output/composite-app.yaml -v values.yaml`
+    `$ emcoctl delete -f 04-addon-resources-app.yaml -v values.yaml`
+    `$ emcoctl delete -f 03-addons-app.yaml -v values.yaml`
 
 2. Cleanup prerequisites.
 
-    `$ emcoctl delete -f prerequisites.yaml -v values.yaml`
+    `$ emcoctl delete -f 02-project.yaml -v values.yaml`
+    `$ emcoctl delete -f 01-cluster.yaml -v values.yaml`
+    `$ emcoctl delete -f 00-controllers.yaml -v values.yaml`
 
 #### NOTE: Known issue: Deletion of the resources fails sometimes as some resources can't be deleted before others are deleted. This can happen due to timing issue. In that case try deleting again and the deletion should succeed.
diff --git a/kud/deployment_infra/emco/examples/prerequisites.yaml b/kud/deployment_infra/emco/examples/prerequisites.yaml
deleted file mode 100644 (file)
index a44546e..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-# SPDX-License-Identifier: Apache-2.0
-# Copyright (c) 2020 Intel Corporation
-
----
-#create project
-version: emco/v2
-resourceContext:
-  anchor: projects
-metadata :
-   name: {{ .ProjectName }}
----
-#creating controller entries
-version: emco/v2
-resourceContext:
-  anchor: controllers
-metadata :
-   name: rsync
-spec:
-  host:  {{ .HostIP }}
-  port: {{ .RsyncPort }}
-
----
-#creating controller entries
-version: emco/v2
-resourceContext:
-  anchor: controllers
-metadata :
-   name: gac
-spec:
-  host:  {{ .HostIP }}
-  port: {{ .GacPort }}
-  type: "action"
-  priority: 1
-
----
-#creating controller entries
-version: emco/v2
-resourceContext:
-  anchor: controllers
-metadata :
-  name: ovnaction
-spec:
-  host: {{ .HostIP }}
-  port: {{ .OvnPort }}
-  type: "action"
-  priority: 1
-
----
-#creating controller entries
-version: emco/v2
-resourceContext:
-  anchor: controllers
-metadata :
-  name: dtc
-spec:
-  host: {{ .HostIP }}
-  port: {{ .DtcPort }}
-  type: "action"
-  priority: 1
-
----
-#creating cluster provider
-version: emco/v2
-resourceContext:
-  anchor: cluster-providers
-metadata :
-   name: {{ .ClusterProvider }}
-
----
-#creating cluster
-version: emco/v2
-resourceContext:
-  anchor: cluster-providers/{{ .ClusterProvider }}/clusters
-metadata :
-   name: {{ .Cluster1 }}
-file:
-  {{ .KubeConfig }}
-
----
-#Add label cluster
-version: emco/v2
-resourceContext:
-  anchor: cluster-providers/{{ .ClusterProvider }}/clusters/{{ .Cluster1 }}/labels
-label-name: {{ .ClusterLabel }}
-
----
-#create default logical cloud with admin permissions
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ .ProjectName }}/logical-clouds
-metadata:
-  name: {{ .LogicalCloud }}
-spec:
-  level: "0"
-
----
-#add cluster reference to logical cloud
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ .ProjectName }}/logical-clouds/{{ .LogicalCloud }}/cluster-references
-metadata:
-  name: lc-cl-1
-spec:
-  cluster-provider: {{ .ClusterProvider }}
-  cluster-name: {{ .Cluster1 }}
-  loadbalancer-ip: "0.0.0.0"
-
----
-#instantiate logical cloud
-version: emco/v2
-resourceContext:
-  anchor: projects/{{ .ProjectName }}/logical-clouds/{{ .LogicalCloud }}/instantiate
-
diff --git a/kud/deployment_infra/emco/examples/values-resources.yaml.example b/kud/deployment_infra/emco/examples/values-resources.yaml.example
deleted file mode 100644 (file)
index acfd903..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-HostIP: $HOST_IP
-KubeConfig: $KUBE_PATH
-PackagesPath: $PWD/../output/packages
-ProjectName: proj1
-RsyncPort: 30441
-GacPort: 30493
-OvnPort: 30473
-DtcPort: 30483
-ClusterProvider: provider1
-Cluster1: cluster1
-ClusterLabel: edge-cluster
-LogicalCloud: default
-CompositeApp: addon-resources
-CompositeProfile: addon-resources-profile
-DeploymentIntentGroup: addon-resources-deployment-intent-group
-DeploymentIntent: addon-resources-deployment-intent
-GenericPlacementIntent: addon-resources-placement-intent
-Apps:
-- sriov-network
index 37ddacf..4f5e45e 100644 (file)
@@ -1,24 +1,36 @@
 HostIP: $HOST_IP
-KubeConfig: $KUBE_PATH
-PackagesPath: $PWD/../output/packages
-ProjectName: proj1
 RsyncPort: 30441
 GacPort: 30493
 OvnPort: 30473
 DtcPort: 30483
-ClusterProvider: provider1
-Cluster1: cluster1
-ClusterLabel: edge-cluster
+
+ClusterProvider: kud
+ClustersLabel: kud-cluster
+Clusters:
+- KubeConfig: $KUBE_PATH
+  Name: cluster
+
+ProjectName: kud
 LogicalCloud: default
-CompositeApp: addons
-CompositeProfile: addons-profile
-DeploymentIntentGroup: addons-deployment-intent-group
-DeploymentIntent: addons-deployment-intent
-GenericPlacementIntent: addons-placement-intent
-Apps:
+
+PackagesPath: $PWD/../output/packages
+AddonsApp: addons
+AddonsProfile: addons-profile
+AddonsDeploymentIntentGroup: addons-deployment-intent-group
+AddonsDeploymentIntent: addons-deployment-intent
+AddonsPlacementIntent: addons-placement-intent
+Addons:
 - multus-cni
 - ovn4nfv
 - node-feature-discovery
 - sriov-network-operator
 - qat-device-plugin
 - cpu-manager
+
+AddonResourcesApp: addon-resources
+AddonResourcesProfile: addon-resources-profile
+AddonResourcesDeploymentIntentGroup: addon-resources-deployment-intent-group
+AddonResourcesDeploymentIntent: addon-resources-deployment-intent
+AddonResourcesPlacementIntent: addon-resources-placement-intent
+AddonResources:
+- sriov-network
index 8ab1610..0cef792 100644 (file)
@@ -1,43 +1,47 @@
 # Installing KUD addons with emcoctl
 
-1. Customize values.yaml and values-resources.yaml as needed
+1. Customize values.yaml as needed
 
 To create a customized profile for a specific addon, edit the profile
 as needed, and then (for example, cpu-manager):
 
 ```
     tar -czf /opt/kud/multi-cluster/addons/cpu-manager.tar.gz -C /opt/kud/multi-cluster/addons/cpu-manager/helm .
-    tar -czf /opt/kud/multi-cluster/addons/collectd_profile.tar.gz -C /opt/kud/multi-cluster/addons/cpu-manager/profile .
+    tar -czf /opt/kud/multi-cluster/addons/cpu-manager_profile.tar.gz -C /opt/kud/multi-cluster/addons/cpu-manager/profile .
 ```
 
 2. Create prerequisites to deploy addons
 
-Apply prerequisites.yaml.  This step is optional.  If there are
-existing resources in the cluster, it is sufficient to customize
-values.yaml with the values of those resources.  The supplied
-prequisites.yaml creates controllers, one project, one cluster, and
-one logical cloud.
+Apply prerequisites.  This step is optional.  If there are existing
+resources in the cluster, it is sufficient to customize values.yaml
+with the values of those resources.  The supplied YAML files creates
+the controllers, one or more clusters, one project, and one logical
+cloud.
 
-    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh apply -f prerequisites.yaml -v values.yaml\`
+    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh apply -f 00-controllers.yaml -v values.yaml\`
+    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh apply -f 01-cluster.yaml -v values.yaml\`
+    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh apply -f 02-project.yaml -v values.yaml\`
 
 3. Deploy addons
 
-Apply addons.yaml. This deploys the addons listed in the \`Addons\`
-value in values.yaml.
+This deploys the addons listed in the \`Addons\` and
+\`AddonResources\` values in values.yaml.
 
-    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh apply -f composite-app.yaml -v values.yaml\`
-    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh apply -f composite-app.yaml -v values-resources.yaml\`
+    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh apply -f 03-addons-app.yaml -v values.yaml\`
+    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh apply -f 04-addon-resources-app.yaml -v values.yaml\`
 
 # Uninstalling KUD addons with emcoctl
 
 1. Delete addons
 
-    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh delete -f composite-app.yaml -v values-resources.yaml\`
-    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh delete -f composite-app.yaml -v values.yaml\`
+    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh delete -f 04-addon-resources-app.yaml -v values.yaml\`
+    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh delete -f 03-addons-app.yaml -v values.yaml\`
 
 2. Cleanup prerequisites
 
-    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh delete -f prerequisites.yaml -v values.yaml\`
+    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh delete -f 02-project.yaml -v values.yaml\`
+    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh delete -f 01-cluster.yaml -v values.yaml\`
+    \`$ /opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/emcoctl.sh delete -f 00-controllers.yaml -v values.yaml\`
 
 #### NOTE: Known issue: deletion of the resources fails sometimes as
 some resources can't be deleted before others are deleted. This can
diff --git a/kud/hosting_providers/containerized/addons/values-resources.yaml.tmpl b/kud/hosting_providers/containerized/addons/values-resources.yaml.tmpl
deleted file mode 100644 (file)
index ed56823..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-HostIP: ${HOST_IP}
-KubeConfig: ${KUBE_PATH}
-PackagesPath: ${PACKAGES_PATH}
-ProjectName: proj1
-RsyncPort: 30441
-GacPort: 30493
-OvnPort: 30473
-DtcPort: 30483
-ClusterProvider: provider1
-Cluster1: cluster1
-ClusterLabel: edge-cluster
-LogicalCloud: default
-Apps:
-- sriov-network
-CompositeApp: addon-resources
-CompositeProfile: addon-resources-profile
-DeploymentIntentGroup: addon-resources-deployment-intent-group
-DeploymentIntent: addon-resources-deployment-intent
-GenericPlacementIntent: addon-resources-placement-intent
index 62936be..f4f0b76 100644 (file)
@@ -1,24 +1,36 @@
 HostIP: ${HOST_IP}
-KubeConfig: ${KUBE_PATH}
-PackagesPath: ${PACKAGES_PATH}
-ProjectName: proj1
 RsyncPort: 30441
 GacPort: 30493
 OvnPort: 30473
 DtcPort: 30483
-ClusterProvider: provider1
-Cluster1: cluster1
-ClusterLabel: edge-cluster
+
+ClusterProvider: kud
+ClustersLabel: kud-cluster
+Clusters:
+- KubeConfig: ${KUBE_PATH}
+  Name: cluster
+
+ProjectName: kud
 LogicalCloud: default
-Apps:
+
+PackagesPath: ${PACKAGES_PATH}
+AddonsApp: addons
+AddonsProfile: addons-profile
+AddonsDeploymentIntentGroup: addons-deployment-intent-group
+AddonsDeploymentIntent: addons-deployment-intent
+AddonsPlacementIntent: addons-placement-intent
+Addons:
 - multus-cni
 - ovn4nfv
 - node-feature-discovery
 - sriov-network-operator
 - qat-device-plugin
 - cpu-manager
-CompositeApp: addons
-CompositeProfile: addons-profile
-DeploymentIntentGroup: addons-deployment-intent-group
-DeploymentIntent: addons-deployment-intent
-GenericPlacementIntent: addons-placement-intent
+
+AddonResourcesApp: addon-resources
+AddonResourcesProfile: addon-resources-profile
+AddonResourcesDeploymentIntentGroup: addon-resources-deployment-intent-group
+AddonResourcesDeploymentIntent: addon-resources-deployment-intent
+AddonResourcesPlacementIntent: addon-resources-placement-intent
+AddonResources:
+- sriov-network
index 427850a..5de9d9d 100755 (executable)
@@ -238,8 +238,9 @@ function install_host_artifacts {
     cp -rf ${kud_inventory_folder}/artifacts/* ${host_artifacts_dir}
 
     mkdir -p ${host_artifacts_dir}/addons
-    cp ${kud_infra_folder}/emco/examples/prerequisites.yaml ${host_artifacts_dir}/addons
-    cp ${kud_infra_folder}/emco/composite-app.yaml ${host_artifacts_dir}/addons
+    for yaml in ${kud_infra_folder}/emco/examples/*.yaml; do
+        cp ${yaml} ${host_artifacts_dir}/addons
+    done
     for template in addons/*.tmpl; do
         CLUSTER_NAME="${cluster_name}" \
         HOST_IP="$(master_ip)" \