Skip to content

Commit 17d2c2e

Browse files
authored
External Network Selection and Image Meta (#39)
In most cases I've ever seen, for various reasons, there are multiple external networks. We need to provide selection criteria to pick ones that actually work. Additionally, migrate to the new image metadata specification to enhance selection for a flavor.
1 parent 71a94fd commit 17d2c2e

File tree

17 files changed

+1006
-274
lines changed

17 files changed

+1006
-274
lines changed

charts/region/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: A Helm chart for deploying Unikorn's Region Controller
44

55
type: application
66

7-
version: v0.1.25
8-
appVersion: v0.1.25
7+
version: v0.1.26
8+
appVersion: v0.1.26
99

1010
icon: https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/dark-on-light/icon.png
1111

charts/region/crds/region.unikorn-cloud.org_regions.yaml

Lines changed: 80 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -190,60 +190,93 @@ spec:
190190
image:
191191
description: Image is configuration for the image service.
192192
properties:
193-
propertiesInclude:
193+
selector:
194194
description: |-
195-
PropertiesInclude defines the set of properties that must all exist
196-
for an image to be advertised by the provider.
197-
items:
198-
type: string
199-
type: array
200-
signingKey:
201-
description: |-
202-
SigningKey defines a PEM encoded public ECDSA signing key used to verify
203-
the image is trusted. If specified, an image must contain the "digest"
204-
property, the value of which must be a base64 encoded ECDSA signature of
205-
the SHA256 hash of the image ID.
206-
format: byte
207-
type: string
195+
Selector defines a set of rules to lookup images.
196+
If not specified, all images are selected.
197+
properties:
198+
properties:
199+
description: |-
200+
Properties defines the set of properties an image needs to have to
201+
be selected.
202+
items:
203+
type: string
204+
type: array
205+
signingKey:
206+
description: |-
207+
SigningKey defines a PEM encoded public ECDSA signing key used to verify
208+
the image is trusted. If specified, an image must contain the "digest"
209+
property, the value of which must be a base64 encoded ECDSA signature of
210+
the SHA256 hash of the image ID.
211+
format: byte
212+
type: string
213+
type: object
208214
type: object
209215
network:
210216
description: Network is configuration for the network service.
211217
properties:
212-
physicalNetwork:
213-
description: |-
214-
PhysicalNetwork is the neutron provider specific network name used
215-
to provision provider networks e.g. VLANs for bare metal clusters.
216-
type: string
217-
vlan:
218-
description: |-
219-
VLAN is the VLAN configuration. If not specified and a VLAN provider
220-
network is requested then the ID will be allocated between 1-6094
221-
inclusive.
218+
externalNetworks:
219+
description: ExternalNetworks allows external network options
220+
to be specified.
222221
properties:
223-
segments:
222+
selector:
224223
description: |-
225-
Segements allow blocks of VLAN IDs to be allocated from. In a multi
226-
tenant system, it's possible and perhaps necessary, that this controller
227-
be limited to certain ranges to avoid split brain scenarios when another
228-
user or system is allocating VLAN IDs for itself.
229-
items:
230-
properties:
231-
endId:
232-
description: EndID is the VLAN ID at the end of
233-
the range.
234-
maximum: 4094
235-
type: integer
236-
startId:
237-
description: StartID is VLAN ID at the start of
238-
the range.
239-
minimum: 1
240-
type: integer
241-
required:
242-
- endId
243-
- startId
244-
type: object
245-
minItems: 1
246-
type: array
224+
Selector defines a set of rules to lookup external networks.
225+
In none is specified, all external networks are selected.
226+
properties:
227+
ids:
228+
description: IDs is an explicit list of network IDs.
229+
items:
230+
type: string
231+
type: array
232+
tags:
233+
description: Tags is an implicit selector of networks
234+
with a set of all specified tags.
235+
items:
236+
type: string
237+
type: array
238+
type: object
239+
type: object
240+
providerNetworks:
241+
description: ProviderNetworks allows provider networks to
242+
be configured.
243+
properties:
244+
physicalNetwork:
245+
description: |-
246+
PhysicalNetwork is the neutron provider specific network name used
247+
to provision provider networks e.g. VLANs for bare metal clusters.
248+
type: string
249+
vlan:
250+
description: |-
251+
VLAN is the VLAN configuration. If not specified and a VLAN provider
252+
network is requested then the ID will be allocated between 1-6094
253+
inclusive.
254+
properties:
255+
segments:
256+
description: |-
257+
Segements allow blocks of VLAN IDs to be allocated from. In a multi
258+
tenant system, it's possible and perhaps necessary, that this controller
259+
be limited to certain ranges to avoid split brain scenarios when another
260+
user or system is allocating VLAN IDs for itself.
261+
items:
262+
properties:
263+
endId:
264+
description: EndID is the VLAN ID at the end
265+
of the range.
266+
maximum: 4094
267+
type: integer
268+
startId:
269+
description: StartID is VLAN ID at the start
270+
of the range.
271+
minimum: 1
272+
type: integer
273+
required:
274+
- endId
275+
- startId
276+
type: object
277+
minItems: 1
278+
type: array
279+
type: object
247280
type: object
248281
type: object
249282
serviceAccountSecret:

charts/region/templates/region.yaml

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -21,59 +21,19 @@ spec:
2121
name: {{ $openstack.serviceAccountSecret.name }}
2222
{{- with $identity := $openstack.identity }}
2323
{{ printf "identity:" | nindent 4 }}
24-
{{- with $roles := $identity.clusterRoles }}
25-
{{ printf "clusterRoles:" | nindent 6 }}
26-
{{- range $role := $roles }}
27-
{{ printf "- %s" $role | nindent 6 }}
28-
{{- end }}
29-
{{- end }}
24+
{{- toYaml $identity | nindent 6 }}
3025
{{- end }}
3126
{{- with $compute := $openstack.compute -}}
32-
{{- printf "compute:" | nindent 4 }}
33-
{{- with $policy := $compute.regionGroupPolicy -}}
34-
{{ printf "regionGroupPolicy: %s" $policy | nindent 6 }}
35-
{{- end }}
36-
{{- with $flavors := $compute.flavors -}}
37-
{{- printf "flavors:" | nindent 6 }}
38-
{{- printf "selectionPolicy: %s" $flavors.selectionPolicy | nindent 8 }}
39-
{{- with $includes := $flavors.include }}
40-
{{- printf "include:" | nindent 8 }}
41-
{{- range $include := $includes }}
42-
{{- printf "- id: %s" $include.id | nindent 8 }}
43-
{{- with $cpu := $include.cpu -}}
44-
{{- printf "cpu:" | nindent 10 }}
45-
{{- with $family := $cpu.family -}}
46-
{{ printf "family: %s" $family | nindent 12 }}
47-
{{- end }}
48-
{{- end }}
49-
{{- with $gpu := $include.gpu -}}
50-
{{- printf "gpu:" | nindent 10 }}
51-
{{- printf "vendor: %s" $gpu.vendor | nindent 12 }}
52-
{{- printf "model: %s" $gpu.model | nindent 12 }}
53-
{{- printf "memory: %s" $gpu.memory | nindent 12 }}
54-
{{- printf "count: %v" $gpu.count | nindent 12 }}
55-
{{- end }}
56-
{{- end }}
57-
{{- end }}
58-
{{- with $excludes := $flavors.exclude -}}
59-
{{- printf "exclude:" | nindent 8 }}
60-
{{- range $exclude := $excludes }}
61-
{{- printf "- id: %s" $exclude.id | nindent 8 }}
62-
{{- end }}
63-
{{- end }}
64-
{{- end }}
27+
{{ printf "compute:" | nindent 4 }}
28+
{{- toYaml $compute | nindent 6 }}
6529
{{- end }}
6630
{{- with $image := $openstack.image -}}
67-
{{- printf "image:" | nindent 4 }}
68-
{{- with $properties := $image.propertiesInclude -}}
69-
{{ printf "propertiesInclude:" | nindent 6 }}
70-
{{- range $property := $properties }}
71-
{{ printf "- %s" $property | nindent 6 }}
72-
{{- end }}
73-
{{- end }}
74-
{{- with $signingKey := $image.signingKey -}}
75-
{{ printf "signingKey: %s" $signingKey | nindent 6 }}
76-
{{- end }}
31+
{{ printf "image:" | nindent 4 }}
32+
{{- toYaml $image | nindent 6 }}
33+
{{- end }}
34+
{{- with $network := $openstack.network -}}
35+
{{ printf "network:" | nindent 4 }}
36+
{{- toYaml $network | nindent 6 }}
7737
{{- end }}
7838
{{- end }}
7939
{{- end }}

0 commit comments

Comments
 (0)