ako

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupFinished

func CleanupFinished(ctx context.Context, remoteClient client.Client, log logr.Logger) (bool, error)

Types

type AKOSettings

type AKOSettings struct {
	PrimaryInstance          string            `yaml:"primary_instance"` // Defines AKO instance is primary or not. Value `true` indicates that AKO instance is primary.
	LogLevel                 string            `yaml:"log_level"`
	FullSyncFrequency        string            `yaml:"full_sync_frequency"`       // This frequency controls how often AKO polls the Avi controller to update itself with cloud configurations.
	ApiServerPort            int               `yaml:"api_server_port"`           // Specify the port for the API server, default is set as 8080 // EmptyAllowed: false
	DeleteConfig             string            `yaml:"delete_config"`             // Has to be set to true in configmap if user wants to delete AKO created objects from AVI
	DisableStaticRouteSync   string            `yaml:"disable_static_route_sync"` // If the POD networks are reachable from the Avi SE, set this knob to true.
	ClusterName              string            `yaml:"cluster_name"`              // A unique identifier for the kubernetes cluster, that helps distinguish the objects for this cluster in the avi controller. // MUST-EDIT
	CniPlugin                string            `yaml:"cni_plugin"`                // Set the string if your CNI is calico or openshift. enum: antrea|calico|canal|flannel|openshift
	SyncNamespace            string            `yaml:"sync_namespace"`
	EnableEVH                string            `yaml:"enable_EVH"`   // This enables the Enhanced Virtual Hosting Model in Avi Controller for the Virtual Services
	Layer7Only               string            `yaml:"layer_7_only"` // If this flag is switched on, then AKO will only do layer 7 loadbalancing
	ServicesAPI              string            `yaml:"services_api"` // Flag that enables AKO in services API mode. Currently implemented only for L4.
	VIPPerNamespace          string            `yaml:"vip_per_namespace"`
	NamespaceSector          NamespaceSelector `yaml:"namespace_selector"`
	EnableEvents             string            `yaml:"enable_events"` // Enables/disables Event broadcasting via AKO
	IstioEnabled             string            `yaml:"istio_enabled"`
	BlockedNamespaceList     []string          `yaml:"-"`
	BlockedNamespaceListJson string            `yaml:"blocked_namespace_list"`
	IpFamily                 string            `yaml:"ip_family"`
}

AKOSettings provides the settings for AKO

func DefaultAKOSettings

func DefaultAKOSettings() *AKOSettings

DefaultAKOSettings returns the default AKOSettings

func NewAKOSettings

func NewAKOSettings(clusterName string, obj *akoov1alpha1.AKODeploymentConfig) (settings *AKOSettings)

NewAKOSettings returns a new AKOSettings, allow users to set CniPlugin, ClusterName and DisableStaticRouteSync in runtime

type Avicredentials

type Avicredentials struct {
	Username                 string `yaml:"username"`
	Password                 string `yaml:"password"`
	CertificateAuthorityData string `yaml:"certificate_authority_data"`
}

type CNI

type CNI string
const (
	Antrea    CNI = "antrea"
	Calico    CNI = "calico"
	Canal     CNI = "canal"
	Flannel   CNI = "flannel"
	Openshift CNI = "openshift"
)

type Config

type Config struct {
	TkgClusterRole        string              `yaml:"tkg_cluster_role"`
	IsClusterService      string              `yaml:"is_cluster_service"`
	ReplicaCount          int                 `yaml:"replica_count"`
	AKOSettings           *AKOSettings        `yaml:"ako_settings"`
	NetworkSettings       *NetworkSettings    `yaml:"network_settings"`
	L7Settings            *L7Settings         `yaml:"l7_settings"`
	L4Settings            *L4Settings         `yaml:"l4_settings"`
	ControllerSettings    *ControllerSettings `yaml:"controller_settings"`
	NodePortSelector      *NodePortSelector   `yaml:"nodeport_selector"`
	Rbac                  *Rbac               `yaml:"rbac"`
	PersistentVolumeClaim string              `yaml:"persistent_volume_claim"`
	MountPath             string              `yaml:"mount_path"`
	LogFile               string              `yaml:"log_file"`
	Avicredentials        Avicredentials      `yaml:"avi_credentials"`
}

