key

package
v13.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CloudConfigVersion defines the version of k8scloudconfig in use. It is used
	// in the main stack output and S3 object paths.
	CloudConfigVersion = "v_6_1_0"
	CloudProvider      = "aws"
)
View Source
const (
	EC2RoleK8s   = "EC2-K8S-Role"
	EC2PolicyK8s = "EC2-K8S-Policy"
)
View Source
const (
	EtcdPort                     = 2379
	EtcdPrefix                   = "giantswarm.io"
	KubernetesSecurePort         = 443
	KubernetesApiHealthCheckPort = 8089
)
View Source
const (
	// KubernetesAPIHealthzVersion is a tag representing the version of
	// https://github.com/giantswarm/k8s-api-healthz/ used.
	KubernetesAPIHealthzVersion = "0.1.1"
	// K8sSetupNetworkEnvironment is a tag representing the version of
	// https://github.com/giantswarm/k8s-setup-network-environment used.
	K8sSetupNetworkEnvironment = "0.2.0"
)
View Source
const (
	TagAvailabilityZone  = "giantswarm.io/availability-zone"
	TagCluster           = "giantswarm.io/cluster"
	TagClusterType       = "giantswarm.io/cluster-type"
	TagControlPlane      = "giantswarm.io/control-plane"
	TagInstallation      = "giantswarm.io/installation"
	TagMachineDeployment = "giantswarm.io/machine-deployment"
	TagName              = "Name"
	TagOrganization      = "giantswarm.io/organization"
	TagRouteTableType    = "giantswarm.io/route-table-type"
	TagStack             = "giantswarm.io/stack"
	TagSnapshot          = "giantswarm.io/snapshot"
	TagSubnetType        = "giantswarm.io/subnet-type"
)

AWS Tags used for cost analysis and general resource tagging.

View Source
const (
	StackTCCP  = "tccp"
	StackTCCPF = "tccpf"
	StackTCCPI = "tccpi"
	StackTCCPN = "tccpn"
	StackTCNP  = "tcnp"
	StackTCNPF = "tcnpf"
)
View Source
const (
	LifeCycleHookControlPlane = "ControlPlane"
	LifeCycleHookNodePool     = "NodePool"
)
View Source
const (
	AWSCNIComponentName          = "aws-cni"
	AWSCNIDefaultMinimumIPTarget = "40"
	AWSCNIDefaultWarmIPTarget    = "10"

	ELBInstanceStateInService = "InService"

	DrainerResyncPeriod = time.Minute * 2

	DefaultPauseTimeBetweenUpdates = "PT10M"

	NodeRoleLabel       = "kubernetes.io/role"
	MasterNodeRoleLabel = "master"

	EncryptionProviderConfig = "encryption"

	ServiceAccountV2Pub  = "pub"
	ServiceAccountV2Priv = "key"
)
View Source
const (
	// ComponentOS is the name of the component specified in a Release CR which
	// determines the version of the OS to be used for tenant cluster nodes and
	// is ultimately transformed into an AMI based on TC region.
	ComponentOS = "containerlinux"
)
View Source
const (
	HAMasterSnapshotIDValue = "ha-master-migration"
)
View Source
const KeyCloudPrefix = "tag.provider.giantswarm.io/"
View Source
const (
	RefWorkerASG = "workerAutoScalingGroup"
)
View Source
const (
	// TerminateUnhealthyNodeResyncPeriod defines resync period for the terminateunhealthynode controller
	TerminateUnhealthyNodeResyncPeriod = time.Minute * 3
)

Variables

This section is empty.

Functions

func AMI

func AMI(region string, release releasev1alpha1.Release) (string, error)

AMI returns the EC2 AMI for the configured region and given version.

func AWSBaseDomain

func AWSBaseDomain(region string) string

func AWSCNINATRouteName

func AWSCNINATRouteName(az string) string

func AWSCNIPodsCIDRBlock

