alimodel

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoadBalancerListenerStatus    = "running"
	LoadBalancerListenerBandwidth = -1
)
View Source
const (
	IpProtocolTCP = "tcp"
	IpProtocolUDP = "udp"
)
View Source
const CloudTagInstanceGroupRolePrefix = "k8s.io/role/"
View Source
const DefaultInstanceType = "ecs.n2.medium"
View Source
const DefaultVolumeType = "cloud_ssd"
View Source
const IpProtocolAll = "all"
View Source
const PolicyDefaultVersion = "1"

PolicyDefaultVersion is the default version included in all policy documents

View Source
const PolicyType = string(ram.Custom)

Variables

This section is empty.

Functions

This section is empty.

Types

type ALIModelContext

type ALIModelContext struct {
	*model.KopsModelContext
}

func (*ALIModelContext) CloudTagsForInstanceGroup

func (c *ALIModelContext) CloudTagsForInstanceGroup(ig *kops.InstanceGroup) (map[string]string, error)

CloudTagsForInstanceGroup computes the tags to apply to instances in the specified InstanceGroup Copy from context.go, adjust parameters length to meet AliCloud requirements

func (*ALIModelContext) GetNameForEIP added in v1.15.1

func (c *ALIModelContext) GetNameForEIP() string

func (*ALIModelContext) GetNameForLoadBalancer

func (c *ALIModelContext) GetNameForLoadBalancer() string

func (*ALIModelContext) GetNameForNatGateway added in v1.15.1

func (c *ALIModelContext) GetNameForNatGateway() string

func (*ALIModelContext) GetNameForRAM

func (c *ALIModelContext) GetNameForRAM(role kops.InstanceGroupRole) string

func (*ALIModelContext) GetNameForSSHKey

func (c *ALIModelContext) GetNameForSSHKey() string

func (*ALIModelContext) GetNameForSecurityGroup

func (c *ALIModelContext) GetNameForSecurityGroup(role kops.InstanceGroupRole) string

func (*ALIModelContext) GetNameForVPC

func (c *ALIModelContext) GetNameForVPC() string

func (*ALIModelContext) GetNameForVSwitch

func (c *ALIModelContext) GetNameForVSwitch(subnetName string) string

func (*ALIModelContext) GetNameForVSwitchSNAT added in v1.15.1

func (c *ALIModelContext) GetNameForVSwitchSNAT(subnetName string) string

func (*ALIModelContext) GetScalingGroupName

func (c *ALIModelContext) GetScalingGroupName(ig *kops.InstanceGroup) string

func (*ALIModelContext) GetUtilitySubnets added in v1.18.0

func (c *ALIModelContext) GetUtilitySubnets() []*kops.ClusterSubnetSpec

func (*ALIModelContext) LinkLoadBalancer

func (c *ALIModelContext) LinkLoadBalancer() *alitasks.LoadBalancer

LinkLoadBalancer returns the LoadBalancer object the cluster is located in

func (*ALIModelContext) LinkToEIP added in v1.15.1

func (c *ALIModelContext) LinkToEIP() *alitasks.EIP

LinkToEIP returns the EIP object the NateGatway is associated to

func (*ALIModelContext) LinkToNatGateway added in v1.15.1

func (c *ALIModelContext) LinkToNatGateway() *alitasks.NatGateway

LinkToNateGateway returns the NatGateway object the cluster is located in

func (*ALIModelContext) LinkToRAMRole

func (c *ALIModelContext) LinkToRAMRole(role kops.InstanceGroupRole) *alitasks.RAMRole

func (*ALIModelContext) LinkToSSHKey

func (c *ALIModelContext) LinkToSSHKey() *alitasks.SSHKey

func (*ALIModelContext) LinkToScalingGroup

func (c *ALIModelContext) LinkToScalingGroup(ig *kops.InstanceGroup) *alitasks.ScalingGroup

func (*ALIModelContext) LinkToSecurityGroup

func (c *ALIModelContext) LinkToSecurityGroup(role kops.InstanceGroupRole) *alitasks.SecurityGroup

LinkToSecurityGroup returns the SecurityGroup with specific name

func (*ALIModelContext) LinkToVPC

func (c *ALIModelContext) LinkToVPC() *alitasks.VPC

LinkToVPC returns the VPC object the cluster is located in

func (*ALIModelContext) LinkToVSwitch

func (c *ALIModelContext) LinkToVSwitch(subnetName string) *alitasks.VSwitch

LinkToVSwitch returns the VSwitch object the cluster is located in

func (*ALIModelContext) LinkToVSwitchSNAT added in v1.15.1

func (c *ALIModelContext) LinkToVSwitchSNAT(subnetName string) *alitasks.VSwitch

LinkToVSwitchSNAT returns the VSwitchSNAT object the cluster is located in

type APILoadBalancerModelBuilder

type APILoadBalancerModelBuilder struct {
	*ALIModelContext
	Lifecycle *fi.Lifecycle
}

APILoadBalancerModelBuilder builds a LoadBalancer for accessing the API

func (*APILoadBalancerModelBuilder) Build

type AssumeRolePolicyDocument

type AssumeRolePolicyDocument struct {
	Statement []AssumeRolePolicyItem
	Version   string
}

type AssumeRolePolicyItem

type AssumeRolePolicyItem struct {
	Action    string
	Effect    string
	Principal AssumeRolePolicyPrincpal
}

type AssumeRolePolicyPrincpal

type AssumeRolePolicyPrincpal struct {
	Service []string
}

