-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Quota Management Support (Part 1) (#55)
Without this, you'll not get very far with Openstack's defaults! This adds in an endpoint that can read and update quotas. These are explciitly scoped to the identity (as that maps to an OpenStack project where quotas reside), and implicitly to the client e.g. unikorn-kubernetes/unikorn-baremetal, so they can independently affect quotas in a shared identity without having to know about one another. This first part adds in the necessary APIs that allow quotas to be created by a client, trigger an identity reconcile and are implicitly deleted on identity deletion.
- Loading branch information
Showing
14 changed files
with
1,137 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.16.1 | ||
name: quotas.region.unikorn-cloud.org | ||
spec: | ||
group: region.unikorn-cloud.org | ||
names: | ||
categories: | ||
- unikorn | ||
kind: Quota | ||
listKind: QuotaList | ||
plural: quotas | ||
singular: quota | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- jsonPath: .metadata.creationTimestamp | ||
name: age | ||
type: date | ||
name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: |- | ||
Quota defines resource limits for identities. | ||
We don't want to be concerned with Hertz and bytes, instead we want to | ||
expose higher level primitives like flavors and how many they are. This | ||
removes a lot of the burden from clients. Where we have to be careful is | ||
with overheads, e.g. a machine implicitly defines CPUs, memory and storage, | ||
but this will also need networks, NICs and other supporting resources. | ||
Quotas are scoped to identities, and also to a specific client, as this avoids | ||
having to worry about IPC and split brain concerns. | ||
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: | ||
flavors: | ||
description: Flavors is a list of flavors and their count. | ||
items: | ||
properties: | ||
count: | ||
description: |- | ||
Count is the number of instances that are required. | ||
For certain services that can do rolling upgrades, be aware that this | ||
may need a little overhead to cater for that. For example the Kubernetes | ||
service will do a one-in-one-out upgrade of the control plane. | ||
type: integer | ||
id: | ||
description: ID is the flavor ID. | ||
type: string | ||
required: | ||
- count | ||
- id | ||
type: object | ||
type: array | ||
x-kubernetes-list-map-keys: | ||
- id | ||
x-kubernetes-list-type: map | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ rules: | |
- apiGroups: | ||
- region.unikorn-cloud.org | ||
resources: | ||
- quotas | ||
- physicalnetworks | ||
verbs: | ||
- list | ||
|
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.