Documentation ¶
Overview ¶
Package resources holds simple functions for synthesizing child resources from an Ingress resource and any relevant Ingress controller configuration.
Index ¶
- func ComputeIngressHash(ia v1alpha1.IngressAccessor) ([16]byte, error)
- func GatewayName(accessor kmeta.Accessor, gatewaySvc *corev1.Service) string
- func GetHTTPServer(gateway *v1alpha3.Gateway) *v1alpha3.Server
- func GetSecrets(ia v1alpha1.IngressAccessor, secretLister corev1listers.SecretLister) (map[string]*corev1.Secret, error)
- func GetServers(gateway *v1alpha3.Gateway, ia v1alpha1.IngressAccessor) []v1alpha3.Server
- func HostsPerGateway(ia v1alpha1.IngressAccessor, ...) map[string][]string
- func InsertProbe(ia v1alpha1.IngressAccessor) (string, error)
- func MakeHTTPServer(httpProtocol network.HTTPProtocol, hosts []string) *v1alpha3.Server
- func MakeIngressGateways(ctx context.Context, ia v1alpha1.IngressAccessor, ...) ([]*v1alpha3.Gateway, error)
- func MakeIngressVirtualService(ia v1alpha1.IngressAccessor, ...) *v1alpha3.VirtualService
- func MakeMeshVirtualService(ia v1alpha1.IngressAccessor) *v1alpha3.VirtualService
- func MakeSecrets(ctx context.Context, originSecrets map[string]*corev1.Secret, ...) ([]*corev1.Secret, error)
- func MakeTLSServers(ia v1alpha1.IngressAccessor, gatewayServiceNamespace string, ...) ([]v1alpha3.Server, error)
- func MakeVirtualServices(ia v1alpha1.IngressAccessor, ...) ([]*v1alpha3.VirtualService, error)
- func SecretRef(namespace, name string) corev1.ObjectReference
- func ServiceNamespaceFromURL(svc string) (string, error)
- func SortServers(servers []v1alpha3.Server) []v1alpha3.Server
- func UpdateGateway(gateway *v1alpha3.Gateway, want []v1alpha3.Server, existing []v1alpha3.Server) *v1alpha3.Gateway
- func VirtualServiceNamespace(ia v1alpha1.IngressAccessor) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeIngressHash ¶ added in v0.10.0
func ComputeIngressHash(ia v1alpha1.IngressAccessor) ([16]byte, error)
ComputeIngressHash computes a hash of the Ingress Spec, Namespace and Name
func GatewayName ¶ added in v0.8.0
GatewayName create a name for the Gateway that is built based on the given IngressAccessor and bonds to the given ingress gateway service.
func GetHTTPServer ¶
GetHTTPServer gets the HTTP `Server` from `Gateway`.
func GetSecrets ¶
func GetSecrets(ia v1alpha1.IngressAccessor, secretLister corev1listers.SecretLister) (map[string]*corev1.Secret, error)
GetSecrets gets the all of the secrets referenced by the given Ingress, and returns a map whose key is the a secret namespace/name key and value is pointer of the secret.
func GetServers ¶
GetServers gets the `Servers` from `Gateway` that belongs to the given Ingress.
func HostsPerGateway ¶ added in v0.10.0
func HostsPerGateway(ia v1alpha1.IngressAccessor, gateways map[v1alpha1.IngressVisibility]sets.String) map[string][]string
HostsPerGateway returns the set of hosts that each Gateway handles
func InsertProbe ¶ added in v0.8.0
func InsertProbe(ia v1alpha1.IngressAccessor) (string, error)
InsertProbe adds a AppendHeader rule so that any request going through a Gateway is tagged with the version of the Ingress currently deployed on the Gateway.
func MakeHTTPServer ¶
func MakeHTTPServer(httpProtocol network.HTTPProtocol, hosts []string) *v1alpha3.Server
MakeHTTPServer creates a HTTP Gateway `Server` based on the HTTPProtocol configureation.
func MakeIngressGateways ¶ added in v0.8.0
func MakeIngressGateways(ctx context.Context, ia v1alpha1.IngressAccessor, originSecrets map[string]*corev1.Secret, svcLister corev1listers.ServiceLister) ([]*v1alpha3.Gateway, error)
MakeIngressGateways creates Gateways for a given IngressAccessor.
func MakeIngressVirtualService ¶
func MakeIngressVirtualService(ia v1alpha1.IngressAccessor, gateways map[v1alpha1.IngressVisibility]sets.String) *v1alpha3.VirtualService
MakeIngressVirtualService creates Istio VirtualService as network programming for Istio Gateways other than 'mesh'.
func MakeMeshVirtualService ¶
func MakeMeshVirtualService(ia v1alpha1.IngressAccessor) *v1alpha3.VirtualService
MakeMeshVirtualService creates a mesh Virtual Service
func MakeSecrets ¶
func MakeSecrets(ctx context.Context, originSecrets map[string]*corev1.Secret, accessor kmeta.OwnerRefableAccessor) ([]*corev1.Secret, error)
MakeSecrets makes copies of the origin Secrets under the namespace of Istio gateway service.
func MakeTLSServers ¶ added in v0.8.0
func MakeTLSServers(ia v1alpha1.IngressAccessor, gatewayServiceNamespace string, originSecrets map[string]*corev1.Secret) ([]v1alpha3.Server, error)
MakeTLSServers creates the expected Gateway TLS `Servers` based on the given IngressAccessor.
func MakeVirtualServices ¶
func MakeVirtualServices(ia v1alpha1.IngressAccessor, gateways map[v1alpha1.IngressVisibility]sets.String) ([]*v1alpha3.VirtualService, error)
MakeVirtualServices creates a mesh virtualservice and a virtual service for each gateway
func SecretRef ¶
func SecretRef(namespace, name string) corev1.ObjectReference
SecretRef returns the ObjectReference of a secret given the namespace and name of the secret.
func ServiceNamespaceFromURL ¶ added in v0.8.0
ServiceNamespaceFromURL extracts the namespace part from the service URL. TODO(nghia): Remove this by parsing at config parsing time.
func SortServers ¶
SortServers sorts `Server` according to its port name.
func UpdateGateway ¶
func UpdateGateway(gateway *v1alpha3.Gateway, want []v1alpha3.Server, existing []v1alpha3.Server) *v1alpha3.Gateway
UpdateGateway replaces the existing servers with the wanted servers.
func VirtualServiceNamespace ¶
func VirtualServiceNamespace(ia v1alpha1.IngressAccessor) string
VirtualServiceNamespace gives the namespace of the child VirtualServices for a given Ingress.
Types ¶
This section is empty.