func AWSCNIPodsCIDRBlock(cluster infrastructurev1alpha3.AWSCluster) string

func AWSCNIRouteTableName

func AWSCNIRouteTableName(az string) string

func AWSCNISubnetName

func AWSCNISubnetName(az string) string

func AWSCNISubnetRouteTableAssociationName

func AWSCNISubnetRouteTableAssociationName(az string) string

func AWSTags

func AWSTags(getter LabelsGetter, installationName string) map[string]string

func AvailabilityZoneRegionSuffix

func AvailabilityZoneRegionSuffix(az string) string

AvailabilityZoneRegionSuffix takes region's full name and returns its suffix: e.g. "eu-central-1b" -> "1b"

func BucketName

func BucketName(getter LabelsGetter, accountID string) string

func CiliumPodsCIDRBlock

func CiliumPodsCIDRBlock(cluster apiv1beta1.Cluster) string

func CloudConfigSmallTemplates

func CloudConfigSmallTemplates() []string

func ClusterAPIEndpoint

func ClusterAPIEndpoint(cluster infrastructurev1alpha3.AWSCluster) string

func ClusterBaseDomain

func ClusterBaseDomain(cluster infrastructurev1alpha3.AWSCluster) string

func ClusterCloudProviderTag

func ClusterCloudProviderTag(getter LabelsGetter) string

func ClusterEtcdEndpoint

func ClusterEtcdEndpoint(cluster infrastructurev1alpha3.AWSCluster) string

func ClusterEtcdEndpointWithPort

func ClusterEtcdEndpointWithPort(cluster infrastructurev1alpha3.AWSCluster) string

func ClusterID

func ClusterID(getter LabelsGetter) string

func ClusterKubeletEndpoint

func ClusterKubeletEndpoint(cluster infrastructurev1alpha3.AWSCluster) string

func ClusterNamespace

func ClusterNamespace(cluster infrastructurev1alpha3.AWSCluster) string

func ComponentVersion

func ComponentVersion(release releasev1alpha1.Release, componentName string) (string, error)

func ControlPlaneASGResourceName

func ControlPlaneASGResourceName(getter LabelsGetter, id int) string

func ControlPlaneAvailabilityZones

func ControlPlaneAvailabilityZones(cr infrastructurev1alpha3.AWSControlPlane) []string

func ControlPlaneENIName

func ControlPlaneENIName(getter LabelsGetter, id int) string

func ControlPlaneENIResourceName

func ControlPlaneENIResourceName(id int) string

func ControlPlaneEtcdNodeName

func ControlPlaneEtcdNodeName(id int) string

func ControlPlaneID

func ControlPlaneID(getter LabelsGetter) string

func ControlPlaneLaunchTemplateName

func ControlPlaneLaunchTemplateName(getter LabelsGetter, id int) string

func ControlPlaneLaunchTemplateResourceName

func ControlPlaneLaunchTemplateResourceName(getter LabelsGetter, id int) string

func ControlPlaneRecordSetsRecordValue

func ControlPlaneRecordSetsRecordValue(id int) string

func ControlPlaneRecordSetsResourceName

func ControlPlaneRecordSetsResourceName(id int) string

func ControlPlaneVolumeIops

func ControlPlaneVolumeIops(cr infrastructurev1alpha3.AWSControlPlane) int

func ControlPlaneVolumeName

func ControlPlaneVolumeName(getter LabelsGetter, id int) string

func ControlPlaneVolumeResourceName

func ControlPlaneVolumeResourceName(id int) string

func ControlPlaneVolumeSnapshotID

func ControlPlaneVolumeSnapshotID(snapshot string, master int) string

func ControlPlaneVolumeThroughput

func ControlPlaneVolumeThroughput(cr infrastructurev1alpha3.AWSControlPlane) int

func CredentialName

func CredentialName(cluster infrastructurev1alpha3.AWSCluster) string

func CredentialNamespace

