Documentation ¶
Index ¶
- Constants
- Variables
- func VirtualServiceName(fqdn string) string
- type BulkSync
- type BulkSyncSpec
- type HTTPMatchRequest
- type HTTPPrefixMatch
- type HTTPRoute
- type HTTPRouteDestination
- type K8sResource
- type K8sResourceBuilder
- type Lineage
- type Selector
- type Service
- type ServiceBuilder
- type ServicePort
- type ServiceSpec
- type SyncHandler
- type SyncRequest
- type SyncResponse
- type Template
- type VirtualService
- type VirtualServiceBuilder
- type VirtualServiceDestination
- type VirtualServiceHeaderOperations
- type VirtualServiceHeaders
- type VirtualServiceSpec
Constants ¶
View Source
const IstioExpectedWeight = int(100)
Istio destination weights are percentage based and must sum to 100% https://istio.io/docs/concepts/traffic-management/
View Source
const MeshInternalGateway = "mesh"
"mesh" is a special reserved word on Istio VirtualServices https://istio.io/docs/reference/config/networking/v1alpha3/virtual-service/#VirtualService
Variables ¶
View Source
var UninitializedError = errors.New("uninitialized: have not yet synchronized with cloud controller")
Functions ¶
func VirtualServiceName ¶
virtual service names cannot contain special characters
Types ¶
type BulkSync ¶
type BulkSync struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` Spec BulkSyncSpec `json:"spec"` }
BulkSync is an operator-facing configuration for syncing routes from CC into K8s
type BulkSyncSpec ¶
type HTTPMatchRequest ¶
type HTTPMatchRequest struct {
Uri HTTPPrefixMatch `json:"uri"`
}
type HTTPPrefixMatch ¶
type HTTPPrefixMatch struct {
Prefix string `json:"prefix"`
}
type HTTPRoute ¶
type HTTPRoute struct { Match []HTTPMatchRequest `json:"match,omitempty"` Route []HTTPRouteDestination `json:"route,omitempty"` }
type HTTPRouteDestination ¶
type HTTPRouteDestination struct { Destination VirtualServiceDestination `json:"destination"` Headers VirtualServiceHeaders `json:"headers,omitempty"` Weight *int `json:"weight,omitempty"` }
type K8sResource ¶
type K8sResource interface{}
type K8sResourceBuilder ¶
type K8sResourceBuilder interface {
Build([]models.Route, Template) []K8sResource
}
type Lineage ¶
type Lineage struct { RouteSnapshotRepo snapshotRepo K8sResourceBuilders []K8sResourceBuilder }
func (*Lineage) Sync ¶
func (m *Lineage) Sync(syncRequest SyncRequest) (*SyncResponse, error)
Sync generates child resources for a metacontroller /sync request
type Service ¶
type Service struct { ApiVersion string `json:"apiVersion"` Kind string `json:"kind"` metav1.ObjectMeta `json:"metadata"` Spec ServiceSpec `json:"spec"` }
type ServiceBuilder ¶
type ServiceBuilder struct{}
func (*ServiceBuilder) Build ¶
func (b *ServiceBuilder) Build(routes []models.Route, template Template) []K8sResource
type ServicePort ¶
type ServiceSpec ¶
type ServiceSpec struct { Selector map[string]string `json:"selector"` Ports []ServicePort `json:"ports"` }
type SyncHandler ¶
type SyncHandler struct { Marshaler marshal.Marshaler Unmarshaler marshal.Unmarshaler Syncer syncer }
func (*SyncHandler) ServeHTTP ¶
func (r *SyncHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP serves the /sync webhook to metacontroller
type SyncRequest ¶
type SyncRequest struct {
Parent BulkSync `json:"parent"`
}
type SyncResponse ¶
type SyncResponse struct {
Children []K8sResource `json:"children"`
}
type Template ¶
type Template struct {
metav1.ObjectMeta `json:"metadata"`
}
type VirtualService ¶
type VirtualService struct { ApiVersion string `json:"apiVersion"` Kind string `json:"kind"` metav1.ObjectMeta `json:"metadata"` Spec VirtualServiceSpec `json:"spec"` }
type VirtualServiceBuilder ¶
type VirtualServiceBuilder struct {
IstioGateways []string
}
func (*VirtualServiceBuilder) Build ¶
func (b *VirtualServiceBuilder) Build(routes []models.Route, template Template) []K8sResource
type VirtualServiceDestination ¶
type VirtualServiceDestination struct {
Host string `json:"host"`
}
type VirtualServiceHeaders ¶
type VirtualServiceHeaders struct { Request VirtualServiceHeaderOperations `json:"request,omitempty"` Response VirtualServiceHeaderOperations `json:"response,omitempty"` }
type VirtualServiceSpec ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.