Skip to content

Commit

Permalink
Merge branch 'staging/v1' into create-v1-api
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam committed Jun 20, 2024
2 parents 5d8bf10 + fd16a9a commit d7c0db0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions pkg/apis/crds/karpenter.k8s.aws_ec2nodeclasses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ spec:
default:
httpEndpoint: enabled
httpProtocolIPv6: disabled
httpPutResponseHopLimit: 2
httpPutResponseHopLimit: 1
httpTokens: required
description: |-
MetadataOptions for the generated launch template of provisioned nodes.
Expand All @@ -262,7 +262,7 @@ spec:
(https://aws.github.io/aws-eks-best-practices/security/docs/iam/#restrict-access-to-the-instance-profile-assigned-to-the-worker-node)
for limiting exposure of Instance Metadata and User Data to pods.
If omitted, defaults to httpEndpoint enabled, with httpProtocolIPv6
disabled, with httpPutResponseLimit of 2, and with httpTokens
disabled, with httpPutResponseLimit of 1, and with httpTokens
required.
properties:
httpEndpoint:
Expand Down Expand Up @@ -290,13 +290,13 @@ spec:
- disabled
type: string
httpPutResponseHopLimit:
default: 2
default: 1
description: |-
HTTPPutResponseHopLimit is the desired HTTP PUT response hop limit for
instance metadata requests. The larger the number, the further instance
metadata requests can travel. Possible values are integers from 1 to 64.
If metadata options is non-nil, but this parameter is not specified, the
default value is 2.
default value is 1.
format: int64
maximum: 64
minimum: 1
Expand Down Expand Up @@ -848,7 +848,7 @@ spec:
default:
httpEndpoint: enabled
httpProtocolIPv6: disabled
httpPutResponseHopLimit: 2
httpPutResponseHopLimit: 1
httpTokens: required
description: |-
MetadataOptions for the generated launch template of provisioned nodes.
Expand All @@ -865,7 +865,7 @@ spec:
(https://aws.github.io/aws-eks-best-practices/security/docs/iam/#restrict-access-to-the-instance-profile-assigned-to-the-worker-node)
for limiting exposure of Instance Metadata and User Data to pods.
If omitted, defaults to httpEndpoint enabled, with httpProtocolIPv6
disabled, with httpPutResponseLimit of 2, and with httpTokens
disabled, with httpPutResponseLimit of 1, and with httpTokens
required.
properties:
httpEndpoint:
Expand Down
8 changes: 4 additions & 4 deletions pkg/apis/v1/ec2nodeclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ type EC2NodeClassSpec struct {
// (https://aws.github.io/aws-eks-best-practices/security/docs/iam/#restrict-access-to-the-instance-profile-assigned-to-the-worker-node)
// for limiting exposure of Instance Metadata and User Data to pods.
// If omitted, defaults to httpEndpoint enabled, with httpProtocolIPv6
// disabled, with httpPutResponseLimit of 2, and with httpTokens
// disabled, with httpPutResponseLimit of 1, and with httpTokens
// required.
// +kubebuilder:default={"httpEndpoint":"enabled","httpProtocolIPv6":"disabled","httpPutResponseHopLimit":2,"httpTokens":"required"}
// +kubebuilder:default={"httpEndpoint":"enabled","httpProtocolIPv6":"disabled","httpPutResponseHopLimit":1,"httpTokens":"required"}
// +optional
MetadataOptions *MetadataOptions `json:"metadataOptions,omitempty"`
// Context is a Reserved field in EC2 APIs
Expand Down Expand Up @@ -199,8 +199,8 @@ type MetadataOptions struct {
// instance metadata requests. The larger the number, the further instance
// metadata requests can travel. Possible values are integers from 1 to 64.
// If metadata options is non-nil, but this parameter is not specified, the
// default value is 2.
// +kubebuilder:default=2
// default value is 1.
// +kubebuilder:default=1
// +kubebuilder:validation:Minimum:=1
// +kubebuilder:validation:Maximum:=64
// +optional
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/v1beta1/ec2nodeclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ type EC2NodeClassSpec struct {
// (https://aws.github.io/aws-eks-best-practices/security/docs/iam/#restrict-access-to-the-instance-profile-assigned-to-the-worker-node)
// for limiting exposure of Instance Metadata and User Data to pods.
// If omitted, defaults to httpEndpoint enabled, with httpProtocolIPv6
// disabled, with httpPutResponseLimit of 2, and with httpTokens
// disabled, with httpPutResponseLimit of 1, and with httpTokens
// required.
// +kubebuilder:default={"httpEndpoint":"enabled","httpProtocolIPv6":"disabled","httpPutResponseHopLimit":2,"httpTokens":"required"}
// +kubebuilder:default={"httpEndpoint":"enabled","httpProtocolIPv6":"disabled","httpPutResponseHopLimit":1,"httpTokens":"required"}
// +optional
MetadataOptions *MetadataOptions `json:"metadataOptions,omitempty"`
// Context is a Reserved field in EC2 APIs
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/instancetype/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2175,7 +2175,7 @@ var _ = Describe("InstanceTypeProvider", func() {
awsEnv.EC2API.CalledWithCreateLaunchTemplateInput.ForEach(func(ltInput *ec2.CreateLaunchTemplateInput) {
Expect(*ltInput.LaunchTemplateData.MetadataOptions.HttpEndpoint).To(Equal(ec2.LaunchTemplateInstanceMetadataEndpointStateEnabled))
Expect(*ltInput.LaunchTemplateData.MetadataOptions.HttpProtocolIpv6).To(Equal(ec2.LaunchTemplateInstanceMetadataProtocolIpv6Disabled))
Expect(*ltInput.LaunchTemplateData.MetadataOptions.HttpPutResponseHopLimit).To(Equal(int64(2)))
Expect(*ltInput.LaunchTemplateData.MetadataOptions.HttpPutResponseHopLimit).To(Equal(int64(1)))
Expect(*ltInput.LaunchTemplateData.MetadataOptions.HttpTokens).To(Equal(ec2.LaunchTemplateHttpTokensStateRequired))
})
})
Expand Down

0 comments on commit d7c0db0

Please sign in to comment.