Skip to content

Commit

Permalink
Feature: replica updater (#28)
Browse files Browse the repository at this point in the history
- feat: replica-updater prototype
- refactor: using container scales
- test: e2e replica updater barebone
- feat: update manifests files
- test: e2e replica updater test
  • Loading branch information
DragonBanana authored Feb 18, 2021
1 parent 6461179 commit 0d7dd66
Show file tree
Hide file tree
Showing 15 changed files with 1,475 additions and 203 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ vet:
# Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen
@echo "generate CRDs manifests"
$(CONTROLLER_GEN) crd paths="./pkg/apis/systemautoscaler/..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) crd paths="./pkg/apis/systemautoscaler/..." crd:crdVersions={v1} output:crd:artifacts:config=config/crd/bases

controller-gen:
ifeq (, $(shell which controller-gen))
Expand Down
160 changes: 80 additions & 80 deletions config/crd/bases/systemautoscaler.polimi.it_containerscales.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
Expand All @@ -14,88 +14,88 @@ spec:
listKind: ContainerScaleList
plural: containerscales
singular: containerscale
preserveUnknownFields: false
scope: Namespaced
validation:
openAPIV3Schema:
description: ContainerScale defines the mapping between a `ServiceLevelAgreement`
and a `Pod` matching the selector. It also keeps track of the resource values
computed by `Recommender` and adjusted by `Contention Manager`.
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:
description: ContainerScaleSpec is the spec for a ContainerScale resource
properties:
container:
type: string
desired:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: ResourceList is a set of (resource name, quantity) pairs.
type: object
pod:
description: PodRef is a reference to a pod
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
serviceLevelAgreement:
description: SLARef is a reference to a pod
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
required:
- container
- pod
- serviceLevelAgreement
type: object
status:
description: ContainerScaleStatus contains the resources patched by the
`Contention Manager` according to the available node resources and other
pods' SLA
properties:
actual:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: ResourceList is a set of (resource name, quantity) pairs.
type: object
type: object
required:
- spec
- status
type: object
version: v1beta1
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: ContainerScale defines the mapping between a `ServiceLevelAgreement`
and a `Pod` matching the selector. It also keeps track of the resource values
computed by `Recommender` and adjusted by `Contention Manager`.
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:
description: ContainerScaleSpec is the spec for a ContainerScale resource
properties:
container:
type: string
desired:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: ResourceList is a set of (resource name, quantity) pairs.
type: object
pod:
description: PodRef is a reference to a pod
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
serviceLevelAgreement:
description: SLARef is a reference to a pod
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
required:
- container
- pod
- serviceLevelAgreement
type: object
status:
description: ContainerScaleStatus contains the resources patched by the
`Contention Manager` according to the available node resources and other
pods' SLA
properties:
actual:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: ResourceList is a set of (resource name, quantity) pairs.
type: object
type: object
required:
- spec
- status
type: object
served: true
storage: true
status:
Expand Down
Loading

0 comments on commit 0d7dd66

Please sign in to comment.