Documentation
¶
Index ¶
- Variables
- func SupportsNetworkingPackage(client clientset.Interface) bool
- type CacheCollection
- type Context
- func (c *Context) GetAGICPod(envVariables environment.EnvVariables) *v1.Pod
- func (c *Context) GetBackendPool(backendPoolName string) (*agpoolv1beta1.AzureApplicationGatewayBackendPool, error)
- func (c *Context) GetEndpointsByService(serviceKey string) (*v1.Endpoints, error)
- func (c *Context) GetEndpointsForVirtualService(virtualService v1alpha3.VirtualService) v1.EndpointsList
- func (c *Context) GetGateways() []*v1alpha3.Gateway
- func (c *Context) GetInfrastructureResourceGroupID() (azure.SubscriptionID, azure.ResourceGroup, error)
- func (c *Context) GetInstanceUpdateStatus(instanceUpdateStatusName string) (*aginstv1beta1.AzureApplicationGatewayInstanceUpdateStatus, error)
- func (c *Context) GetProhibitedTarget(namespace string, targetName string) *prohibitedv1.AzureIngressProhibitedTarget
- func (c *Context) GetRewriteRuleSetCustomResource(namespace string, name string) (*agrewritev1beta1.AzureApplicationGatewayRewrite, error)
- func (c *Context) GetSecret(secretKey string) *v1.Secret
- func (c *Context) GetService(serviceKey string) *v1.Service
- func (c *Context) GetVirtualServicesForGateway(gateway v1alpha3.Gateway) []*v1alpha3.VirtualService
- func (c *Context) IsEndpointReferencedByAnyIngress(endpoints *v1.Endpoints) bool
- func (c *Context) IsIngressClass(ing *networking.Ingress) bool
- func (c *Context) IsIstioGatewayIngress(gateway *v1alpha3.Gateway) bool
- func (c *Context) IsPodReferencedByAnyIngress(pod *v1.Pod) bool
- func (c *Context) ListAzureProhibitedTargets() []*prohibitedv1.AzureIngressProhibitedTarget
- func (c *Context) ListHTTPIngresses() []*networking.Ingress
- func (c *Context) ListIstioGateways() []*v1alpha3.Gateway
- func (c *Context) ListIstioVirtualServices() []*v1alpha3.VirtualService
- func (c *Context) ListPodsByServiceSelector(service *v1.Service) []*v1.Pod
- func (c *Context) ListServices() []*v1.Service
- func (c *Context) Run(stopChannel chan struct{}, omitCRDs bool, ...) error
- func (c *Context) UpdateIngressStatus(ingressToUpdate networking.Ingress, newIP IPAddress) error
- type IPAddress
- type InformerCollection
- type SecretsKeeper
- type SecretsStore
Constants ¶
This section is empty.
Variables ¶
var ( // IsNetworkingV1PackageSupported is flag that indicates whether networking/v1beta ingress should be used instead. IsNetworkingV1PackageSupported bool // IsInMultiClusterMode is a flag to indicate that AGIC should monitor MutliCluster CRDs IsInMultiClusterMode bool )
Functions ¶
func SupportsNetworkingPackage ¶
SupportsNetworkingPackage checks if the package "k8s.io/api/networking/v1" is available or not and if Ingress V1 is supported (k8s >= v1.19.0) https://kubernetes.io/blog/2021/07/14/upcoming-changes-in-kubernetes-1-22/#what-to-do
Types ¶
type CacheCollection ¶
type CacheCollection struct { Endpoints cache.Store Ingress cache.Store IngressClass cache.Store Pods cache.Store Secret cache.Store Service cache.Store Namespaces cache.Store AzureIngressManagedLocation cache.Store AzureIngressProhibitedTarget cache.Store AzureApplicationGatewayBackendPool cache.Store AzureApplicationGatewayRewrite cache.Store AzureApplicationGatewayInstanceUpdateStatus cache.Store MultiClusterService cache.Store MultiClusterIngress cache.Store IstioGateway cache.Store IstioVirtualService cache.Store }
CacheCollection : all the listers from the informers.
type Context ¶
type Context struct { Caches *CacheCollection CertificateSecretStore SecretsKeeper Work chan events.Event CacheSynced chan interface{} MetricStore metricstore.MetricStore // contains filtered or unexported fields }
Context : cache and listener for k8s resources.
func NewContext ¶
func NewContext(kubeClient kubernetes.Interface, crdClient versioned.Interface, multiClusterCrdClient multicluster_versioned.Interface, istioCrdClient istio_versioned.Interface, namespaces []string, resyncPeriod time.Duration, metricStore metricstore.MetricStore, envVariables environment.EnvVariables) *Context
NewContext creates a context based on a Kubernetes client instance.
func (*Context) GetAGICPod ¶
func (c *Context) GetAGICPod(envVariables environment.EnvVariables) *v1.Pod
GetAGICPod returns the pod with specified name and namespace
func (*Context) GetBackendPool ¶
func (c *Context) GetBackendPool(backendPoolName string) (*agpoolv1beta1.AzureApplicationGatewayBackendPool, error)
GetBackendPool returns backend pool with specified name
func (*Context) GetEndpointsByService ¶
GetEndpointsByService returns the endpoints associated with a specific service.
func (*Context) GetEndpointsForVirtualService ¶
func (c *Context) GetEndpointsForVirtualService(virtualService v1alpha3.VirtualService) v1.EndpointsList
GetEndpointsForVirtualService returns a list of Endpoints associated with a Virtual Service
func (*Context) GetGateways ¶
GetGateways returns all Istio Gateways that are annotated.
func (*Context) GetInfrastructureResourceGroupID ¶
func (c *Context) GetInfrastructureResourceGroupID() (azure.SubscriptionID, azure.ResourceGroup, error)
GetInfrastructureResourceGroupID returns the subscription and resource group name of the underling infrastructure. This uses ProviderID which is ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID>
func (*Context) GetInstanceUpdateStatus ¶
func (c *Context) GetInstanceUpdateStatus(instanceUpdateStatusName string) (*aginstv1beta1.AzureApplicationGatewayInstanceUpdateStatus, error)
GetInstanceUpdateStatus returns update status from when Application Gateway instances update backend pool addresses
func (*Context) GetProhibitedTarget ¶
func (c *Context) GetProhibitedTarget(namespace string, targetName string) *prohibitedv1.AzureIngressProhibitedTarget
GetProhibitedTarget returns prohibited target with specified name and namespace
func (*Context) GetRewriteRuleSetCustomResource ¶
func (c *Context) GetRewriteRuleSetCustomResource(namespace string, name string) (*agrewritev1beta1.AzureApplicationGatewayRewrite, error)
GetRewriteRuleSetCustomResource returns rewrite with specified name and namespace
func (*Context) GetService ¶
GetService returns the service identified by the key.
func (*Context) GetVirtualServicesForGateway ¶
func (c *Context) GetVirtualServicesForGateway(gateway v1alpha3.Gateway) []*v1alpha3.VirtualService
GetVirtualServicesForGateway returns the VirtualServices for the provided gateway
func (*Context) IsEndpointReferencedByAnyIngress ¶
IsEndpointReferencedByAnyIngress provides whether an Endpoint is useful i.e. a Endpoint is used by an ingress
func (*Context) IsIngressClass ¶
func (c *Context) IsIngressClass(ing *networking.Ingress) bool
IsIngressClass checks if the Ingress resource can be handled by the Application Gateway ingress controller.
func (*Context) IsIstioGatewayIngress ¶
IsIstioGatewayIngress checks if this gateway should be handled by AGIC or not
func (*Context) IsPodReferencedByAnyIngress ¶
IsPodReferencedByAnyIngress provides whether a POD is useful i.e. a POD is used by an ingress
func (*Context) ListAzureProhibitedTargets ¶
func (c *Context) ListAzureProhibitedTargets() []*prohibitedv1.AzureIngressProhibitedTarget
ListAzureProhibitedTargets returns a list of App Gwy configs, for which AGIC is not allowed to modify config.
func (*Context) ListHTTPIngresses ¶
func (c *Context) ListHTTPIngresses() []*networking.Ingress
ListHTTPIngresses returns a list of all the ingresses for HTTP from cache.
func (*Context) ListIstioGateways ¶
ListIstioGateways returns a list of discovered Istio Gateways
func (*Context) ListIstioVirtualServices ¶
func (c *Context) ListIstioVirtualServices() []*v1alpha3.VirtualService
ListIstioVirtualServices returns a list of discovered Istio Virtual Services
func (*Context) ListPodsByServiceSelector ¶
ListPodsByServiceSelector returns pods that are associated with a specific service.
func (*Context) ListServices ¶
ListServices returns a list of all the Services from cache.
func (*Context) Run ¶
func (c *Context) Run(stopChannel chan struct{}, omitCRDs bool, envVariables environment.EnvVariables) error
Run executes informer collection.
func (*Context) UpdateIngressStatus ¶
func (c *Context) UpdateIngressStatus(ingressToUpdate networking.Ingress, newIP IPAddress) error
UpdateIngressStatus adds IP address in Ingress Status
type InformerCollection ¶
type InformerCollection struct { Endpoints cache.SharedIndexInformer Ingress cache.SharedIndexInformer IngressClass cache.SharedIndexInformer Pods cache.SharedIndexInformer Secret cache.SharedIndexInformer Service cache.SharedIndexInformer Namespace cache.SharedIndexInformer AzureIngressManagedLocation cache.SharedInformer AzureIngressProhibitedTarget cache.SharedInformer AzureApplicationGatewayBackendPool cache.SharedInformer AzureApplicationGatewayRewrite cache.SharedInformer AzureApplicationGatewayInstanceUpdateStatus cache.SharedInformer MultiClusterService cache.SharedInformer MultiClusterIngress cache.SharedInformer IstioGateway cache.SharedIndexInformer IstioVirtualService cache.SharedIndexInformer }
InformerCollection : all the informers for k8s resources we care about.
type SecretsKeeper ¶
type SecretsKeeper interface { GetPfxCertificate(secretKey string) []byte ConvertSecret(secretKey string, secret *v1.Secret) error // contains filtered or unexported methods }
SecretsKeeper is the interface definition for secret store
func NewSecretStore ¶
func NewSecretStore(client kubernetes.Interface) SecretsKeeper
NewSecretStore creates a new SecretsKeeper object
type SecretsStore ¶
type SecretsStore struct { Client kubernetes.Interface Cache cache.ThreadSafeStore // contains filtered or unexported fields }
SecretsStore maintains a cache of the deployment secrets.
func (*SecretsStore) ConvertSecret ¶
func (s *SecretsStore) ConvertSecret(secretKey string, secret *v1.Secret) error
ConvertSecret converts a secret to a PKCS12.
func (*SecretsStore) GetFromCluster ¶
func (s *SecretsStore) GetFromCluster(secretKey string) ([]byte, error)
func (*SecretsStore) GetPfxCertificate ¶
func (s *SecretsStore) GetPfxCertificate(secretKey string) []byte
GetPfxCertificate returns the certificate for the given secret key.