controllers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Copyright 2020 VMware, Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 VMware, Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	CRDGroup   = "ako.vmware.com"
	CRDVersion = "apiextensions.k8s.io/v1"
	Version    = "v1alpha1"
)
View Source
const (
	StatefulSetName    = "ako"
	ServiceAccountName = "ako-sa"
	ServiceName        = "ako"
	ConfigMapName      = "avi-k8s-config"
	AviSystemNS        = "avi-system"
	AKOCR              = "ako-cr"
	CRBName            = "ako-crb"
	AKOServiceAccount  = "ako-sa"
	PSPName            = "ako"
	AviSecretName      = "avi-secret"
)

properties used for naming the dependent artifacts

View Source
const (
	ControllerIP           = "controllerIP"
	ControllerVersion      = "controllerVersion"
	CniPlugin              = "cniPlugin"
	EnableEVH              = "enableEVH"
	Layer7Only             = "layer7Only"
	ServicesAPI            = "servicesAPI"
	VipPerNamespace        = "vipPerNamespace"
	ShardVSSize            = "shardVSSize"
	PassthroughShardSize   = "passhtroughShardSize"
	FullSyncFrequency      = "fullSyncFrequency"
	CloudName              = "cloudName"
	ClusterName            = "clusterName"
	EnableRHI              = "enableRHI"
	DefaultDomain          = "defaultDomain"
	DisableStaticRouteSync = "disableStaticRouteSync"
	DefaultIngController   = "defaultIngController"
	VipNetworkList         = "vipNetworkList"
	BgpPeerLabels          = "bgpPeerLabels"
	EnableEvents           = "enableEvents"
	LogLevel               = "logLevel"
	DeleteConfig           = "deleteConfig"
	AutoFQDN               = "autoFQDN"
	ServiceType            = "serviceType"
	NodeKey                = "nodeKey"
	NodeValue              = "nodeValue"
	ServiceEngineGroupName = "serviceEngineGroupName"
	NodeNetworkList        = "nodeNetworkList"
	APIServerPort          = "apiServerPort"
	NSSyncLabelKey         = "nsSyncLabelKey"
	NSSyncLabelValue       = "nsSyncLabelValue"
	TenantName             = "tenantName"
	NoPGForSni             = "noPGForSni"
	NsxtT1LR               = "nsxtT1LR"
	PrimaryInstance        = "primaryInstance"
	IstioEnabled           = "istioEnabled"
	BlockedNamespaceList   = "blockedNamespaceList"
	IPFamily               = "ipFamily"
	EnableMCI              = "enableMCI"
	UseDefaultSecretsOnly  = "useDefaultSecretsOnly"
)

below properties are applicable to a configmap object for AKO controller

View Source
const (
	CleanupFinalizer = "ako.vmware.com/cleanup"
)

Variables

View Source
var ConfigMapEnvVars = map[string]string{
	"CTRL_IPADDRESS":             ControllerIP,
	"CTRL_VERSION":               ControllerVersion,
	"CNI_PLUGIN":                 CniPlugin,
	"ENABLE_EVH":                 EnableEVH,
	"SERVICES_API":               ServicesAPI,
	"SHARD_VS_SIZE":              ShardVSSize,
	"PASSTHROUGH_SHARD_SIZE":     PassthroughShardSize,
	"FULL_SYNC_INTERVAL":         FullSyncFrequency,
	"CLOUD_NAME":                 CloudName,
	"CLUSTER_NAME":               ClusterName,
	"ENABLE_RHI":                 EnableRHI,
	"BGP_PEER_LABELS":            BgpPeerLabels,
	"DEFAULT_DOMAIN":             DefaultDomain,
	"DISABLE_STATIC_ROUTE_SYNC":  DisableStaticRouteSync,
	"DEFAULT_ING_CONTROLLER":     DefaultIngController,
	"VIP_NETWORK_LIST":           VipNetworkList,
	"AUTO_L4_FQDN":               AutoFQDN,
	"SERVICE_TYPE":               ServiceType,
	"NODE_KEY":                   NodeKey,
	"NODE_VALUE":                 NodeValue,
	"SEG_NAME":                   ServiceEngineGroupName,
	"NODE_NETWORK_LIST":          NodeNetworkList,
	"AKO_API_PORT":               APIServerPort,
	"TENANT_NAME":                TenantName,
	"NAMESPACE_SYNC_LABEL_KEY":   NSSyncLabelKey,
	"NAMESPACE_SYNC_LABEL_VALUE": NSSyncLabelValue,
	"NSXT_T1_LR":                 NsxtT1LR,
	"PRIMARY_AKO_FLAG":           PrimaryInstance,
	"ISTIO_ENABLED":              IstioEnabled,
	"IP_FAMILY":                  IPFamily,
	"MCI_ENABLED":                EnableMCI,
	"BLOCKED_NS_LIST":            BlockedNamespaceList,
	"VIP_PER_NAMESPACE":          VipPerNamespace,
	"USE_DEFAULT_SECRETS_ONLY":   UseDefaultSecretsOnly,
}
View Source
var SecretEnvVars = map[string]string{
	"CTRL_CA_DATA": "certificateAuthorityData",
}

Functions

func BuildConfigMap

func BuildConfigMap(ako akov1alpha1.AKOConfig) (corev1.ConfigMap, error)

func BuildServiceAccount

func BuildServiceAccount(ako akov1alpha1.AKOConfig, r *AKOConfigReconciler, log logr.Logger) v1.ServiceAccount

BuildServiceAccount builds a serviceaccount object from the akoconfig resource

func BuildStatefulSet

func BuildStatefulSet(ako akov1alpha1.AKOConfig, aviSecret corev1.Secret) (appsv1.StatefulSet, error)

func SetIfRebootRequired

func SetIfRebootRequired(oldCm corev1.ConfigMap, newCm corev1.ConfigMap)

Types

type AKOConfigReconciler

type AKOConfigReconciler struct {
	client.Client
	Config *rest.Config
	Log    logr.Logger
	Scheme *runtime.Scheme
}

AKOConfigReconciler reconciles a AKOConfig object

func (*AKOConfigReconciler) CleanupArtifacts

func (r *AKOConfigReconciler) CleanupArtifacts(ctx context.Context, log logr.Logger) error

func (*AKOConfigReconciler) Reconcile

func (r *AKOConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*AKOConfigReconciler) ReconcileAllArtifacts

func (r *AKOConfigReconciler) ReconcileAllArtifacts(ctx context.Context, ako akov1alpha1.AKOConfig, log logr.Logger) error

func (*AKOConfigReconciler) SetupWithManager

func (r *AKOConfigReconciler) SetupWithManager(mgr ctrl.Manager) error

Jump to

Keyboard shortcuts

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