istio

package
v1.1.0-beta29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Definitions for Output Snapshots

Index

Constants

This section is empty.

Variables

View Source
var MissingRequiredLabelError = func(labelKey, resourceKind string, obj ezkube.ResourceId) error {
	return eris.Errorf("expected label %v not on labels of %v %v", labelKey, resourceKind, sets.Key(obj))
}

this error can occur if constructing a Partitioned Snapshot from a resource that is missing the partition label

View Source
var SnapshotGVKs = []schema.GroupVersionKind{

	schema.GroupVersionKind{
		Group:   "certificates.mesh.gloo.solo.io",
		Version: "v1",
		Kind:    "IssuedCertificate",
	},
	schema.GroupVersionKind{
		Group:   "certificates.mesh.gloo.solo.io",
		Version: "v1",
		Kind:    "PodBounceDirective",
	},

	schema.GroupVersionKind{
		Group:   "xds.agent.enterprise.mesh.gloo.solo.io",
		Version: "v1beta1",
		Kind:    "XdsConfig",
	},

	schema.GroupVersionKind{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
		Kind:    "DestinationRule",
	},
	schema.GroupVersionKind{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
		Kind:    "EnvoyFilter",
	},
	schema.GroupVersionKind{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
		Kind:    "Gateway",
	},
	schema.GroupVersionKind{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
		Kind:    "ServiceEntry",
	},
	schema.GroupVersionKind{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
		Kind:    "VirtualService",
	},
	schema.GroupVersionKind{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
		Kind:    "Sidecar",
	},

	schema.GroupVersionKind{
		Group:   "security.istio.io",
		Version: "v1beta1",
		Kind:    "AuthorizationPolicy",
	},

	schema.GroupVersionKind{
		Group:   "ratelimit.solo.io",
		Version: "v1alpha1",
		Kind:    "RateLimitConfig",
	},
}

SnapshotGVKs is a list of the GVKs included in this snapshot

Functions

func NewBuilder

func NewBuilder(ctx context.Context, name string) *builder

Types

type Builder

type Builder interface {

	// add IssuedCertificates to the collected outputs
	AddIssuedCertificates(issuedCertificates ...*certificates_mesh_gloo_solo_io_v1.IssuedCertificate)

	// get the collected IssuedCertificates
	GetIssuedCertificates() certificates_mesh_gloo_solo_io_v1_sets.IssuedCertificateSet

	// add PodBounceDirectives to the collected outputs
	AddPodBounceDirectives(podBounceDirectives ...*certificates_mesh_gloo_solo_io_v1.PodBounceDirective)

	// get the collected PodBounceDirectives
	GetPodBounceDirectives() certificates_mesh_gloo_solo_io_v1_sets.PodBounceDirectiveSet

	// add XdsConfigs to the collected outputs
	AddXdsConfigs(xdsConfigs ...*xds_agent_enterprise_mesh_gloo_solo_io_v1beta1.XdsConfig)

	// get the collected XdsConfigs
	GetXdsConfigs() xds_agent_enterprise_mesh_gloo_solo_io_v1beta1_sets.XdsConfigSet

	// add DestinationRules to the collected outputs
	AddDestinationRules(destinationRules ...*networking_istio_io_v1alpha3.DestinationRule)

	// get the collected DestinationRules
	GetDestinationRules() networking_istio_io_v1alpha3_sets.DestinationRuleSet

	// add EnvoyFilters to the collected outputs
	AddEnvoyFilters(envoyFilters ...*networking_istio_io_v1alpha3.EnvoyFilter)

	// get the collected EnvoyFilters
	GetEnvoyFilters() networking_istio_io_v1alpha3_sets.EnvoyFilterSet

	// add Gateways to the collected outputs
	AddGateways(gateways ...*networking_istio_io_v1alpha3.Gateway)

	// get the collected Gateways
	GetGateways() networking_istio_io_v1alpha3_sets.GatewaySet

	// add ServiceEntries to the collected outputs
	AddServiceEntries(serviceEntries ...*networking_istio_io_v1alpha3.ServiceEntry)

	// get the collected ServiceEntries
	GetServiceEntries() networking_istio_io_v1alpha3_sets.ServiceEntrySet

	// add VirtualServices to the collected outputs
	AddVirtualServices(virtualServices ...*networking_istio_io_v1alpha3.VirtualService)

	// get the collected VirtualServices
	GetVirtualServices() networking_istio_io_v1alpha3_sets.VirtualServiceSet

	// add Sidecars to the collected outputs
	AddSidecars(sidecars ...*networking_istio_io_v1alpha3.Sidecar)

	// get the collected Sidecars
	GetSidecars() networking_istio_io_v1alpha3_sets.SidecarSet

	// add AuthorizationPolicies to the collected outputs
	AddAuthorizationPolicies(authorizationPolicies ...*security_istio_io_v1beta1.AuthorizationPolicy)

	// get the collected AuthorizationPolicies
	GetAuthorizationPolicies() security_istio_io_v1beta1_sets.AuthorizationPolicySet

	// add RateLimitConfigs to the collected outputs
	AddRateLimitConfigs(rateLimitConfigs ...*ratelimit_solo_io_v1alpha1.RateLimitConfig)

	// get the collected RateLimitConfigs
	GetRateLimitConfigs() ratelimit_solo_io_v1alpha1_sets.RateLimitConfigSet

	// build the collected outputs into a label-partitioned snapshot
	BuildLabelPartitionedSnapshot(labelKey string) (Snapshot, error)

	// build the collected outputs into a snapshot with a single partition
	BuildSinglePartitionedSnapshot(snapshotLabels map[string]string) (Snapshot, error)

	// add a cluster to the collected clusters.
	// this can be used to collect clusters for use with MultiCluster snapshots.
	AddCluster(cluster string)

	// returns the set of clusters currently stored in this builder
	Clusters() []string

	// merge all the resources from another Builder into this one
	Merge(other Builder)

	// create a clone of this builder (deepcopying all resources)
	Clone() Builder

	// convert this snapshot to its generic form
	Generic() resource.ClusterSnapshot

	// iterate over the objects contained in the snapshot
	ForEachObject(handleObject func(cluster string, gvk schema.GroupVersionKind, obj resource.TypedObject))
}

