Skip to content

Commit

Permalink
api: clone v2[alpha] to v3alpha.
Browse files Browse the repository at this point in the history
This patch establishes a v3alpha baseline API, by doing a simple copy of
v2[alpha] dirs and some sed-style heuristic fixups of BUILD dependencies
and proto package namespaces.

The objective is provide a baseline which we can compare the output from
tooling described in envoyproxy#8083 in later PRs, providing smaller visual diffs.

The core philosophy of the API migration is that every step will be
captured in a script (at least until the last manual steps),
api/migration/v3alpha.sh. This script will capture deterministic
migration steps, allowing v2[alpha] to continue to be updated until we
finalize v3.

There is likely to be significant changes, e.g. in addition to the work
scoped for v3, we might want to reduce the amount of API churn by
referring back to v2 protos where it makes sense. This will be done via
tooling in later PRs.

Part of envoyproxy#8083.

Risk level: Low
Testing: build @envoy_api//...

Signed-off-by: Harvey Tuch <htuch@google.com>
  • Loading branch information
htuch committed Sep 3, 2019
1 parent b28edca commit 5c9cca4
Show file tree
Hide file tree
Showing 169 changed files with 14,364 additions and 0 deletions.
76 changes: 76 additions & 0 deletions api/envoy/admin/v3alpha/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library_internal")

licenses(["notice"]) # Apache 2

api_proto_library_internal(
name = "config_dump",
srcs = ["config_dump.proto"],
visibility = ["//visibility:public"],
deps = [
"//envoy/api/v3alpha:cds",
"//envoy/api/v3alpha:lds",
"//envoy/api/v3alpha:rds",
"//envoy/api/v3alpha:srds",
"//envoy/api/v3alpha/auth:cert",
"//envoy/config/bootstrap/v3alpha:bootstrap",
],
)

api_proto_library_internal(
name = "clusters",
srcs = ["clusters.proto"],
visibility = ["//visibility:public"],
deps = [
":metrics",
"//envoy/api/v3alpha/core:address",
"//envoy/api/v3alpha/core:health_check",
"//envoy/type:percent",
],
)

api_proto_library_internal(
name = "listeners",
srcs = ["listeners.proto"],
visibility = ["//visibility:public"],
deps = [
"//envoy/api/v3alpha/core:address",
],
)

api_proto_library_internal(
name = "metrics",
srcs = ["metrics.proto"],
visibility = ["//visibility:public"],
)

api_proto_library_internal(
name = "memory",
srcs = ["memory.proto"],
visibility = ["//visibility:public"],
)

api_proto_library_internal(
name = "mutex_stats",
srcs = ["mutex_stats.proto"],
visibility = ["//visibility:public"],
)

api_proto_library_internal(
name = "certs",
srcs = ["certs.proto"],
visibility = ["//visibility:public"],
)

api_proto_library_internal(
name = "server_info",
srcs = ["server_info.proto"],
visibility = ["//visibility:public"],
)

api_proto_library_internal(
name = "tap",
srcs = ["tap.proto"],
deps = [
"//envoy/service/tap/v3alpha:common",
],
)
57 changes: 57 additions & 0 deletions api/envoy/admin/v3alpha/certs.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
syntax = "proto3";

package envoy.admin.v3alpha;

option java_outer_classname = "CertsProto";
option java_multiple_files = true;
option java_package = "io.envoyproxy.envoy.admin.v3alpha";

import "google/protobuf/timestamp.proto";

// [#protodoc-title: Certificates]

// Proto representation of certificate details. Admin endpoint uses this wrapper for `/certs` to
// display certificate information. See :ref:`/certs <operations_admin_interface_certs>` for more
// information.
message Certificates {
// List of certificates known to an Envoy.
repeated Certificate certificates = 1;
}

message Certificate {

// Details of CA certificate.
repeated CertificateDetails ca_cert = 1;

// Details of Certificate Chain
repeated CertificateDetails cert_chain = 2;
}

message CertificateDetails {
// Path of the certificate.
string path = 1;

// Certificate Serial Number.
string serial_number = 2;

// List of Subject Alternate names.
repeated SubjectAlternateName subject_alt_names = 3;

// Minimum of days until expiration of certificate and it's chain.
uint64 days_until_expiration = 4;

// Indicates the time from which the certificate is valid.
google.protobuf.Timestamp valid_from = 5;

// Indicates the time at which the certificate expires.
google.protobuf.Timestamp expiration_time = 6;
}

message SubjectAlternateName {

// Subject Alternate Name.
oneof name {
string dns = 1;
string uri = 2;
}
}
143 changes: 143 additions & 0 deletions api/envoy/admin/v3alpha/clusters.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
syntax = "proto3";

package envoy.admin.v3alpha;

option java_outer_classname = "ClustersProto";
option java_multiple_files = true;
option java_package = "io.envoyproxy.envoy.admin.v3alpha";

import "envoy/admin/v3alpha/metrics.proto";
import "envoy/api/v3alpha/core/address.proto";
import "envoy/api/v3alpha/core/health_check.proto";
import "envoy/type/percent.proto";

// [#protodoc-title: Clusters]

