Changelog
List of aperture PRs merged since 0.24.0 release. For the full list of changes, see [list of changes][changes]
Add aperturectl flow-control subcommand and reverse-rpc framework (1418)
Added a Server-to-client rpc framework (reverse RPC), which allows
controller
to call functions on agents. See
[pkg/rpc/doc.go](https://github.com/fluxninja/aperture/blob/live-preview/pkg/rpc/doc.go)
for details.
Added subcommands:
* `aperturectl agents`
* `aperturectl flow-control control-points`
* `aperturectl flow-control preview [--http] SERVICE CONTROL_POINT`
These subcommands are implemented by `aperturectl` making a request to
controller,
which then makes requests to all agents and aggregates results.
This means that agent connects to controller directly, in addition to
etcd and grpc connections.
`aperturectl` can connect to controller either directly or by
automatically port-forwarding into kubernetes cluster (`--kube`).
Autoscaler (1437)
Description of change
proto
// Autoscaler
message Autoscaler {
// Increasing Gradient defines a controller for scaling out based on Gradient Controller.
message IncreasingGradient {
// This allows subset of parameters with constrained values compared to a regular gradient controller. For full documentation of these parameters, refer to the [GradientControllerParameters](gradient-controller-parameters).
message Parameters {
double slope = 1; // gotags: default:"1.0"
double max_gradient = 3; // gotags: default:"1.79769313486231570814527423731704356798070e+308" validate:"gte=1.0"
}
// Inputs for Gradient.
message Ins {
// The signal to use for scale out.
InPort signal = 1;
// The setpoint to use for scale out.
InPort setpoint = 2;
}
// Input ports for the Gradient.
Ins in_ports = 1;
// Gradient parameters for the controller. Defaults and constraints:
// * slope = 1
// * min_gradient = 1 (cannot be changed)
// * max_gradient = +Inf (must be greater than 1)
Parameters parameters = 2;
}
// Decreasing Gradient defines a controller for scaling in based on Gradient Controller.
message DecreasingGradient {
// This allows subset of parameters with constrained values compared to a regular gradient controller. For full documentation of these parameters, refer to the [GradientControllerParameters](gradient-controller-parameters).
message Parameters {
double slope = 1; // gotags: default:"1.0"
double min_gradient = 2; // gotags: default:"-1.79769313486231570814527423731704356798070e+308" validate:"lte=1.0"
}
// Inputs for Gradient.
message Ins {
// The signal to use for scale in.
InPort signal = 1;
// The setpoint to use for scale in.
InPort setpoint = 2;
}
// Input ports for the Gradient.
Ins in_ports = 1;
// Gradient parameters for the controller. Defaults and constraints:
// * slope = 1
// * min_gradient = -Inf (must be less than 1)
// * max_gradient = 1 (cannot be changed)
Parameters parameters = 2;
}
message ScaleOutController {
message Controller {
oneof controller {
IncreasingGradient gradient = 1;
}
}
// Controller
Controller controller = 1; // gotags: validate:"required"
// Configuration for embedded alerter.
Alerter.Parameters alerter_parameters = 2;
}
message ScaleInController {
message Controller {
oneof controller {
DecreasingGradient gradient = 1;
}
}
// Controller
Controller controller = 1;
// Configuration for embedded alerter.
Alerter.Parameters alerter_parameters = 2;
}
message Scaler {
oneof scaler {
KubernetesReplicas kubernetes_replicas = 1;
}
}
// KubernetesReplicas defines a horizontal pod scaler for Kubernetes.
message KubernetesReplicas {
// The Kubernetes object on which horizontal scaling is applied.
KubernetesObjectSelector kubernetes_object_selector = 1; // gotags: validate:"required"
// Configuration key for DynamicConfig
string dynamic_config_key = 2;
// Default configuration.
PodScaler.ScaleActuator.DynamicConfig default_config = 3;
}
// Outputs for Autoscaler.
message Outs {
OutPort actual_scale = 1;
OutPort configured_scale = 2;
OutPort desired_scale = 3;
}
// Output ports for the Autoscaler.
Outs out_ports = 1;
Scaler scaler = 2; // gotags: validate:"required"
// The minimum scale to which the autoscaler can scale in. E.g. in case of KubernetesReplicas Scaler, this is the minimum number of replicas.
uint64 min_scale = 3; // gotags: default:"0"];
// The maximum scale to which the autoscaler can scale out. E.g. in case of KubernetesReplicas Scaler, this is the maximum number of replicas.
uint64 max_scale = 4; // gotags: default:"4294967295"]
// List of Controllers for scaling out.
repeated ScaleOutController scale_out_controllers = 5;
// List of Controllers for scaling in.
repeated ScaleInController scale_in_controllers = 6;
// The maximum increase of scale (e.g. pods) at one time. Defined as percentage of current scale value. Can never go below one even if percentage computation is less than one. Defaults to 10% of current scale value.
double scale_in_max_percentage = 7; // gotags: default:"10"
// The maximum decrease of scale (e.g. pods) at one time. Defined as percentage of current scale value. Can never go below one even if percentage computation is less than one. Defaults to 1% of current scale value.
double scale_out_max_percentage = 8; // gotags: default:"1"
// The amount of time to wait after a scale out operation for another scale out or scale in operation.
google.protobuf.Duration scale_out_cooldown = 9; // gotags: default:"30s"
// The amount of time to wait after a scale in operation for another scale in operation.
google.protobuf.Duration scale_in_cooldown = 10; // gotags: default:"120s"
// Cooldown override percentage defines a threshold change in scale out beyond which previous cooldown is overridden.
// For example, if the cooldown is 5 minutes and the cooldown override percentage is 10%, then if the
// scale increases by 10% or more, the previous cooldown is cancelled. Defaults to 50%.
double cooldown_override_percentage = 11; // gotags: default:"50"
// Configuration for scale out alerter.
Alerter.Parameters scale_out_alerter_parameters = 12;
// Configuration for scale in alerter.
Alerter.Parameters scale_in_alerter_parameters = 13;
}
Read IP addresses from `source` and `destination` attributes in authz (1383)
Description of change
**Read IP addresses from source and destination attributes in authz**
This change attaches the above attributes as telemetry labels to be sent
to Druid. Later this data can be used to construct service flow sankey
diagrams for a control point.
**Add clusterIP to entity**
In this change,
1. we get the service that the endpoint belongs to
2. extract clusterIP if it is not "" or "None" (for headless services)
3. create entry in entitycache with this IP
aperturectl: Take KUBECONFIG env var into account (1426)
This should make aperturectl use the same config as kubectl
> For configuration, kubectl looks for a file named config in the
> $HOME/.kube directory. You can specify other kubeconfig files by
setting
> the KUBECONFIG environment variable or by setting the --kubeconfig
flag.
translate our go validate required rules to swagger required (1424)
Description of change
Translate our validation (Go validator) constraint (required) to
swagger's required spec. We can translate other constraints over time.
<img width="1275" alt="Screenshot 2023-02-21 at 10 22 32 PM"
src="https://user-images.githubusercontent.com/18579817/220539897-fc883bd6-6fe6-4f2c-91f4-f9fe65555dba.png">
<img width="1252" alt="Screenshot 2023-02-21 at 10 22 39 PM"
src="https://user-images.githubusercontent.com/18579817/220539921-f2b1643e-fa2e-4006-a25b-23712de72e3d.png">
Fixed issue of aperturectl failing on first execution (1415)
Description of change
`aperturectl` was throwing error for `blueprints generate` when the
cache directory is not present due to relPath is getting generated after
executing pull command and we were generating the `blueprintsDir` path
before that.
platform: replace gocron with goquartz (1408)
Description of change
Gocron has several issues such as race conditions (which our team
fixed), rescheduling issues when jobs are delayed and so on. So rather
than keep fixing their codebase, we are switching to
[go-quartz](https://pkg.go.dev/github.com/reugn/go-quartzv0.6.0/quartz)
package.
<img width="1271" alt="Screenshot 2023-02-20 at 11 07 27 PM"
src="https://user-images.githubusercontent.com/18579817/220272526-ba549e55-7adf-433f-bdb2-25cd41d59484.png">
<img width="1268" alt="Screenshot 2023-02-20 at 11 07 37 PM"
src="https://user-images.githubusercontent.com/18579817/220272531-55f719be-a76a-4b30-aa45-d8d1d448d25d.png">
[changes]: https://github.com/fluxninja/aperture/compare/releases/aperture-controller/v0.24.0...releases/aperture-controller/v0.25.0