func CredentialNamespace(cluster infrastructurev1alpha3.AWSCluster) string

func EC2ServiceDomain

func EC2ServiceDomain(region string) string

func ELBNameAPI

func ELBNameAPI(getter LabelsGetter) string

func ELBNameEtcd

func ELBNameEtcd(getter LabelsGetter) string

func EncryptionConfigSecretName

func EncryptionConfigSecretName(clusterName string) string

func ExternalSNAT

func ExternalSNAT(cluster infrastructurev1alpha3.AWSCluster) *bool

func G8sControlPlaneReplicas

func G8sControlPlaneReplicas(cr infrastructurev1alpha3.G8sControlPlane) int

func HasCilium added in v13.1.0

func HasCilium(cluster LabelsGetter) (bool, error)

HasCilium returns true if the release uses cilium as CNI. Cilium will be added in v19, so any release >= v19.0.0

func HealthCheckHTTPTarget

func HealthCheckHTTPTarget(port int) string

func HealthCheckTCPTarget

func HealthCheckTCPTarget(port int) string

func IRSACloudfrontConfigMap

func IRSACloudfrontConfigMap(clusterName string) string

func InternalELBNameAPI

func InternalELBNameAPI(getter LabelsGetter) string

func IsAWSCNINeeded

func IsAWSCNINeeded(cluster apiv1beta1.Cluster) bool

func IsAlreadyCreatedCluster

func IsAlreadyCreatedCluster(cluster infrastructurev1alpha3.AWSCluster) bool

func IsChinaRegion

func IsChinaRegion(awsRegion string) bool

func IsDeleted

func IsDeleted(getter DeletionTimestampGetter) bool

func IsInvalidParameter

func IsInvalidParameter(err error) bool

IsInvalidParameter asserts invalidParameterError.

func IsNewCluster

func IsNewCluster(cluster infrastructurev1alpha3.AWSCluster) bool

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

func IsWrongDrainerConfig

func IsWrongDrainerConfig(dc *g8sv1alpha1.DrainerConfig, clusterID string, instanceId string) bool

func IsWrongTypeError

func IsWrongTypeError(err error) bool

IsWrongTypeError asserts wrongTypeError.

func KubeletLabelsTCCPN

func KubeletLabelsTCCPN(getter LabelsGetter, masterID int) string

func KubeletLabelsTCNP

func KubeletLabelsTCNP(getter LabelsGetter) string

func MachineDeploymentAvailabilityZones

func MachineDeploymentAvailabilityZones(cr infrastructurev1alpha3.AWSMachineDeployment) []string

func MachineDeploymentID

func MachineDeploymentID(getter LabelsGetter) string

func MachineDeploymentMinInstanceInServiceFromMaxBatchSize

func MachineDeploymentMinInstanceInServiceFromMaxBatchSize(maxBatchSize string, workers int) (string, error)

MachineDeploymentMinInstanceInServiceFromMaxBatchSize will calculate the minInstanceInService value for ASG, the value is calculated by subtracting maxBatchSize from the worker count

func MachineDeploymentOnDemandBaseCapacity

func MachineDeploymentOnDemandBaseCapacity(cr infrastructurev1alpha3.AWSMachineDeployment) int

func MachineDeploymentOnDemandPercentageAboveBaseCapacity

func MachineDeploymentOnDemandPercentageAboveBaseCapacity(cr infrastructurev1alpha3.AWSMachineDeployment) int

func MachineDeploymentParseMaxBatchSize

func MachineDeploymentParseMaxBatchSize(val string, workers int) string

MachineDeploymentParseMaxBatchSize will try parse the value into valid maxBatchSize valid values can be either: an integer between 0 < x a float between 0 < x <= 1 float value is used as ratio of a total worker count

func MachineDeploymentPauseTimeIsValid

func MachineDeploymentPauseTimeIsValid(val string) bool

