summaryrefslogtreecommitdiffstats
path: root/kud/deployment_infra/emco/examples/02-project.yaml
blob: 224126ce4312b4262263993853cb5eff5a61aa19 (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
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2020 Intel Corporation

---
#create project
version: emco/v2
resourceContext:
  anchor: projects
metadata :
  name: {{ .ProjectName }}

---
#create privileged logical cloud
version: emco/v2
resourceContext:
  anchor: projects/{{ .ProjectName }}/logical-clouds
metadata:
  name: {{ .LogicalCloud }}
spec:
  namespace: {{ .LogicalCloud }}
  user:
    user-name: {{ .LogicalCloud }}-admin
    type: certificate

---
#create cluster quotas
version: emco/v2
resourceContext:
  anchor: projects/{{ .ProjectName }}/logical-clouds/{{ .LogicalCloud }}/cluster-quotas
metadata:
  name: quota
spec:
  #an empty spec means that the addons will not be required to specify
  #cpu, memory, etc. limits

---
#add namespaced permissions
version: emco/v2
resourceContext:
  anchor: projects/{{ .ProjectName }}/logical-clouds/{{ .LogicalCloud }}/user-permissions
metadata:
  name: namespaced
spec:
  namespace: {{ .LogicalCloud }}
  apiGroups:
  - "*"
  resources:
  - "*"
  verbs:
  - "*"

---
#add non-namespaced permissions
version: emco/v2
resourceContext:
  anchor: projects/{{ .ProjectName }}/logical-clouds/{{ .LogicalCloud }}/user-permissions
metadata:
  name: non-namespaced
spec:
  namespace: ""
  apiGroups:
  - "*"
  resources:
  - "*"
  verbs:
  - "*"

{{- range $clusterName, $cluster := .Clusters }}
---
#add cluster reference to logical cloud
version: emco/v2
resourceContext:
  anchor: projects/{{ $.ProjectName }}/logical-clouds/{{ $.LogicalCloud }}/cluster-references
metadata:
  name: {{ $clusterName }}
spec:
  cluster-provider: {{ $.ClusterProvider }}
  cluster-name: {{ $clusterName }}
  loadbalancer-ip: "0.0.0.0"
{{- end }}

---
#instantiate logical cloud
version: emco/v2
resourceContext:
  anchor: projects/{{ .ProjectName }}/logical-clouds/{{ .LogicalCloud }}/instantiate