the output Builder uses a builder pattern to allow iteratively collecting outputs before producing a final snapshot

type LabeledAuthorizationPolicySet

type LabeledAuthorizationPolicySet interface {
	// returns the set of Labels shared by this AuthorizationPolicySet
	Labels() map[string]string

	// returns the set of AuthorizationPolicyes with the given labels
	Set() security_istio_io_v1beta1_sets.AuthorizationPolicySet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledAuthorizationPolicySet represents a set of authorizationPolicies which share a common set of labels. These labels are used to find diffs between AuthorizationPolicySets.

type LabeledDestinationRuleSet

type LabeledDestinationRuleSet interface {
	// returns the set of Labels shared by this DestinationRuleSet
	Labels() map[string]string

	// returns the set of DestinationRulees with the given labels
	Set() networking_istio_io_v1alpha3_sets.DestinationRuleSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledDestinationRuleSet represents a set of destinationRules which share a common set of labels. These labels are used to find diffs between DestinationRuleSets.

type LabeledEnvoyFilterSet

type LabeledEnvoyFilterSet interface {
	// returns the set of Labels shared by this EnvoyFilterSet
	Labels() map[string]string

	// returns the set of EnvoyFilteres with the given labels
	Set() networking_istio_io_v1alpha3_sets.EnvoyFilterSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledEnvoyFilterSet represents a set of envoyFilters which share a common set of labels. These labels are used to find diffs between EnvoyFilterSets.

type LabeledGatewaySet

type LabeledGatewaySet interface {
	// returns the set of Labels shared by this GatewaySet
	Labels() map[string]string

	// returns the set of Gatewayes with the given labels
	Set() networking_istio_io_v1alpha3_sets.GatewaySet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledGatewaySet represents a set of gateways which share a common set of labels. These labels are used to find diffs between GatewaySets.

type LabeledIssuedCertificateSet

type LabeledIssuedCertificateSet interface {
	// returns the set of Labels shared by this IssuedCertificateSet
	Labels() map[string]string

	// returns the set of IssuedCertificatees with the given labels
	Set() certificates_mesh_gloo_solo_io_v1_sets.IssuedCertificateSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledIssuedCertificateSet represents a set of issuedCertificates which share a common set of labels. These labels are used to find diffs between IssuedCertificateSets.

type LabeledPodBounceDirectiveSet

type LabeledPodBounceDirectiveSet interface {
	// returns the set of Labels shared by this PodBounceDirectiveSet
	Labels() map[string]string

	// returns the set of PodBounceDirectivees with the given labels
	Set() certificates_mesh_gloo_solo_io_v1_sets.PodBounceDirectiveSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledPodBounceDirectiveSet represents a set of podBounceDirectives which share a common set of labels. These labels are used to find diffs between PodBounceDirectiveSets.

type LabeledRateLimitConfigSet added in v1.1.0

type LabeledRateLimitConfigSet interface {
	// returns the set of Labels shared by this RateLimitConfigSet
	Labels() map[string]string

	// returns the set of RateLimitConfiges with the given labels
	Set() ratelimit_solo_io_v1alpha1_sets.RateLimitConfigSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledRateLimitConfigSet represents a set of rateLimitConfigs which share a common set of labels. These labels are used to find diffs between RateLimitConfigSets.

func NewLabeledRateLimitConfigSet added in v1.1.0

func NewLabeledRateLimitConfigSet(set ratelimit_solo_io_v1alpha1_sets.RateLimitConfigSet, labels map[string]string) (LabeledRateLimitConfigSet, error)

type LabeledServiceEntrySet

type LabeledServiceEntrySet interface {
	// returns the set of Labels shared by this ServiceEntrySet
	Labels() map[string]string

	// returns the set of ServiceEntryes with the given labels
	Set() networking_istio_io_v1alpha3_sets.ServiceEntrySet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledServiceEntrySet represents a set of serviceEntries which share a common set of labels. These labels are used to find diffs between ServiceEntrySets.

type LabeledSidecarSet added in v1.1.0

type LabeledSidecarSet interface {
	// returns the set of Labels shared by this SidecarSet
	Labels() map[string]string

	// returns the set of Sidecares with the given labels
	Set() networking_istio_io_v1alpha3_sets.SidecarSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledSidecarSet represents a set of sidecars which share a common set of labels. These labels are used to find diffs between SidecarSets.

func NewLabeledSidecarSet added in v1.1.0

func NewLabeledSidecarSet(set networking_istio_io_v1alpha3_sets.SidecarSet, labels map[string]string) (LabeledSidecarSet, error)

type LabeledVirtualServiceSet

type LabeledVirtualServiceSet interface {
	// returns the set of Labels shared by this VirtualServiceSet
	Labels() map[string]string

	// returns the set of VirtualServicees with the given labels
	Set() networking_istio_io_v1alpha3_sets.VirtualServiceSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledVirtualServiceSet represents a set of virtualServices which share a common set of labels. These labels are used to find diffs between VirtualServiceSets.

type LabeledXdsConfigSet added in v0.10.4

type LabeledXdsConfigSet interface {
	// returns the set of Labels shared by this XdsConfigSet
	Labels() map[string]string

	// returns the set of XdsConfiges with the given labels
	Set() xds_agent_enterprise_mesh_gloo_solo_io_v1beta1_sets.XdsConfigSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledXdsConfigSet represents a set of xdsConfigs which share a common set of labels. These labels are used to find diffs between XdsConfigSets.

type Snapshot

type Snapshot interface {

	// return the set of IssuedCertificates with a given set of labels
	IssuedCertificates() []LabeledIssuedCertificateSet
	// return the set of PodBounceDirectives with a given set of labels
	PodBounceDirectives() []LabeledPodBounceDirectiveSet
	// return the set of XdsConfigs with a given set of labels
	XdsConfigs() []LabeledXdsConfigSet
	// return the set of DestinationRules with a given set of labels
	DestinationRules() []LabeledDestinationRuleSet
	// return the set of EnvoyFilters with a given set of labels
	EnvoyFilters() []LabeledEnvoyFilterSet
	// return the set of Gateways with a given set of labels
	Gateways() []LabeledGatewaySet
	// return the set of ServiceEntries with a given set of labels
	ServiceEntries() []LabeledServiceEntrySet
	// return the set of VirtualServices with a given set of labels
	VirtualServices() []LabeledVirtualServiceSet
	// return the set of Sidecars with a given set of labels
	Sidecars() []LabeledSidecarSet
	// return the set of AuthorizationPolicies with a given set of labels
	AuthorizationPolicies() []LabeledAuthorizationPolicySet
	// return the set of RateLimitConfigs with a given set of labels
	RateLimitConfigs() []LabeledRateLimitConfigSet

	// apply the snapshot to the local cluster, garbage collecting stale resources
	ApplyLocalCluster(ctx context.Context, clusterClient client.Client, errHandler output.ErrorHandler)

	// apply resources from the snapshot across multiple clusters, garbage collecting stale resources
	ApplyMultiCluster(ctx context.Context, multiClusterClient multicluster.Client, errHandler output.ErrorHandler)

	// serialize the entire snapshot as JSON
	MarshalJSON() ([]byte, error)

	// convert this snapshot to its generic form
	Generic() resource.ClusterSnapshot

	// iterate over the objects contained in the snapshot
	ForEachObject(handleObject func(cluster string, gvk schema.GroupVersionKind, obj resource.TypedObject))
}

the snapshot of output resources produced by a translation

func NewSnapshot

func NewSnapshot(
	name string,

	issuedCertificates []LabeledIssuedCertificateSet,
	podBounceDirectives []LabeledPodBounceDirectiveSet,
	xdsConfigs []LabeledXdsConfigSet,
	destinationRules []LabeledDestinationRuleSet,
	envoyFilters []LabeledEnvoyFilterSet,
	gateways []LabeledGatewaySet,
	serviceEntries []LabeledServiceEntrySet,
	virtualServices []LabeledVirtualServiceSet,
	sidecars []LabeledSidecarSet,
	authorizationPolicies []LabeledAuthorizationPolicySet,
	rateLimitConfigs []LabeledRateLimitConfigSet,
	clusters ...string,
) Snapshot

Directories

Path Synopsis
Package mock_istio is a generated GoMock package.
Package mock_istio is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL