-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rhythm] Add rollout-operator and allow simultaneous update of block-…
…builder pods (#4660) * Add rollout-operator * Merge multi-zone operator and add more functionality * Bump version * Automatically configure enable_groups * fmt
- Loading branch information
Showing
8 changed files
with
364 additions
and
66 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
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
32 changes: 32 additions & 0 deletions
32
operations/jsonnet/microservices/replica-template.libsonnet
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,32 @@ | ||
{ | ||
_config+: { | ||
replica_template_custom_resource_definition_enabled: false, | ||
}, | ||
|
||
replica_template:: std.parseYaml(importstr 'replica-templates.yaml'), | ||
replica_template_custom_resource: if !$._config.replica_template_custom_resource_definition_enabled then null else $.replica_template, | ||
|
||
// replicaTemplate creates new ReplicaTemplate resource. | ||
// If replicas is > 0, spec.replicas field is specified in the resource, if replicas <= 0, spec.replicas field is hidden. | ||
// Syntactically valid label selector is required, and may be used by HorizontalPodAutoscaler controller when ReplicaTemplate | ||
// is used as scaled resource depending on metric target type. | ||
// (When using targetType=AverageValue, label selector is not used for scaling computation). | ||
replicaTemplate(name, replicas, label_selector):: { | ||
apiVersion: 'rollout-operator.grafana.com/v1', | ||
kind: 'ReplicaTemplate', | ||
metadata: { | ||
name: name, | ||
namespace: $._config.namespace, | ||
}, | ||
spec: { | ||
// HPA requires that label selector exists and is valid, but it will not be used for target type of AverageValue. | ||
labelSelector: label_selector, | ||
} + ( | ||
if replicas <= 0 then { | ||
replicas:: null, // Hide replicas field. | ||
} else { | ||
replicas: replicas, | ||
} | ||
), | ||
}, | ||
} |
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,52 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
# must be in the form: <plural>.<group> | ||
name: replicatemplates.rollout-operator.grafana.com | ||
spec: | ||
group: rollout-operator.grafana.com | ||
versions: | ||
- name: v1 | ||
served: true | ||
storage: true | ||
additionalPrinterColumns: | ||
- description: Status replicas | ||
jsonPath: .status.replicas | ||
name: StatusReplicas | ||
type: string | ||
- description: Spec replicas | ||
jsonPath: .spec.replicas | ||
name: SpecReplicas | ||
type: string | ||
schema: | ||
openAPIV3Schema: | ||
type: object | ||
properties: | ||
spec: | ||
type: object | ||
properties: | ||
replicas: | ||
type: integer | ||
default: 1 | ||
minimum: 0 | ||
labelSelector: | ||
type: string | ||
status: | ||
type: object | ||
properties: | ||
replicas: | ||
type: integer | ||
subresources: | ||
status: { } | ||
scale: | ||
specReplicasPath: .spec.replicas | ||
statusReplicasPath: .status.replicas | ||
labelSelectorPath: .spec.labelSelector | ||
scope: Namespaced | ||
names: | ||
plural: replicatemplates | ||
singular: replicatemplate | ||
kind: ReplicaTemplate | ||
categories: | ||
# Include in "kubectl get all" output | ||
- all |
Oops, something went wrong.