Config consists of different configurations for Values that includes settings of AKO, networking, L4, L7, Rbac etc

type ControllerSettings

type ControllerSettings struct {
	ServiceEngineGroupName string `yaml:"service_engine_group_name"` // Name of the ServiceEngine Group.
	ControllerVersion      string `yaml:"controller_version"`        // The controller API version
	CloudName              string `yaml:"cloud_name"`                // The configured cloud name on the Avi controller.
	ControllerIP           string `yaml:"controller_ip"`
	TenantName             string `yaml:"tenant_name"`
}

ControllerSettings outlines settings on the Avi controller that affects AKO's functionality.

func DefaultControllerSettings

func DefaultControllerSettings() *ControllerSettings

DefaultControllerSettings return the default ControllerSettings

func NewControllerSettings

func NewControllerSettings(cloudName, controllerIP, controllerVersion, serviceEngineGroup, tenantName string) (setting *ControllerSettings)

NewControllerSettings returns a ControllerSettings from default, allow setting CloudName, ControllerIP, ControllerVersion and ServiceEngineGroupName

type L4Settings

type L4Settings struct {
	DefaultDomain string `yaml:"default_domain"` // If multiple sub-domains are configured in the cloud, use this knob to set the default sub-domain to use for L4 VSes.
	AutoFQDN      string `yaml:"auto_fqdn"`      // ENUM: default(<svc>.<ns>.<subdomain>), flat (<svc>-<ns>.<subdomain>), "disabled"
}

L4Settings outlines all the knobs used to control Layer 4 loadbalancing settings in AKO.

func DefaultL4Settings

func DefaultL4Settings() *L4Settings

DefaultL4Settings returns the default L4Settings

func NewL4Settings

func NewL4Settings(config *akoov1alpha1.AKOL4Config) *L4Settings

NewL4Settings returns a customized L4Settings after parsing the v1alpha1.AKOL4Config

type L7Settings

type L7Settings struct {
	DisableIngressClass  bool   `yaml:"disable_ingress_class"`
	DefaultIngController bool   `yaml:"default_ing_controller"`
	L7ShardingScheme     string `yaml:"l7_sharding_scheme"`
	ServiceType          string `yaml:"service_type"`           // enum NodePort|ClusterIP|NodePortLocal
	ShardVSSize          string `yaml:"shard_vs_size"`          // Use this to control the layer 7 VS numbers. This applies to both secure/insecure VSes but does not apply for passthrough. ENUMs: LARGE, MEDIUM, SMALL
	PassthroughShardSize string `yaml:"pass_through_shardsize"` // Control the passthrough virtualservice numbers using this ENUM. ENUMs: LARGE, MEDIUM, SMALL
	NoPGForSNI           bool   `yaml:"no_pg_for_SNI"`
	EnableMCI            string `yaml:"enable_MCI"` // Enabling this flag would tell AKO to start processing multi-cluster ingress objects.
}

L7Settings outlines all the knobs used to control Layer 7 load balancing settings in AKO.

func DefaultL7Settings

func DefaultL7Settings() *L7Settings

DefaultL7Settings returns the default L7Settings

func NewL7Settings

func NewL7Settings(config *akoov1alpha1.AKOIngressConfig) *L7Settings

NewL7Settings returns a customized L7Settings after parsing the v1alpha1.AKOIngressConfig it only modifies ServiceType and ShardVSSize when instructed by the ingressConfig

type LoadBalancerAndIngressService

type LoadBalancerAndIngressService struct {
	Name      string `yaml:"name"`
	Namespace string `yaml:"namespace"`
	Config    Config `yaml:"config"`
}

LoadBalancerAndIngressService describes the load balancer and ingress service

type NamespaceSelector

type NamespaceSelector struct {
	LabelKey   string `yaml:"label_key"`
	LabelValue string `yaml:"label_value"`
}

NamespaceSelector contains label key and value used for namespace migration. Same label has to be present on namespace/s which needs migration/sync to AKO