// Admin endpoint uses this wrapper for `/clusters` to display cluster status information.
// See :ref:`/clusters <operations_admin_interface_clusters>` for more information.
message Clusters {
// Mapping from cluster name to each cluster's status.
repeated ClusterStatus cluster_statuses = 1;
}

// Details an individual cluster's current status.
message ClusterStatus {
// Name of the cluster.
string name = 1;

// Denotes whether this cluster was added via API or configured statically.
bool added_via_api = 2;

// The success rate threshold used in the last interval.
// If
// :ref:`outlier_detection.split_external_local_origin_errors<envoy_api_field_cluster.OutlierDetection.split_external_local_origin_errors>`
// is *false*, all errors: externally and locally generated were used to calculate the threshold.
// If
// :ref:`outlier_detection.split_external_local_origin_errors<envoy_api_field_cluster.OutlierDetection.split_external_local_origin_errors>`
// is *true*, only externally generated errors were used to calculate the threshold.
// The threshold is used to eject hosts based on their success rate. See
// :ref:`Cluster outlier detection <arch_overview_outlier_detection>` documentation for details.
//
// Note: this field may be omitted in any of the three following cases:
//
// 1. There were not enough hosts with enough request volume to proceed with success rate based
// outlier ejection.
// 2. The threshold is computed to be < 0 because a negative value implies that there was no
// threshold for that interval.
// 3. Outlier detection is not enabled for this cluster.
envoy.type.Percent success_rate_ejection_threshold = 3;

// Mapping from host address to the host's current status.
repeated HostStatus host_statuses = 4;

// The success rate threshold used in the last interval when only locally originated failures were
// taken into account and externally originated errors were treated as success.
// This field should be interpretted only when
// :ref:`outlier_detection.split_external_local_origin_errors<envoy_api_field_cluster.OutlierDetection.split_external_local_origin_errors>`
// is *true*. The threshold is used to eject hosts based on their success rate.
// See :ref:`Cluster outlier detection <arch_overview_outlier_detection>` documentation for
// details.
//
// Note: this field may be omitted in any of the three following cases:
//
// 1. There were not enough hosts with enough request volume to proceed with success rate based
// outlier ejection.
// 2. The threshold is computed to be < 0 because a negative value implies that there was no
// threshold for that interval.
// 3. Outlier detection is not enabled for this cluster.
envoy.type.Percent local_origin_success_rate_ejection_threshold = 5;
}

// Current state of a particular host.
message HostStatus {
// Address of this host.
envoy.api.v3alpha.core.Address address = 1;

// List of stats specific to this host.
repeated SimpleMetric stats = 2;

// The host's current health status.
HostHealthStatus health_status = 3;

// Request success rate for this host over the last calculated interval.
// If
// :ref:`outlier_detection.split_external_local_origin_errors<envoy_api_field_cluster.OutlierDetection.split_external_local_origin_errors>`
// is *false*, all errors: externally and locally generated were used in success rate
// calculation. If
// :ref:`outlier_detection.split_external_local_origin_errors<envoy_api_field_cluster.OutlierDetection.split_external_local_origin_errors>`
// is *true*, only externally generated errors were used in success rate calculation.
// See :ref:`Cluster outlier detection <arch_overview_outlier_detection>` documentation for
// details.
//
// Note: the message will not be present if host did not have enough request volume to calculate
// success rate or the cluster did not have enough hosts to run through success rate outlier
// ejection.
envoy.type.Percent success_rate = 4;

// The host's weight. If not configured, the value defaults to 1.
uint32 weight = 5;

// The hostname of the host, if applicable.
string hostname = 6;

// The host's priority. If not configured, the value defaults to 0 (highest priority).
uint32 priority = 7;

// Request success rate for this host over the last calculated
// interval when only locally originated errors are taken into account and externally originated
// errors were treated as success.
// This field should be interpretted only when
// :ref:`outlier_detection.split_external_local_origin_errors<envoy_api_field_cluster.OutlierDetection.split_external_local_origin_errors>`
// is *true*.
// See :ref:`Cluster outlier detection <arch_overview_outlier_detection>` documentation for
// details.
//
// Note: the message will not be present if host did not have enough request volume to calculate
// success rate or the cluster did not have enough hosts to run through success rate outlier
// ejection.
envoy.type.Percent local_origin_success_rate = 8;
}

// Health status for a host.
message HostHealthStatus {
// The host is currently failing active health checks.
bool failed_active_health_check = 1;

// The host is currently considered an outlier and has been ejected.
bool failed_outlier_check = 2;

// The host is currently being marked as degraded through active health checking.
bool failed_active_degraded_check = 4;

// The host has been removed from service discovery, but is being stabilized due to active
// health checking.
bool pending_dynamic_removal = 5;

// The host has not yet been health checked.
bool pending_active_hc = 6;

// Health status as reported by EDS. Note: only HEALTHY and UNHEALTHY are currently supported
// here.
// TODO(mrice32): pipe through remaining EDS health status possibilities.
envoy.api.v3alpha.core.HealthStatus eds_health_status = 3;
}
Loading

0 comments on commit 5c9cca4

Please sign in to comment.