Documentation ¶
Index ¶
- Constants
- func AddDirectionalGroupRule(c *fi.ModelBuilderContext, t *awstasks.SecurityGroupRule)
- func HybridInstanceGroup(ig *kops.InstanceGroup) bool
- func IAMServiceEC2(region string) string
- func JoinSuffixes(src SecurityGroupInfo, dest SecurityGroupInfo) string
- type APILoadBalancerBuilder
- type AWSModelContext
- type AutoscalingGroupModelBuilder
- type BastionModelBuilder
- type ByScoreDescending
- type DNSModelBuilder
- type ExternalAccessModelBuilder
- type FirewallModelBuilder
- type IAMModelBuilder
- type NetworkModelBuilder
- type NodeTerminationHandlerBuilder
- type OIDCProviderBuilder
- type Protocol
- type SSHKeyModelBuilder
- type SecurityGroupInfo
- type SpotInstanceGroupModelBuilder
Constants ¶
const ( // DefaultVolumeType is the default volume type DefaultVolumeType = ec2.VolumeTypeGp3 // DefaultVolumeIonIops is the default volume IOPS when volume type is io1 or io2 DefaultVolumeIonIops = 100 // DefaultVolumeGp3Iops is the default volume IOPS when volume type is gp3 DefaultVolumeGp3Iops = 3000 // DefaultVolumeGp3Throughput is the default volume throughput when volume type is gp3 DefaultVolumeGp3Throughput = 125 // DefaultVolumeDeleteOnTermination is the default volume behavior after instance termination DefaultVolumeDeleteOnTermination = true // DefaultVolumeEncryption is the default volume encryption behavior DefaultVolumeEncryption = true )
const ( BastionELBSecurityGroupPrefix = "bastion" BastionELBDefaultIdleTimeout = 5 * time.Minute )
const ( NTHTemplate = `` /* 298-byte string literal not displayed */ DefaultMessageRetentionPeriod = 300 )
const ( // SpotInstanceGroupLabelHybrid is the metadata label used on the instance group // to specify that the Spotinst provider should be used to upon creation. SpotInstanceGroupLabelHybrid = "spotinst.io/hybrid" SpotInstanceGroupLabelManaged = "spotinst.io/managed" // for backward compatibility // SpotInstanceGroupLabelSpotPercentage is the metadata label used on the // instance group to specify the percentage of Spot instances that // should spin up from the target capacity. SpotInstanceGroupLabelSpotPercentage = "spotinst.io/spot-percentage" // SpotInstanceGroupLabelOrientation is the metadata label used on the // instance group to specify which orientation should be used. SpotInstanceGroupLabelOrientation = "spotinst.io/orientation" // SpotInstanceGroupLabelUtilizeReservedInstances is the metadata label used // on the instance group to specify whether reserved instances should be // utilized. SpotInstanceGroupLabelUtilizeReservedInstances = "spotinst.io/utilize-reserved-instances" // SpotInstanceGroupLabelFallbackToOnDemand is the metadata label used on the // instance group to specify whether fallback to on-demand instances should // be enabled. SpotInstanceGroupLabelFallbackToOnDemand = "spotinst.io/fallback-to-ondemand" // SpotInstanceGroupLabelDrainingTimeout is the metadata label used on the // instance group to specify a period of time, in seconds, after a node // is marked for termination during which on running pods remains active. SpotInstanceGroupLabelDrainingTimeout = "spotinst.io/draining-timeout" // SpotInstanceGroupLabelGracePeriod is the metadata label used on the // instance group to specify a period of time, in seconds, that Ocean // should wait before applying instance health checks. SpotInstanceGroupLabelGracePeriod = "spotinst.io/grace-period" // SpotInstanceGroupLabelHealthCheckType is the metadata label used on the // instance group to specify the type of the health check that should be used. SpotInstanceGroupLabelHealthCheckType = "spotinst.io/health-check-type" // SpotInstanceGroupLabelOceanDefaultLaunchSpec is the metadata label used on the // instance group to specify whether to use the SpotInstanceGroup's spec as the default // Launch Spec for the Ocean cluster. SpotInstanceGroupLabelOceanDefaultLaunchSpec = "spotinst.io/ocean-default-launchspec" // SpotInstanceGroupLabelOceanInstanceTypes[White|Black]list are the metadata labels // used on the instance group to specify whether to whitelist or blacklist // specific instance types. SpotInstanceGroupLabelOceanInstanceTypesWhitelist = "spotinst.io/ocean-instance-types-whitelist" SpotInstanceGroupLabelOceanInstanceTypesBlacklist = "spotinst.io/ocean-instance-types-blacklist" SpotInstanceGroupLabelOceanInstanceTypes = "spotinst.io/ocean-instance-types" // launchspec // SpotInstanceGroupLabelAutoScalerDisabled is the metadata label used on the // instance group to specify whether the auto scaler should be enabled. SpotInstanceGroupLabelAutoScalerDisabled = "spotinst.io/autoscaler-disabled" // SpotInstanceGroupLabelAutoScalerDefaultNodeLabels is the metadata label used on the // instance group to specify whether default node labels should be set for // the auto scaler. SpotInstanceGroupLabelAutoScalerDefaultNodeLabels = "spotinst.io/autoscaler-default-node-labels" // SpotInstanceGroupLabelAutoScalerAuto* are the metadata labels used on the // instance group to specify whether headroom resources should be // automatically configured and optimized. SpotInstanceGroupLabelAutoScalerAutoConfig = "spotinst.io/autoscaler-auto-config" SpotInstanceGroupLabelAutoScalerAutoHeadroomPercentage = "spotinst.io/autoscaler-auto-headroom-percentage" // SpotInstanceGroupLabelAutoScalerHeadroom* are the metadata labels used on the // instance group to specify the headroom configuration used by the auto scaler. SpotInstanceGroupLabelAutoScalerHeadroomCPUPerUnit = "spotinst.io/autoscaler-headroom-cpu-per-unit" SpotInstanceGroupLabelAutoScalerHeadroomGPUPerUnit = "spotinst.io/autoscaler-headroom-gpu-per-unit" SpotInstanceGroupLabelAutoScalerHeadroomMemPerUnit = "spotinst.io/autoscaler-headroom-mem-per-unit" SpotInstanceGroupLabelAutoScalerHeadroomNumOfUnits = "spotinst.io/autoscaler-headroom-num-of-units" // SpotInstanceGroupLabelAutoScalerCooldown is the metadata label used on the // instance group to specify the cooldown period (in seconds) for scaling actions. SpotInstanceGroupLabelAutoScalerCooldown = "spotinst.io/autoscaler-cooldown" // SpotInstanceGroupLabelAutoScalerScaleDown* are the metadata labels used on the // instance group to specify the scale down configuration used by the auto scaler. SpotInstanceGroupLabelAutoScalerScaleDownMaxPercentage = "spotinst.io/autoscaler-scale-down-max-percentage" SpotInstanceGroupLabelAutoScalerScaleDownEvaluationPeriods = "spotinst.io/autoscaler-scale-down-evaluation-periods" // SpotInstanceGroupLabelAutoScalerResourceLimits* are the metadata labels used on the // instance group to specify the resource limits configuration used by the auto scaler. SpotInstanceGroupLabelAutoScalerResourceLimitsMaxVCPU = "spotinst.io/autoscaler-resource-limits-max-vcpu" SpotInstanceGroupLabelAutoScalerResourceLimitsMaxMemory = "spotinst.io/autoscaler-resource-limits-max-memory" // InstanceGroupLabelRestrictScaleDown is the metadata label used on the // instance group to specify whether the scale-down activities should be restricted. SpotInstanceGroupLabelRestrictScaleDown = "spotinst.io/restrict-scale-down" )
const LoadBalancerDefaultIdleTimeout = 5 * time.Minute
LoadBalancerDefaultIdleTimeout is the default idle time for the ELB
const NodeRolePolicyTemplate = `` /* 177-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func AddDirectionalGroupRule ¶ added in v1.21.0
func AddDirectionalGroupRule(c *fi.ModelBuilderContext, t *awstasks.SecurityGroupRule)
func HybridInstanceGroup ¶ added in v1.20.0
func HybridInstanceGroup(ig *kops.InstanceGroup) bool
HybridInstanceGroup indicates whether the instance group labeled with a metadata label `spotinst.io/hybrid` which means the Spotinst provider should be used to upon creation if the `SpotinstHybrid` feature flag is on.
func IAMServiceEC2 ¶ added in v1.21.0
IAMServiceEC2 returns the name of the IAM service for EC2 in the current region. It is ec2.amazonaws.com in the default aws partition, but different in other isolated/custom partitions
func JoinSuffixes ¶ added in v1.21.0
func JoinSuffixes(src SecurityGroupInfo, dest SecurityGroupInfo) string
JoinSuffixes constructs a suffix for traffic from the src to the dest group We have to avoid ambiguity in the case where one has a suffix and the other does not, where normally l.Suffix + r.Suffix would equal r.Suffix + l.Suffix
Types ¶
type APILoadBalancerBuilder ¶
type APILoadBalancerBuilder struct { *AWSModelContext Lifecycle fi.Lifecycle SecurityLifecycle fi.Lifecycle }
APILoadBalancerBuilder builds a LoadBalancer for accessing the API
func (*APILoadBalancerBuilder) Build ¶
func (b *APILoadBalancerBuilder) Build(c *fi.ModelBuilderContext) error
Build is responsible for building the KubeAPI tasks for the aws model
type AWSModelContext ¶
type AWSModelContext struct {
*model.KopsModelContext
}
AWSModelContext provides the context for the aws model
func (*AWSModelContext) GetSecurityGroups ¶ added in v1.21.0
func (b *AWSModelContext) GetSecurityGroups(role kops.InstanceGroupRole) ([]SecurityGroupInfo, error)
type AutoscalingGroupModelBuilder ¶
type AutoscalingGroupModelBuilder struct { *AWSModelContext BootstrapScriptBuilder *model.BootstrapScriptBuilder Lifecycle fi.Lifecycle SecurityLifecycle fi.Lifecycle Cluster *kops.Cluster }
AutoscalingGroupModelBuilder configures AutoscalingGroup objects
func (*AutoscalingGroupModelBuilder) Build ¶
func (b *AutoscalingGroupModelBuilder) Build(c *fi.ModelBuilderContext) error
Build is responsible for constructing the aws autoscaling group from the kops spec
type BastionModelBuilder ¶ added in v1.20.0
type BastionModelBuilder struct { *AWSModelContext Lifecycle fi.Lifecycle SecurityLifecycle fi.Lifecycle }
func (*BastionModelBuilder) Build ¶ added in v1.20.0
func (b *BastionModelBuilder) Build(c *fi.ModelBuilderContext) error
type ByScoreDescending ¶
type ByScoreDescending []*scoredSubnet
func (ByScoreDescending) Len ¶
func (a ByScoreDescending) Len() int
func (ByScoreDescending) Less ¶
func (a ByScoreDescending) Less(i, j int) bool
func (ByScoreDescending) Swap ¶
func (a ByScoreDescending) Swap(i, j int)
type DNSModelBuilder ¶ added in v1.20.0
type DNSModelBuilder struct { *AWSModelContext Lifecycle fi.Lifecycle }
DNSModelBuilder builds DNS related model objects
func (*DNSModelBuilder) Build ¶ added in v1.20.0
func (b *DNSModelBuilder) Build(c *fi.ModelBuilderContext) error
type ExternalAccessModelBuilder ¶ added in v1.20.0
type ExternalAccessModelBuilder struct { *AWSModelContext Lifecycle fi.Lifecycle }
ExternalAccessModelBuilder configures security group rules for external access (SSHAccess, KubernetesAPIAccess)
func (*ExternalAccessModelBuilder) Build ¶ added in v1.20.0
func (b *ExternalAccessModelBuilder) Build(c *fi.ModelBuilderContext) error
type FirewallModelBuilder ¶ added in v1.21.0
type FirewallModelBuilder struct { *AWSModelContext Lifecycle fi.Lifecycle }
FirewallModelBuilder configures firewall network objects
func (*FirewallModelBuilder) Build ¶ added in v1.21.0
func (b *FirewallModelBuilder) Build(c *fi.ModelBuilderContext) error
type IAMModelBuilder ¶ added in v1.21.0
type IAMModelBuilder struct { *AWSModelContext Lifecycle fi.Lifecycle Cluster *kops.Cluster }
IAMModelBuilder configures IAM objects
func (*IAMModelBuilder) Build ¶ added in v1.21.0
func (b *IAMModelBuilder) Build(c *fi.ModelBuilderContext) error
func (*IAMModelBuilder) BuildServiceAccountRoleTasks ¶ added in v1.21.0
func (b *IAMModelBuilder) BuildServiceAccountRoleTasks(role iam.Subject, c *fi.ModelBuilderContext) (*awstasks.IAMRole, error)
BuildServiceAccountRoleTasks build tasks specifically for the ServiceAccount role.
func (*IAMModelBuilder) FindDeletions ¶ added in v1.21.0
func (b *IAMModelBuilder) FindDeletions(context *fi.ModelBuilderContext, cloud fi.Cloud) error
type NetworkModelBuilder ¶ added in v1.21.0
type NetworkModelBuilder struct { *AWSModelContext Lifecycle fi.Lifecycle }
NetworkModelBuilder configures network objects
func (*NetworkModelBuilder) Build ¶ added in v1.21.0
func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error
type NodeTerminationHandlerBuilder ¶ added in v1.21.0
type NodeTerminationHandlerBuilder struct { *AWSModelContext Lifecycle fi.Lifecycle }
func (*NodeTerminationHandlerBuilder) Build ¶ added in v1.21.0
func (b *NodeTerminationHandlerBuilder) Build(c *fi.ModelBuilderContext) error
type OIDCProviderBuilder ¶ added in v1.19.0
type OIDCProviderBuilder struct { *AWSModelContext KeyStore fi.Keystore Lifecycle fi.Lifecycle }
OIDCProviderBuilder configures IAM OIDC Provider
func (*OIDCProviderBuilder) Build ¶ added in v1.19.0
func (b *OIDCProviderBuilder) Build(c *fi.ModelBuilderContext) error
type SSHKeyModelBuilder ¶ added in v1.21.0
type SSHKeyModelBuilder struct { *AWSModelContext Lifecycle fi.Lifecycle }
SSHKeyModelBuilder configures SSH objects
func (*SSHKeyModelBuilder) Build ¶ added in v1.21.0
func (b *SSHKeyModelBuilder) Build(c *fi.ModelBuilderContext) error
type SecurityGroupInfo ¶ added in v1.21.0
type SecurityGroupInfo struct { Name string Suffix string Task *awstasks.SecurityGroup }
type SpotInstanceGroupModelBuilder ¶ added in v1.20.0
type SpotInstanceGroupModelBuilder struct { *AWSModelContext BootstrapScriptBuilder *model.BootstrapScriptBuilder Lifecycle fi.Lifecycle SecurityLifecycle fi.Lifecycle }
SpotInstanceGroupModelBuilder configures SpotInstanceGroup objects
func (*SpotInstanceGroupModelBuilder) Build ¶ added in v1.20.0
func (b *SpotInstanceGroupModelBuilder) Build(c *fi.ModelBuilderContext) error