Skip to content

Commit

Permalink
kuma-api: add proto definition for HealthCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
yskopets committed Nov 17, 2019
1 parent f971bad commit 86970ff
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions api/mesh/v1alpha1/health_check.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
syntax = "proto3";

package kuma.mesh.v1alpha1;

option go_package = "v1alpha1";

import "mesh/v1alpha1/selector.proto";

import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";

import "validate/validate.proto";

// HealthCheck defines configuration for health checking.
message HealthCheck {

// List of selectors to match dataplanes that should be configured to do health checks.
repeated Selector sources = 1 [ (validate.rules).repeated .min_items = 1 ];

// List of selectors to match services that need to be health checked.
repeated Selector destinations = 2
[ (validate.rules).repeated .min_items = 1 ];

// Conf defines configuration for various types of health checking.
message Conf {

// Active defines configuration for active health checking.
message Active {

// Interval between consecutive health checks.
google.protobuf.Duration interval = 1 [(validate.rules).duration = {gt {}}];

// Maximum time to wait for a health check response.
google.protobuf.Duration timeout = 2 [(validate.rules).duration = {gt {}}];

// Number of consecutive unhealthy checks before considering a host unhealthy.
google.protobuf.UInt32Value unhealthy_threshold = 3 [(validate.rules).uint32 = {gt: 0}];

// Number of consecutive healthy checks before considering a host healthy.
google.protobuf.UInt32Value healthy_threshold = 4 [(validate.rules).uint32 = {gt: 0}];
}

// Passive defines configuration for passive health checking.
message Passive {

// Number of consecutive failed requests before considering a host unhealthy.
google.protobuf.UInt32Value unhealthy_threshold = 1 [(validate.rules).uint32 = {gt: 0}];

// Interval a host should be considred unhealthy after reaching unhealthy threshold.
google.protobuf.Duration penalty_interval = 2 [(validate.rules).duration = {gt {}}];
}

// Configuration for active health checking.
Active active_checks = 1;

// Configuration for passive health checking.
Passive passive_checks = 2;
}

// Configuration for various types of health checking.
Conf conf = 3;
}

0 comments on commit 86970ff

Please sign in to comment.