MachineDeploymentPauseTimeIsValid checks if the value is in proper ISO 8601 duration format and ensure that the duration is not bigger than 1 Hour

func MachineDeploymentSpotInstancePools

func MachineDeploymentSpotInstancePools(overrides []template.LaunchTemplateOverride) int

MachineDeploymentSpotInstancePools ensures that the number of spot instance pools we submit to AWS is within AWS limits of more than 0 and less than 21 pools.

func MachineDeploymentWorkerCountRatio

func MachineDeploymentWorkerCountRatio(workers int, ratio float32) string

func ManagedRecordSets

func ManagedRecordSets(cluster infrastructurev1alpha3.AWSCluster) []string

func MasterAvailabilityZone

func MasterAvailabilityZone(cluster infrastructurev1alpha3.AWSCluster) string

func MasterCount

func MasterCount(cluster infrastructurev1alpha3.AWSCluster) int

func MasterInstanceName

func MasterInstanceName(cluster infrastructurev1alpha3.AWSCluster) string

func MasterInstanceResourceName

func MasterInstanceResourceName(cr infrastructurev1alpha3.AWSCluster, t time.Time) string

func MasterInstanceType

func MasterInstanceType(cluster infrastructurev1alpha3.AWSCluster) string

func NATEIPName

func NATEIPName(az string) string

func NATGatewayName

func NATGatewayName(az string) string

func NATRouteName

func NATRouteName(az string) string

func OIDCClientID

func OIDCClientID(cluster infrastructurev1alpha3.AWSCluster) string

func OIDCGroupsClaim

func OIDCGroupsClaim(cluster infrastructurev1alpha3.AWSCluster) string

func OIDCIssuerURL

func OIDCIssuerURL(cluster infrastructurev1alpha3.AWSCluster) string

func OIDCUsernameClaim

func OIDCUsernameClaim(cluster infrastructurev1alpha3.AWSCluster) string

func OSVersion

func OSVersion(release releasev1alpha1.Release) (string, error)

func OperatorVersion

func OperatorVersion(getter LabelsGetter) string

func OrganizationID

func OrganizationID(getter LabelsGetter) string

func PolicyNameMaster

func PolicyNameMaster(cluster infrastructurev1alpha3.AWSCluster) string

func PrivateInternetGatewayRouteName

func PrivateInternetGatewayRouteName(az string) string

func PrivateRouteTableName

func PrivateRouteTableName(az string) string

func PrivateSubnetName

func PrivateSubnetName(az string) string

func PrivateSubnetRouteTableAssociationName

func PrivateSubnetRouteTableAssociationName(az string) string

func ProfileNameMaster

func ProfileNameMaster(cluster infrastructurev1alpha3.AWSCluster) string

func PublicInternetGatewayRouteName

func PublicInternetGatewayRouteName(az string) string

func PublicRouteTableName

func PublicRouteTableName(az string) string

func PublicSubnetName

func PublicSubnetName(az string) string

func PublicSubnetRouteTableAssociationName

func PublicSubnetRouteTableAssociationName(az string) string

func Region

func RegionARN

func RegionARN(region string) string

func ReleaseName

func ReleaseName(releaseVersion string) string

func ReleaseVersion

func ReleaseVersion(getter LabelsGetter) string

func RoleARNMaster

func RoleARNMaster(getter LabelsGetter, region string, accountID string) string

func RoleARNWorker

func RoleARNWorker(getter LabelsGetter, region string, accountID string) string

func RoleNameMaster

func RoleNameMaster(cluster infrastructurev1alpha3.AWSCluster) string

func RolePeerAccess

func RolePeerAccess(cluster infrastructurev1alpha3.AWSCluster) string

func RouteTableName

func RouteTableName(cluster infrastructurev1alpha3.AWSCluster, suffix, az string) string

func S3ObjectPathTCCPN

func S3ObjectPathTCCPN(cr LabelsGetter, id int) string