type NetworkSettings

type NetworkSettings struct {
	SubnetIP                string                 `yaml:"subnet_ip"`                  // Subnet IP of the vip network
	SubnetPrefix            string                 `yaml:"subnet_prefix"`              // Subnet Prefix of the vip network
	NetworkName             string                 `yaml:"network_name"`               // Network Name of the vip network
	ControlPlaneNetworkName string                 `yaml:"control_plane_network_name"` // Control Plane Network Name of the control plane vip network
	ControlPlaneNetworkCIDR string                 `yaml:"control_plane_network_cidr"` // Control Plane Network Cidr of the control plane vip network
	NodeNetworkList         []v1alpha1.NodeNetwork `yaml:"-"`                          // This list of network and cidrs are used in pool placement network for vcenter cloud.
	NodeNetworkListJson     string                 `yaml:"node_network_list"`
	VIPNetworkList          []v1alpha1.VIPNetwork  `yaml:"-"` // Network information of the VIP network. Multiple networks allowed only for AWS Cloud.
	VIPNetworkListJson      string                 `yaml:"vip_network_list"`
	EnableRHI               string                 `yaml:"enable_rhi"` // This is a cluster wide setting for BGP peering.
	NsxtT1LR                string                 `yaml:"nsxt_t1_lr"`
	BGPPeerLabels           []string               `yaml:"-"` // Select BGP peers using bgpPeerLabels, for selective VsVip advertisement.
	BGPPeerLabelsJson       string                 `yaml:"bgp_peer_labels"`
}

NetworkSettings outlines the network settings for virtual services.

func DefaultNetworkSettings

func DefaultNetworkSettings() *NetworkSettings

DefaultNetworkSettings returns default NetworkSettings

func NewNetworkSettings

func NewNetworkSettings(obj *akoov1alpha1.AKODeploymentConfig) (*NetworkSettings, error)

NewNetworkSettings returns a new NetworkSettings allow user to set NetworkName, SubnetIP, SubnetPrefix, NodeNetworkList and VIPNetworkList at runtime

type NodePortSelector

type NodePortSelector struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
}

NodePortSelector is only applicable if serviceType is NodePort

func DefaultNodePortSelector

func DefaultNodePortSelector() *NodePortSelector

DefaultNodePortSelector returns the default NodePortSelector

func NewNodePortSelector

func NewNodePortSelector(nodePortSelector *akoov1alpha1.NodePortSelector) *NodePortSelector

NewNodePortSelector returns the NodePortSelector defined in AKODeploymentConfig

type Rbac

type Rbac struct {
	PspEnabled          bool   `yaml:"psp_enabled"`
	PspPolicyApiVersion string `yaml:"psp_policy_api_version"`
}

Rbac creates the pod security policy if PspEnabled is set to true

func NewRbac

func NewRbac(config v1alpha1.AKORbacConfig) *Rbac

NewRbac creates a Rbac from the v1alpha1.AKORbacConfig

type ServiceType

type ServiceType string
const (
	NodePort      ServiceType = "NodePort"
	ClusterIP     ServiceType = "ClusterIP"
	NodePortLocal ServiceType = "NodePortLocal"
)

type Values

type Values struct {
	LoadBalancerAndIngressService LoadBalancerAndIngressService `yaml:"loadBalancerAndIngressService"`
}

Values defines the structures of an Ako addon secret string data this constructs the payload (string data) of the corev1.Secret

func NewValues

func NewValues(obj *akoov1alpha1.AKODeploymentConfig, clusterNameSpacedName string) (*Values, error)

NewValues creates a new Values given AKODeploymentConfig and clusterNameSpacedName

func NewValuesFromBytes

func NewValuesFromBytes(data []byte) (*Values, error)

NewValuesFromBytes unmarshalls a byte array into an instance of Values

func (Values) GetName

func (v Values) GetName() string

func (*Values) YttYaml

func (v *Values) YttYaml(cluster *clusterv1.Cluster) (string, error)

YttYaml converts the AkoAddonSecretData to a Ytt Yaml template string, return any unmarshall error occurs

Jump to

Keyboard shortcuts

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