Skip to content

Commit

Permalink
Add references to launch templates from EKS node groups
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Snyder <[email protected]>
  • Loading branch information
oblogic7 committed Aug 29, 2023
1 parent 0ed87f9 commit 50a1c3f
Show file tree
Hide file tree
Showing 5 changed files with 244 additions and 24 deletions.
30 changes: 20 additions & 10 deletions apis/eks/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions apis/eks/v1beta1/zz_generated.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 22 additions & 6 deletions apis/eks/v1beta1/zz_nodegroup_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions config/eks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ func Configure(p *config.Provider) { // nolint:gocyclo
RefFieldName: "SubnetIDRefs",
SelectorFieldName: "SubnetIDSelector",
}
r.References["launch_template.id"] = config.Reference{
Type: "github.com/upbound/provider-aws/apis/ec2/v1beta1.LaunchTemplate",
RefFieldName: "LaunchTemplateIDRefs",
SelectorFieldName: "LaunchTemplateIDSelector",
}
r.References["launch_template.name"] = config.Reference{
Type: "github.com/upbound/provider-aws/apis/ec2/v1beta1.LaunchTemplate",
RefFieldName: "LaunchTemplateNameRefs",
SelectorFieldName: "LaunchTemplateNameSelector",
}
r.UseAsync = true
r.MetaResource.ArgumentDocs["launch_template.version"] = `- (Required) EC2 Launch Template version number. While the API accepts values like $Default and $Latest, the API will convert the value to the associated version number (e.g., 1). Using the default_version or latest_version attribute of the aws_launch_template resource or data source is recommended for this argument.`
r.MetaResource.ArgumentDocs["subnet_ids"] = `- Identifiers of EC2 Subnets to associate with the EKS Node Group. Amazon EKS managed node groups can be launched in both public and private subnets. If you plan to deploy load balancers to a subnet, the private subnet must have tag kubernetes.io/role/internal-elb, the public subnet must have tag kubernetes.io/role/elb.`
Expand Down
164 changes: 156 additions & 8 deletions package/crds/eks.aws.upbound.io_nodegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,162 @@ spec:
description: Identifier of the EC2 Launch Template. Conflicts
with name.
type: string
launchTemplateIdRefs:
description: Reference to a LaunchTemplate in ec2 to populate
id.
properties:
name:
description: Name of the referenced object.
type: string
policy:
description: Policies for referencing.
properties:
resolution:
default: Required
description: Resolution specifies whether resolution
of this reference is required. The default is
'Required', which means the reconcile will fail
if the reference cannot be resolved. 'Optional'
means this reference will be a no-op if it cannot
be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: Resolve specifies when this reference
should be resolved. The default is 'IfNotPresent',
which will attempt to resolve the reference only
when the corresponding field is not present. Use
'Always' to resolve the reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
required:
- name
type: object
launchTemplateIdSelector:
description: Selector for a LaunchTemplate in ec2 to populate
id.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with
the same controller reference as the selecting object
is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching
labels is selected.
type: object
policy:
description: Policies for selection.
properties:
resolution:
default: Required
description: Resolution specifies whether resolution
of this reference is required. The default is
'Required', which means the reconcile will fail
if the reference cannot be resolved. 'Optional'
means this reference will be a no-op if it cannot
be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: Resolve specifies when this reference
should be resolved. The default is 'IfNotPresent',
which will attempt to resolve the reference only
when the corresponding field is not present. Use
'Always' to resolve the reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
type: object
launchTemplateNameRefs:
description: Reference to a LaunchTemplate in ec2 to populate
name.
properties:
name:
description: Name of the referenced object.
type: string
policy:
description: Policies for referencing.
properties:
resolution:
default: Required
description: Resolution specifies whether resolution
of this reference is required. The default is
'Required', which means the reconcile will fail
if the reference cannot be resolved. 'Optional'
means this reference will be a no-op if it cannot
be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: Resolve specifies when this reference
should be resolved. The default is 'IfNotPresent',
which will attempt to resolve the reference only
when the corresponding field is not present. Use
'Always' to resolve the reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
required:
- name
type: object
launchTemplateNameSelector:
description: Selector for a LaunchTemplate in ec2 to populate
name.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with
the same controller reference as the selecting object
is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching
labels is selected.
type: object
policy:
description: Policies for selection.
properties:
resolution:
default: Required
description: Resolution specifies whether resolution
of this reference is required. The default is
'Required', which means the reconcile will fail
if the reference cannot be resolved. 'Optional'
means this reference will be a no-op if it cannot
be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: Resolve specifies when this reference
should be resolved. The default is 'IfNotPresent',
which will attempt to resolve the reference only
when the corresponding field is not present. Use
'Always' to resolve the reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
type: object
name:
description: Name of the EC2 Launch Template. Conflicts
with id.
Expand Down Expand Up @@ -658,14 +814,6 @@ spec:
Detailed below.
items:
properties:
id:
description: Identifier of the EC2 Launch Template. Conflicts
with name.
type: string
name:
description: Name of the EC2 Launch Template. Conflicts
with id.
type: string
version:
description: EC2 Launch Template version number. While the
API accepts values like $Default and $Latest, the API
Expand Down

0 comments on commit 50a1c3f

Please sign in to comment.