blob: c5fb7ea50a1ffe52bee986febde768fbb347dff8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2020 Intel Corporation
{{- range $compositeAppName, $compositeApp := .CompositeApps }}
---
#creating composite app entry
version: emco/v2
resourceContext:
anchor: projects/{{ $.ProjectName }}/composite-apps
metadata :
name: {{ $compositeAppName }}
spec:
version: v1
{{- range $index, $app := $compositeApp.Apps }}
---
#adding app to the composite app
version: emco/v2
resourceContext:
anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $compositeAppName }}/v1/apps
metadata :
name: {{ $app }}
file:
{{ $.PackagesPath }}/{{ $app }}.tar.gz
{{- end }}
---
#creating composite profile entry
version: emco/v2
resourceContext:
anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $compositeAppName }}/v1/composite-profiles
metadata :
name: {{ $compositeAppName }}
{{- range $index, $app := $compositeApp.Apps }}
---
#adding app profiles to the composite profile
version: emco/v2
resourceContext:
anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $compositeAppName }}/v1/composite-profiles/{{ $compositeAppName }}/profiles
metadata :
name: {{ $app }}-profile
spec:
app-name: {{ $app }}
file:
{{ $.PackagesPath }}/{{ $app }}_profile.tar.gz
{{- end }}
---
#create deployment intent group
version: emco/v2
resourceContext:
anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $compositeAppName }}/v1/deployment-intent-groups
metadata :
name: deployment
spec:
profile: {{ $compositeAppName }}
version: r1
logical-cloud: {{ $.LogicalCloud }}
override-values: []
---
#create intent in deployment intent group
version: emco/v2
resourceContext:
anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $compositeAppName }}/v1/deployment-intent-groups/deployment/intents
metadata :
name: deployment-intent
spec:
intent:
genericPlacementIntent: placement-intent
---
#create the generic placement intent
version: emco/v2
resourceContext:
anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $compositeAppName }}/v1/deployment-intent-groups/deployment/generic-placement-intents
metadata :
name: placement-intent
spec:
logical-cloud: {{ $.LogicalCloud }}
{{- range $index, $app := $compositeApp.Apps }}
---
#add the app placement intent to the generic placement intent
version: emco/v2
resourceContext:
anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $compositeAppName }}/v1/deployment-intent-groups/deployment/generic-placement-intents/placement-intent/app-intents
metadata:
name: {{ $app }}-placement-intent
spec:
app-name: {{ $app }}
intent:
allOf:
- provider-name: {{ $.ClusterProvider }}
cluster-label-name: {{ $.ClustersLabel }}
{{- end }}
---
#approve
version: emco/v2
resourceContext:
anchor: projects/{{ $.ProjectName }}/composite-apps/{{ $compositeAppName }}/v1/deployment-intent-groups/deployment/approve
{{- end }}
|