-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rejig Neutron VLAN Provisioning (#47)
So it transpires we were trying to piggy back on the stellar work by SCS for identity and allow a domain admin for provider networks, but alas Neutron has zero visibility of domains, and secondly only "admin" and "advsvc" can provision in a different project (hard coded, not a policy). Out one remaining option is to create a context that is for the "manager" user, but scoped to the user's project, and that can allow the provider network to be provisioned.
- Loading branch information
Showing
41 changed files
with
2,611 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
charts/region/crds/region.unikorn-cloud.org_openstackphysicalnetworks.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.14.0 | ||
name: openstackphysicalnetworks.region.unikorn-cloud.org | ||
spec: | ||
group: region.unikorn-cloud.org | ||
names: | ||
categories: | ||
- unikorn | ||
kind: OpenstackPhysicalNetwork | ||
listKind: OpenstackPhysicalNetworkList | ||
plural: openstackphysicalnetworks | ||
singular: openstackphysicalnetwork | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- jsonPath: .metadata.creationTimestamp | ||
name: age | ||
type: date | ||
name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: OpenstackPhysicalNetwork defines a physical network beloning | ||
to an identity. | ||
properties: | ||
apiVersion: | ||
description: |- | ||
APIVersion defines the versioned schema of this representation of an object. | ||
Servers should convert recognized schemas to the latest internal value, and | ||
may reject unrecognized values. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | ||
type: string | ||
kind: | ||
description: |- | ||
Kind is a string value representing the REST resource this object represents. | ||
Servers may infer this from the endpoint the client submits requests to. | ||
Cannot be updated. | ||
In CamelCase. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
networkID: | ||
description: NetworkID is the network ID. | ||
type: string | ||
routerID: | ||
description: RouterID is the router ID. | ||
type: string | ||
routerSubnetInterfaceAdded: | ||
description: RouterSubnetInterfaceAdded tells us if this step has | ||
been accomplished. | ||
type: boolean | ||
subnetID: | ||
description: SubnetID is the subnet ID. | ||
type: string | ||
vlanID: | ||
description: VlanID is the ID if the VLAN for IPAM. | ||
type: integer | ||
type: object | ||
status: | ||
type: object | ||
required: | ||
- spec | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
charts/region/crds/region.unikorn-cloud.org_vlanallocations.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.14.0 | ||
name: vlanallocations.region.unikorn-cloud.org | ||
spec: | ||
group: region.unikorn-cloud.org | ||
names: | ||
categories: | ||
- unikorn | ||
kind: VLANAllocation | ||
listKind: VLANAllocationList | ||
plural: vlanallocations | ||
singular: vlanallocation | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- jsonPath: .metadata.creationTimestamp | ||
name: age | ||
type: date | ||
name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: |- | ||
VLANAllocation is used to manage VLAN allocations. Only a single instance is | ||
allowed per region. As this is a custom resource, we are guaranteed atomicity | ||
due to Kubernetes' speculative locking implementation. | ||
properties: | ||
apiVersion: | ||
description: |- | ||
APIVersion defines the versioned schema of this representation of an object. | ||
Servers should convert recognized schemas to the latest internal value, and | ||
may reject unrecognized values. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | ||
type: string | ||
kind: | ||
description: |- | ||
Kind is a string value representing the REST resource this object represents. | ||
Servers may infer this from the endpoint the client submits requests to. | ||
Cannot be updated. | ||
In CamelCase. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
allocations: | ||
description: Allocations are an explcit set of VLAN allocations. | ||
items: | ||
properties: | ||
id: | ||
description: ID is the VLAN ID. | ||
type: integer | ||
physicalNetworkID: | ||
description: |- | ||
PhysicalNetworkID is the physical network/provider specific physical network | ||
identifier that owns this entry. | ||
type: string | ||
required: | ||
- id | ||
- physicalNetworkID | ||
type: object | ||
type: array | ||
type: object | ||
status: | ||
type: object | ||
required: | ||
- spec | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
charts/region/templates/physical-network-controller/clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: unikorn-physical-network-controller | ||
labels: | ||
{{- include "unikorn.labels" . | nindent 4 }} | ||
rules: | ||
# Orchestrate Unikorn resources (my job). | ||
- apiGroups: | ||
- region.unikorn-cloud.org | ||
resources: | ||
- identities | ||
- openstackidentities | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- region.unikorn-cloud.org | ||
resources: | ||
- physicalnetworks | ||
verbs: | ||
- list | ||
- watch | ||
- update | ||
- patch | ||
- apiGroups: | ||
- region.unikorn-cloud.org | ||
resources: | ||
- physicalnetworks/status | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- region.unikorn-cloud.org | ||
resources: | ||
- openstackphysicalnetworks | ||
verbs: | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- delete | ||
- apiGroups: | ||
- region.unikorn-cloud.org | ||
resources: | ||
- vlanallocations | ||
verbs: | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- secrets | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- region.unikorn-cloud.org | ||
resources: | ||
- regions | ||
verbs: | ||
- list | ||
- watch |
14 changes: 14 additions & 0 deletions
14
charts/region/templates/physical-network-controller/clusterrolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: unikorn-physical-network-controller | ||
labels: | ||
{{- include "unikorn.labels" . | nindent 4 }} | ||
subjects: | ||
- kind: ServiceAccount | ||
namespace: {{ .Release.Namespace }} | ||
name: unikorn-physical-network-controller | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: unikorn-physical-network-controller |
Oops, something went wrong.