diff --git a/Makefile b/Makefile index c8fb2c9899b..728cffe454e 100644 --- a/Makefile +++ b/Makefile @@ -166,7 +166,8 @@ ROUTING_V1ALPHA1_PB_GOS := $(ROUTING_V1ALPHA1_PROTOS:.proto=.pb.go) ROUTING_V1ALPHA2_DESTINATION_RULE_PROTO := $(ROUTING_V1ALPHA2)/destination_rule.proto ROUTING_V1ALPHA2_GATEWAY_PROTO := $(ROUTING_V1ALPHA2)/gateway.proto ROUTING_V1ALPHA2_ROUTE_PROTO := $(ROUTING_V1ALPHA2)/route_rule.proto -ROUTING_V1ALPHA2_PROTOS := $(ROUTING_V1ALPHA2_DESTINATION_RULE_PROTO) $(ROUTING_V1ALPHA2_GATEWAY_PROTO) $(ROUTING_V1ALPHA2_ROUTE_PROTO) +ROUTING_V1ALPHA2_FOREIGN_SERVICES_PROTO := $(ROUTING_V1ALPHA2)/foreign_services.proto +ROUTING_V1ALPHA2_PROTOS := $(ROUTING_V1ALPHA2_DESTINATION_RULE_PROTO) $(ROUTING_V1ALPHA2_GATEWAY_PROTO) $(ROUTING_V1ALPHA2_ROUTE_PROTO) $(ROUTING_V1ALPHA2_FOREIGN_SERVICES_PROTO) ROUTING_V1ALPHA2_PB_GOS := $(ROUTING_V1ALPHA2_PROTOS:.proto=.pb.go) ##################### diff --git a/routing/v1alpha2/destination_rule.pb.go b/routing/v1alpha2/destination_rule.pb.go index 48921b41306..39152df9227 100644 --- a/routing/v1alpha2/destination_rule.pb.go +++ b/routing/v1alpha2/destination_rule.pb.go @@ -8,6 +8,7 @@ It is generated from these files: routing/v1alpha2/destination_rule.proto routing/v1alpha2/gateway.proto routing/v1alpha2/route_rule.proto + routing/v1alpha2/foreign_services.proto It has these top-level messages: DestinationRule @@ -19,6 +20,7 @@ It has these top-level messages: TLSSettings Gateway Server + Port RouteRule Destination HTTPRoute @@ -33,6 +35,8 @@ It has these top-level messages: CorsPolicy HTTPFaultInjection PortSelector + ForeignServices + Service */ package istio_routing_v1alpha2 diff --git a/routing/v1alpha2/foreign_services.pb.go b/routing/v1alpha2/foreign_services.pb.go new file mode 100644 index 00000000000..807dea90792 --- /dev/null +++ b/routing/v1alpha2/foreign_services.pb.go @@ -0,0 +1,292 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: routing/v1alpha2/foreign_services.proto + +package istio_routing_v1alpha2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Different ways of discovering the IP addresses associated with the +// service. +type Service_Discovery int32 + +const ( + // If set to "none", the proxy will assume that incoming connections + // have already been resolved (to a specific destination IP + // address). Such connections are typically routed via the proxy using + // mechanisms such as IP table REDIRECT/ eBPF. After performing any + // routing related transformations, the proxy will forward the + // connection to the IP address to which the connection was bound. + Service_NONE Service_Discovery = 0 + // If set to "static", the proxy will use specified endpoints (See + // below) as the backing nodes associated with the foreign service. + Service_STATIC Service_Discovery = 1 + // If set to "dns", the proxy will attempt to resolve the DNS + // address during request processing. Use this mode if the set of + // resolved addresses change dynamically. The "dns" mode is applicable + // only when the hosts use exact DNS names without any wildcards. + Service_DNS Service_Discovery = 2 +) + +var Service_Discovery_name = map[int32]string{ + 0: "NONE", + 1: "STATIC", + 2: "DNS", +} +var Service_Discovery_value = map[string]int32{ + "NONE": 0, + "STATIC": 1, + "DNS": 2, +} + +func (x Service_Discovery) String() string { + return proto.EnumName(Service_Discovery_name, int32(x)) +} +func (Service_Discovery) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{1, 0} } + +// Service registry entries describe describe the endpoints, ports and +// protocols of a white-listed set of mesh-external domains and IP blocks +// that services in the mesh are allowed to access. +// +// NOTE 1: If a foreign service has the same name as a service in the +// service registry, the foreign service's declaration will be given +// precedence. +// +// NOTE 2: There can be ONLY ONE ForeignServices configuration for the +// entire mesh. +// +// For example, the following foreign services configuration describes the +// set of services at https://example.com. Eventhough the services behind +// example.com have to be accessed via HTTPS, in order for the application to +// obtain metrics from Istio, a plain text port (HTTP over port 80) is +// declared in addition to a secure port (HTTPS over 443). Connections +// arriving at port 443 on the sidecar will be treated as opaque TCP +// connections and will be forwarded as is to the destination, with limited +// visibility into the application flow. Connections arriving on port 80 on +// the sidecar will be able to take advantage of Istio's advanced routing +// and policy enforcement features. The associated routing rule ensures +// that outbound connections from the sidecar to the destination service +// happen over HTTPS. +// +// apiVersion: config.istio.io/v1alpha2 +// kind: ForeignServices +// metadata: +// name: foreign-svc +// spec: +// services: +// - hosts: +// - example.com +// ports: +// - number: 443 +// name: https +// protocol: HTTPS #treated as opaque TCP +// - number: 80 +// name: http +// protocol: HTTP +// discovery: none +// +// And the associated route rule +// +// apiVersion: config.istio.io/v1alpha2 +// kind: RouteRule +// metadata: +// name: my-foreign-rule +// spec: +// hosts: +// - example.com +// http: +// - match: +// - port: +// name: http +// route: +// - destination: +// name: example.com +// port: +// name: https +// +// Route rules can also be applied to services described in the +// ForeignServices resource. The following sample route rule rewrites +// /foocatalog to /barcatalog before forwarding the call to the intended +// destination. +// +// apiVersion: config.istio.io/v1alpha2 +// kind: RouteRule +// metadata: +// name: foo-rule +// spec: +// hosts: +// - example.com +// http: +// - match: +// - uri: +// prefix: /foocatalog +// rewrite: +// uri: /barcatalog +// +type ForeignServices struct { + // REQUIRED: A list of server specifications. + Services []*Service `protobuf:"bytes,1,rep,name=services" json:"services,omitempty"` +} + +func (m *ForeignServices) Reset() { *m = ForeignServices{} } +func (m *ForeignServices) String() string { return proto.CompactTextString(m) } +func (*ForeignServices) ProtoMessage() {} +func (*ForeignServices) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *ForeignServices) GetServices() []*Service { + if m != nil { + return m.Services + } + return nil +} + +// Service describes the endpoints, ports and protocols of the external +// service to be made accessible from within the mesh. For example, +// +// apiVersion: config.istio.io/v1alpha2 +// kind: ForeignServices +// metadata: +// name: foreign-svc +// spec: +// services: +// - hosts: +// - *.foo.com +// ports: +// - number: 80 +// protocol: HTTP2 +// name: http2 +// resolution: none +// - hosts: +// - 192.192.33.33/16 +// ports: +// - number: 27018 +// protocol: MONGO +// name: mongo +// resolution: none +// +type Service struct { + // REQUIRED. The hosts associated with the external service. Could be a + // DNS name with wildcard prefix or a CIDR prefix. Note that the hosts + // field applies to all protocols. + Hosts []string `protobuf:"bytes,1,rep,name=hosts" json:"hosts,omitempty"` + // REQUIRED: The Ports associated with the external services. + Ports []*Port `protobuf:"bytes,2,rep,name=ports" json:"ports,omitempty"` + // Service discovery mode for the hosts. + Resolution Service_Discovery `protobuf:"varint,3,opt,name=resolution,enum=istio.routing.v1alpha2.Service_Discovery" json:"resolution,omitempty"` + // One or more endpoints associated with the service. Endpoints are valid + // only when the discovery mode is set to "static". + Endpoints []*Service_Endpoint `protobuf:"bytes,4,rep,name=endpoints" json:"endpoints,omitempty"` +} + +func (m *Service) Reset() { *m = Service{} } +func (m *Service) String() string { return proto.CompactTextString(m) } +func (*Service) ProtoMessage() {} +func (*Service) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *Service) GetHosts() []string { + if m != nil { + return m.Hosts + } + return nil +} + +func (m *Service) GetPorts() []*Port { + if m != nil { + return m.Ports + } + return nil +} + +func (m *Service) GetResolution() Service_Discovery { + if m != nil { + return m.Resolution + } + return Service_NONE +} + +func (m *Service) GetEndpoints() []*Service_Endpoint { + if m != nil { + return m.Endpoints + } + return nil +} + +// Endpoint defines a network address (IP:port or hostname:port) +// associated with the foreign service. +type Service_Endpoint struct { + // REQUIRED: Address associated with the network endpoint ( IP or fully + // qualified domain name without wildcards). + Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + // The port on which the endpoint is listening for network connections. + Port *Port `protobuf:"bytes,2,opt,name=port" json:"port,omitempty"` + // One or more labels associated with the endpoint. + Labels map[string]string `protobuf:"bytes,3,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Service_Endpoint) Reset() { *m = Service_Endpoint{} } +func (m *Service_Endpoint) String() string { return proto.CompactTextString(m) } +func (*Service_Endpoint) ProtoMessage() {} +func (*Service_Endpoint) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1, 0} } + +func (m *Service_Endpoint) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Service_Endpoint) GetPort() *Port { + if m != nil { + return m.Port + } + return nil +} + +func (m *Service_Endpoint) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func init() { + proto.RegisterType((*ForeignServices)(nil), "istio.routing.v1alpha2.ForeignServices") + proto.RegisterType((*Service)(nil), "istio.routing.v1alpha2.Service") + proto.RegisterType((*Service_Endpoint)(nil), "istio.routing.v1alpha2.Service.Endpoint") + proto.RegisterEnum("istio.routing.v1alpha2.Service_Discovery", Service_Discovery_name, Service_Discovery_value) +} + +func init() { proto.RegisterFile("routing/v1alpha2/foreign_services.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 363 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4d, 0x4b, 0xeb, 0x40, + 0x14, 0x86, 0x6f, 0x92, 0x7e, 0xe5, 0x14, 0xee, 0x0d, 0xc3, 0xe5, 0x12, 0xca, 0x45, 0x4b, 0x37, + 0x46, 0x17, 0xa9, 0x46, 0x17, 0x7e, 0xac, 0xc4, 0xb6, 0x50, 0x28, 0x51, 0xa6, 0xdd, 0x4b, 0xda, + 0x8e, 0xed, 0x60, 0xc8, 0x84, 0x99, 0x69, 0x24, 0xbf, 0xd6, 0x3f, 0xe1, 0x0f, 0x90, 0x4c, 0x26, + 0xb5, 0xa0, 0x52, 0x77, 0x39, 0x87, 0xf7, 0x79, 0x78, 0x4f, 0x12, 0x38, 0xe2, 0x6c, 0x23, 0x69, + 0xb2, 0xea, 0x67, 0x67, 0x51, 0x9c, 0xae, 0xa3, 0xa0, 0xff, 0xc4, 0x38, 0xa1, 0xab, 0xe4, 0x51, + 0x10, 0x9e, 0xd1, 0x05, 0x11, 0x7e, 0xca, 0x99, 0x64, 0xe8, 0x1f, 0x15, 0x92, 0x32, 0x5f, 0xc7, + 0xfd, 0x2a, 0xde, 0x39, 0xf8, 0x24, 0x58, 0x45, 0x92, 0xbc, 0x44, 0x79, 0xc9, 0xf5, 0x42, 0xf8, + 0x33, 0x2a, 0x8d, 0x53, 0x2d, 0x44, 0x37, 0xd0, 0xaa, 0xe4, 0xae, 0xd1, 0xb5, 0xbc, 0x76, 0x70, + 0xe8, 0x7f, 0x6d, 0xf7, 0x35, 0x83, 0xb7, 0x40, 0xef, 0xcd, 0x82, 0xa6, 0xde, 0xa2, 0xbf, 0x50, + 0x5f, 0x33, 0x21, 0x4b, 0x8b, 0x8d, 0xcb, 0x01, 0x05, 0x50, 0x4f, 0x19, 0x97, 0xc2, 0x35, 0x95, + 0xfb, 0xff, 0x77, 0xee, 0x07, 0xc6, 0x25, 0x2e, 0xa3, 0x68, 0x0c, 0xc0, 0x89, 0x60, 0xf1, 0x46, + 0x52, 0x96, 0xb8, 0x56, 0xd7, 0xf0, 0x7e, 0x07, 0xc7, 0x7b, 0x4a, 0xf9, 0x03, 0x2a, 0x16, 0x2c, + 0x23, 0x3c, 0xc7, 0x3b, 0x30, 0x1a, 0x81, 0x4d, 0x92, 0x65, 0xca, 0x68, 0x22, 0x85, 0x5b, 0x53, + 0x15, 0xbc, 0x7d, 0xa6, 0xa1, 0x06, 0xf0, 0x07, 0xda, 0x79, 0x35, 0xa0, 0x55, 0xed, 0x91, 0x0b, + 0xcd, 0x68, 0xb9, 0xe4, 0x44, 0x14, 0xb7, 0x1a, 0x9e, 0x8d, 0xab, 0x11, 0x9d, 0x42, 0xad, 0x38, + 0xc1, 0x35, 0xbb, 0xc6, 0xde, 0x63, 0x55, 0x12, 0x4d, 0xa0, 0x11, 0x47, 0x73, 0x12, 0x0b, 0xd7, + 0x52, 0xed, 0x2e, 0x7e, 0xda, 0xce, 0x9f, 0x28, 0x6c, 0x98, 0x48, 0x9e, 0x63, 0xed, 0xe8, 0x5c, + 0x41, 0x7b, 0x67, 0x8d, 0x1c, 0xb0, 0x9e, 0x49, 0xae, 0x4b, 0x16, 0x8f, 0xc5, 0x47, 0xca, 0xa2, + 0x78, 0x43, 0x54, 0x43, 0x1b, 0x97, 0xc3, 0xb5, 0x79, 0x69, 0xf4, 0x4e, 0xc0, 0xde, 0xbe, 0x42, + 0xd4, 0x82, 0x5a, 0x78, 0x1f, 0x0e, 0x9d, 0x5f, 0x08, 0xa0, 0x31, 0x9d, 0xdd, 0xce, 0xc6, 0x77, + 0x8e, 0x81, 0x9a, 0x60, 0x0d, 0xc2, 0xa9, 0x63, 0xce, 0x1b, 0xea, 0x6f, 0x3a, 0x7f, 0x0f, 0x00, + 0x00, 0xff, 0xff, 0x74, 0xe7, 0x07, 0x46, 0xb0, 0x02, 0x00, 0x00, +} diff --git a/routing/v1alpha2/foreign_services.proto b/routing/v1alpha2/foreign_services.proto new file mode 100644 index 00000000000..9e0163c4c63 --- /dev/null +++ b/routing/v1alpha2/foreign_services.proto @@ -0,0 +1,180 @@ +// Copyright 2018 Istio Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "routing/v1alpha2/gateway.proto"; + +package istio.routing.v1alpha2; + +// Service registry entries describe describe the endpoints, ports and +// protocols of a white-listed set of mesh-external domains and IP blocks +// that services in the mesh are allowed to access. +// +// NOTE 1: If a foreign service has the same name as a service in the +// service registry, the foreign service's declaration will be given +// precedence. +// +// NOTE 2: There can be ONLY ONE ForeignServices configuration for the +// entire mesh. +// +// For example, the following foreign services configuration describes the +// set of services at https://example.com. Eventhough the services behind +// example.com have to be accessed via HTTPS, in order for the application to +// obtain metrics from Istio, a plain text port (HTTP over port 80) is +// declared in addition to a secure port (HTTPS over 443). Connections +// arriving at port 443 on the sidecar will be treated as opaque TCP +// connections and will be forwarded as is to the destination, with limited +// visibility into the application flow. Connections arriving on port 80 on +// the sidecar will be able to take advantage of Istio's advanced routing +// and policy enforcement features. The associated routing rule ensures +// that outbound connections from the sidecar to the destination service +// happen over HTTPS. +// +// apiVersion: config.istio.io/v1alpha2 +// kind: ForeignServices +// metadata: +// name: foreign-svc +// spec: +// services: +// - hosts: +// - example.com +// ports: +// - number: 443 +// name: https +// protocol: HTTPS #treated as opaque TCP +// - number: 80 +// name: http +// protocol: HTTP +// discovery: none +// +// And the associated route rule +// +// apiVersion: config.istio.io/v1alpha2 +// kind: RouteRule +// metadata: +// name: my-foreign-rule +// spec: +// hosts: +// - example.com +// http: +// - match: +// - port: +// name: http +// route: +// - destination: +// name: example.com +// port: +// name: https +// +// Route rules can also be applied to services described in the +// ForeignServices resource. The following sample route rule rewrites +// /foocatalog to /barcatalog before forwarding the call to the intended +// destination. +// +// apiVersion: config.istio.io/v1alpha2 +// kind: RouteRule +// metadata: +// name: foo-rule +// spec: +// hosts: +// - example.com +// http: +// - match: +// - uri: +// prefix: /foocatalog +// rewrite: +// uri: /barcatalog +// +message ForeignServices { + // REQUIRED: A list of server specifications. + repeated Service services = 1; +} + +// Service describes the endpoints, ports and protocols of the external +// service to be made accessible from within the mesh. For example, +// +// apiVersion: config.istio.io/v1alpha2 +// kind: ForeignServices +// metadata: +// name: foreign-svc +// spec: +// services: +// - hosts: +// - *.foo.com +// ports: +// - number: 80 +// protocol: HTTP2 +// name: http2 +// resolution: none +// - hosts: +// - 192.192.33.33/16 +// ports: +// - number: 27018 +// protocol: MONGO +// name: mongo +// resolution: none +// +message Service { + // REQUIRED. The hosts associated with the external service. Could be a + // DNS name with wildcard prefix or a CIDR prefix. Note that the hosts + // field applies to all protocols. + repeated string hosts = 1; + + // REQUIRED: The Ports associated with the external services. + repeated Port ports = 2; + + // Different ways of discovering the IP addresses associated with the + // service. + enum Discovery { + // If set to "none", the proxy will assume that incoming connections + // have already been resolved (to a specific destination IP + // address). Such connections are typically routed via the proxy using + // mechanisms such as IP table REDIRECT/ eBPF. After performing any + // routing related transformations, the proxy will forward the + // connection to the IP address to which the connection was bound. + NONE = 0; + + // If set to "static", the proxy will use specified endpoints (See + // below) as the backing nodes associated with the foreign service. + STATIC = 1; + + // If set to "dns", the proxy will attempt to resolve the DNS + // address during request processing. Use this mode if the set of + // resolved addresses change dynamically. The "dns" mode is applicable + // only when the hosts use exact DNS names without any wildcards. + DNS = 2; + }; + + // Service discovery mode for the hosts. + Discovery resolution = 3; + + // Endpoint defines a network address (IP:port or hostname:port) + // associated with the foreign service. + message Endpoint { + // REQUIRED: Address associated with the network endpoint ( IP or fully + // qualified domain name without wildcards). + string address = 1; + + // The port on which the endpoint is listening for network connections. + Port port = 2; + + // One or more labels associated with the endpoint. + map labels = 3; + }; + + // One or more endpoints associated with the service. Endpoints are valid + // only when the discovery mode is set to "static". + repeated Endpoint endpoints = 4; +} diff --git a/routing/v1alpha2/gateway.pb.go b/routing/v1alpha2/gateway.pb.go index 9cf88b56a3e..ca572c1610b 100644 --- a/routing/v1alpha2/gateway.pb.go +++ b/routing/v1alpha2/gateway.pb.go @@ -44,7 +44,7 @@ func (x Server_TLSOptions_TLSmode) String() string { return proto.EnumName(Server_TLSOptions_TLSmode_name, int32(x)) } func (Server_TLSOptions_TLSmode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor1, []int{1, 1, 0} + return fileDescriptor1, []int{1, 0, 0} } // Gateway describes a load balancer operating at the edge of the mesh @@ -225,7 +225,7 @@ func (m *Gateway) GetServers() []*Server { type Server struct { // REQUIRED: The Port on which the proxy should listen for incoming // connections - Port *Server_Port `protobuf:"bytes,1,opt,name=port" json:"port,omitempty"` + Port *Port `protobuf:"bytes,1,opt,name=port" json:"port,omitempty"` // A list of hosts exposed by this gateway. While // typically applicable to HTTP services, it can also be used for TCP // services using TLS with SNI. Standard DNS wildcard prefix syntax @@ -247,7 +247,7 @@ func (m *Server) String() string { return proto.CompactTextString(m) func (*Server) ProtoMessage() {} func (*Server) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } -func (m *Server) GetPort() *Server_Port { +func (m *Server) GetPort() *Port { if m != nil { return m.Port } @@ -268,43 +268,6 @@ func (m *Server) GetTls() *Server_TLSOptions { return nil } -// Port describes the properties of a specific port of a service. -type Server_Port struct { - // REQUIRED: A valid non-negative integer port number. - Number uint32 `protobuf:"varint,1,opt,name=number" json:"number,omitempty"` - // The protocol exposed on the port. - // MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP. - Protocol string `protobuf:"bytes,2,opt,name=protocol" json:"protocol,omitempty"` - // Label assigned to the port. - Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` -} - -func (m *Server_Port) Reset() { *m = Server_Port{} } -func (m *Server_Port) String() string { return proto.CompactTextString(m) } -func (*Server_Port) ProtoMessage() {} -func (*Server_Port) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 0} } - -func (m *Server_Port) GetNumber() uint32 { - if m != nil { - return m.Number - } - return 0 -} - -func (m *Server_Port) GetProtocol() string { - if m != nil { - return m.Protocol - } - return "" -} - -func (m *Server_Port) GetName() string { - if m != nil { - return m.Name - } - return "" -} - type Server_TLSOptions struct { // If set to true, the load balancer will send a 302 redirect for all // http connections, asking the clients to use HTTPS. @@ -331,7 +294,7 @@ type Server_TLSOptions struct { func (m *Server_TLSOptions) Reset() { *m = Server_TLSOptions{} } func (m *Server_TLSOptions) String() string { return proto.CompactTextString(m) } func (*Server_TLSOptions) ProtoMessage() {} -func (*Server_TLSOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 1} } +func (*Server_TLSOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 0} } func (m *Server_TLSOptions) GetHttpsRedirect() bool { if m != nil { @@ -375,43 +338,80 @@ func (m *Server_TLSOptions) GetSubjectAltNames() []string { return nil } +// Port describes the properties of a specific port of a service. +type Port struct { + // REQUIRED: A valid non-negative integer port number. + Number uint32 `protobuf:"varint,1,opt,name=number" json:"number,omitempty"` + // The protocol exposed on the port. + // MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP. + Protocol string `protobuf:"bytes,2,opt,name=protocol" json:"protocol,omitempty"` + // Label assigned to the port. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` +} + +func (m *Port) Reset() { *m = Port{} } +func (m *Port) String() string { return proto.CompactTextString(m) } +func (*Port) ProtoMessage() {} +func (*Port) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *Port) GetNumber() uint32 { + if m != nil { + return m.Number + } + return 0 +} + +func (m *Port) GetProtocol() string { + if m != nil { + return m.Protocol + } + return "" +} + +func (m *Port) GetName() string { + if m != nil { + return m.Name + } + return "" +} + func init() { proto.RegisterType((*Gateway)(nil), "istio.routing.v1alpha2.Gateway") proto.RegisterType((*Server)(nil), "istio.routing.v1alpha2.Server") - proto.RegisterType((*Server_Port)(nil), "istio.routing.v1alpha2.Server.Port") proto.RegisterType((*Server_TLSOptions)(nil), "istio.routing.v1alpha2.Server.TLSOptions") + proto.RegisterType((*Port)(nil), "istio.routing.v1alpha2.Port") proto.RegisterEnum("istio.routing.v1alpha2.Server_TLSOptions_TLSmode", Server_TLSOptions_TLSmode_name, Server_TLSOptions_TLSmode_value) } func init() { proto.RegisterFile("routing/v1alpha2/gateway.proto", fileDescriptor1) } var fileDescriptor1 = []byte{ - // 419 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xc5, 0x89, 0xeb, 0x34, 0x13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c, 0xf9, 0x66, 0x32, 0xbe, 0xec, 0x7a, 0x45, 0x7d, 0x33, 0x9b, 0xce, 0x46, 0xe3, 0x6e, - 0x6d, 0x1e, 0xb8, 0xcc, 0xdf, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x34, 0x26, 0xf9, 0xad, 0xc2, - 0x02, 0x00, 0x00, + // 421 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0x71, 0xec, 0x3a, 0xcd, 0x44, 0x4d, 0xd2, 0x11, 0xaa, 0x56, 0x15, 0x2a, 0x51, 0x24, + 0x44, 0x40, 0xc2, 0xa5, 0xe6, 0x82, 0xc4, 0x29, 0xaa, 0xaa, 0x16, 0x91, 0xb6, 0xd1, 0x3a, 0x39, + 0x5b, 0x1b, 0x77, 0x69, 0x16, 0x9c, 0xac, 0xb5, 0x3b, 0x09, 0xca, 0x73, 0xf2, 0x08, 0xbc, 0x08, + 0xf2, 0xda, 0xa5, 0x39, 0x00, 0xea, 0x6d, 0xe6, 0x9f, 0x6f, 0xc6, 0xbf, 0x7f, 0x1b, 0x4e, 0x8c, + 0x5e, 0x93, 0x5a, 0xdd, 0x9f, 0x6e, 0xce, 0x44, 0x5e, 0x2c, 0x44, 0x7c, 0x7a, 0x2f, 0x48, 0xfe, + 0x10, 0xdb, 0xa8, 0x30, 0x9a, 0x34, 0x1e, 0x29, 0x4b, 0x4a, 0x47, 0x35, 0x15, 0x3d, 0x50, 0x83, + 0x73, 0x68, 0x5e, 0x56, 0x20, 0x7e, 0x84, 0xa6, 0x95, 0x66, 0x23, 0x8d, 0x65, 0x5e, 0xdf, 0x1f, + 0xb6, 0xe3, 0x93, 0xe8, 0xef, 0x4b, 0x51, 0xe2, 0x30, 0xfe, 0x80, 0x0f, 0x7e, 0xf9, 0x10, 0x56, + 0x1a, 0xbe, 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 0x18, 0x9a, 0xb5, 0x6b, 0xec, 0x42, 0x7b, 0x32, + 0x4a, 0x92, 0xe9, 0x15, 0xbf, 0x9d, 0x5d, 0x5e, 0xf5, 0x9e, 0x21, 0x40, 0x98, 0x7c, 0xbe, 0x9e, + 0x8c, 0x2f, 0x7a, 0x5e, 0x59, 0x5f, 0xcf, 0xa6, 0xb3, 0xd1, 0xb8, 0xd7, 0x18, 0xdc, 0x40, 0x50, + 0x7e, 0x36, 0x3c, 0x82, 0x70, 0xb5, 0x5e, 0xce, 0xa5, 0x71, 0x31, 0x1e, 0xf0, 0xba, 0xc3, 0x63, + 0xd8, 0x77, 0xff, 0x5a, 0xa6, 0x73, 0x97, 0x61, 0x8b, 0xff, 0xe9, 0x11, 0x21, 0x28, 0xfd, 0xd4, + 0x31, 0xb8, 0x7a, 0x1e, 0xba, 0xe9, 0x87, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x29, 0x94, 0x82, + 0x90, 0xbb, 0x02, 0x00, 0x00, } diff --git a/routing/v1alpha2/gateway.proto b/routing/v1alpha2/gateway.proto index 60e3af64d80..c3a02ef976d 100644 --- a/routing/v1alpha2/gateway.proto +++ b/routing/v1alpha2/gateway.proto @@ -180,19 +180,6 @@ message Gateway { // privateKey: /etc/certs/privatekey.pem // message Server { - // Port describes the properties of a specific port of a service. - message Port { - // REQUIRED: A valid non-negative integer port number. - uint32 number = 1; - - // The protocol exposed on the port. - // MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP. - string protocol = 2; - - // Label assigned to the port. - string name = 3; - } - // REQUIRED: The Port on which the proxy should listen for incoming // connections Port port = 1; @@ -258,3 +245,16 @@ message Server { // https, and the TLS modes to use. TLSOptions tls = 3; } + +// Port describes the properties of a specific port of a service. +message Port { + // REQUIRED: A valid non-negative integer port number. + uint32 number = 1; + + // The protocol exposed on the port. + // MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP. + string protocol = 2; + + // Label assigned to the port. + string name = 3; +}