S3ObjectPathTCCPN computes the S3 object path to the cloud config uploaded for the TCCPN stack. Note that the path is suffixed with the master ID, since Tenant Clusters may be Single Master or HA Masters, where the suffix -0 indicates a Single Master configuration.

version/3.4.0/cloudconfig/v_3_2_5/cluster-al9qy-tccpn-a2wax-2

func S3ObjectPathTCNP

func S3ObjectPathTCNP(getter LabelsGetter) string

S3ObjectPathTCNP computes the S3 object path to the cloud config uploaded for the TCCP stack.

version/3.4.0/cloudconfig/v_3_2_5/cluster-al9qy-tcnp-g3j50

func SSLOnlyBucketPolicy

func SSLOnlyBucketPolicy(bucketName string, region string) string

func SanitizeCFResourceName

func SanitizeCFResourceName(l ...string) string

SanitizeCFResourceName filters out all non-ascii alphanumberics from input string.

SanitizeCFResourceName("abc-123") == "abc123"
SanitizeCFResourceName("abc", "123") == "abc123"
SanitizeCFResourceName("Dear god why? щ(゚Д゚щ)") == "Deargodwhy"

func SecurityGroupName

func SecurityGroupName(getter LabelsGetter, groupName string) string

func ServiceAccountV2SecretName

func ServiceAccountV2SecretName(clusterName string) string

func StackComplete

func StackComplete(status string) bool

func StackInProgress

func StackInProgress(status string) bool

func StackNameTCCP

func StackNameTCCP(getter LabelsGetter) string

func StackNameTCCPF

func StackNameTCCPF(getter LabelsGetter) string

func StackNameTCCPI

func StackNameTCCPI(getter LabelsGetter) string

func StackNameTCCPN

func StackNameTCCPN(getter LabelsGetter) string

func StackNameTCNP

func StackNameTCNP(getter LabelsGetter) string

func StackNameTCNPF

func StackNameTCNPF(getter LabelsGetter) string

func StatusAWSConfigNetworkCIDR

func StatusAWSConfigNetworkCIDR(customObject g8sv1alpha1.AWSConfig) string

func StatusClusterNetworkCIDR

func StatusClusterNetworkCIDR(cluster infrastructurev1alpha3.AWSCluster) string

func TargetLogBucketName

func TargetLogBucketName(getter LabelsGetter, accountID string) string

func TenantClusterBaseDomain

func TenantClusterBaseDomain(cluster infrastructurev1alpha3.AWSCluster) string

func ToCluster

func ToCluster(ctx context.Context, v interface{}) (infrastructurev1alpha3.AWSCluster, error)

func ToControlPlane

func ToControlPlane(v interface{}) (infrastructurev1alpha3.AWSControlPlane, error)

func ToMachineDeployment

func ToMachineDeployment(v interface{}) (infrastructurev1alpha3.AWSMachineDeployment, error)

func VPCPeeringRouteName

func VPCPeeringRouteName(az string) string

func VersionLabelSelector

func VersionLabelSelector(enabled bool, overridenVersion string) string

func VolumeNameDocker

func VolumeNameDocker(cluster infrastructurev1alpha3.AWSCluster) string

func VolumeNameEtcd

func VolumeNameEtcd(cluster infrastructurev1alpha3.AWSCluster) string

func VolumeNameLog

func VolumeNameLog(cluster infrastructurev1alpha3.AWSCluster) string

Types

type AMIInfo

type AMIInfo struct {
	Name string `json:"name"`
	PV   string `json:"pv"`
	HVM  string `json:"hvm"`
}

type AMIInfoList

type AMIInfoList struct {
	AMIs []AMIInfo `json:"amis"`
}

type DeletionTimestampGetter

type DeletionTimestampGetter interface {
	GetDeletionTimestamp() *metav1.Time
}

type LabelsGetter

type LabelsGetter interface {
	GetLabels() map[string]string
}

Jump to

Keyboard shortcuts

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