type Condition added in v1.18.0

type Condition map[string]interface{}

Condition is a map of Conditions to be evaluated for a given RAM Statement

type ExternalAccessModelBuilder

type ExternalAccessModelBuilder struct {
	*ALIModelContext
	Lifecycle *fi.Lifecycle
}

ExternalAccessModelBuilder configures security group rules for external access (SSHAccess, KubernetesAPIAccess)

func (*ExternalAccessModelBuilder) Build

type FirewallModelBuilder

type FirewallModelBuilder struct {
	*ALIModelContext
	Lifecycle *fi.Lifecycle
}

FirewallModelBuilder configures firewall network objects

func (*FirewallModelBuilder) Build

type NetworkModelBuilder added in v1.15.1

type NetworkModelBuilder struct {
	*ALIModelContext
	Lifecycle *fi.Lifecycle
}

NetworkModelBuilder configures VPC network objects

func (*NetworkModelBuilder) Build added in v1.15.1

type Policy added in v1.18.0

type Policy struct {
	Version   string
	Statement []*Statement
}

Policy Struct is a collection of fields that form a valid Alicloud policy document

func (*Policy) AsJSON added in v1.18.0

func (p *Policy) AsJSON() (string, error)

AsJSON converts the policy document to JSON format (parsable by Alicloud)

type PolicyBuilder added in v1.18.0

type PolicyBuilder struct {
	Cluster      *kops.Cluster
	HostedZoneID string
	KMSKeys      []string
	Region       string
	ResourceARN  *string
	Role         kops.InstanceGroupRole
}

PolicyBuilder struct defines all valid fields to be used when building the Alicloud RAM policy document for a given instance group role.

func (*PolicyBuilder) AddOSSPermissions added in v1.18.0

func (b *PolicyBuilder) AddOSSPermissions(p *Policy) (*Policy, error)

AddOSSPermissions updates an RAM Policy with statements granting tailored access to OSS assets, depending on the instance group role

func (*PolicyBuilder) BuildAlicloudPolicy added in v1.18.0

func (b *PolicyBuilder) BuildAlicloudPolicy() (*Policy, error)

BuildAlicloudPolicy builds a set of RAM policy statements based on the instance group type.

func (*PolicyBuilder) BuildAlicloudPolicyMaster added in v1.18.0

func (b *PolicyBuilder) BuildAlicloudPolicyMaster() (*Policy, error)

BuildAlicloudPolicyMaster generates a custom policy for a Kubernetes master.

func (*PolicyBuilder) BuildAlicloudPolicyNode added in v1.18.0

func (b *PolicyBuilder) BuildAlicloudPolicyNode() (*Policy, error)

BuildAlicloudPolicyNode generates a custom policy for a Kubernetes node.

func (*PolicyBuilder) RAMPrefix added in v1.18.0

func (b *PolicyBuilder) RAMPrefix() string

RAMPrefix returns the prefix for Alicloud ARNs in the current region, for use with RAM It is arn everywhere for now

type PolicyResource added in v1.18.0

type PolicyResource struct {
	Builder *PolicyBuilder
}

PolicyResource defines the PolicyBuilder and DNSZone to use when building the RAM policy document for a given instance group role

func (*PolicyResource) GetDependencies added in v1.18.0

func (b *PolicyResource) GetDependencies(tasks map[string]fi.Task) []fi.Task

GetDependencies adds the DNSZone task to the list of dependencies if set

func (*PolicyResource) Open added in v1.18.0

func (b *PolicyResource) Open() (io.Reader, error)

Open produces the Alicloud RAM policy for the given role

type RAMModelBuilder

type RAMModelBuilder struct {
	*ALIModelContext

	Lifecycle *fi.Lifecycle
}

func (*RAMModelBuilder) Build

func (*RAMModelBuilder) CreateAssumeRolePolicyDocument added in v1.18.0

func (b *RAMModelBuilder) CreateAssumeRolePolicyDocument() string

func (*RAMModelBuilder) CreatePolicyDocument

func (b *RAMModelBuilder) CreatePolicyDocument() string

type SSHKeyModelBuilder

type SSHKeyModelBuilder struct {
	*ALIModelContext
	Lifecycle *fi.Lifecycle
}

SSHKeyModelBuilder configures SSH objects

func (*SSHKeyModelBuilder) Build

type ScalingGroupModelBuilder

type ScalingGroupModelBuilder struct {
	*ALIModelContext

	BootstrapScriptBuilder *model.BootstrapScriptBuilder
	Lifecycle              *fi.Lifecycle
	SecurityLifecycle      *fi.Lifecycle
}

ScalingGroupModelBuilder configures ScalingGroup objects

func (*ScalingGroupModelBuilder) Build

type Statement added in v1.18.0

type Statement struct {
	Effect    StatementEffect
	Action    stringorslice.StringOrSlice
	Resource  stringorslice.StringOrSlice
	Condition Condition `json:",omitempty"`
}

Statement is an Alicloud RAM Policy Statement Object: https://https://help.aliyun.com/document_detail/93739.html

type StatementEffect added in v1.18.0

type StatementEffect string

StatementEffect is required and specifies what type of access the statement results in

const StatementEffectAllow StatementEffect = "Allow"

StatementEffectAllow allows access for the given resources in the statement (based on conditions)

const StatementEffectDeny StatementEffect = "Deny"

StatementEffectDeny allows access for the given resources in the statement (based on conditions)

Jump to

Keyboard shortcuts

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