Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kops 1.25: AWS InstanceGroupSpec.InstanceMetadataOptions.HttpTokens is NOT required by default #16468

Open
xqzhang2015 opened this issue Apr 18, 2024 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@xqzhang2015
Copy link

xqzhang2015 commented Apr 18, 2024

/kind bug

1. What kops version are you running? The command kops version, will display
this information.

$ kops version
Client version: 1.25.4 (git-v1.25.4)

2. What Kubernetes version are you running? kubectl version will print the
version if a cluster is running or provide the Kubernetes version specified as
a kops flag.

$ kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.13", GitCommit:"5244794d27b4cc68290bc496b00e248857ac8b47", GitTreeState:"clean", BuildDate:"2023-08-24T00:01:27Z", GoVersion:"go1.20.7", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.13", GitCommit:"5244794d27b4cc68290bc496b00e248857ac8b47", GitTreeState:"clean", BuildDate:"2023-08-23T23:54:36Z", GoVersion:"go1.20.7", Compiler:"gc", Platform:"linux/amd64"}

3. What cloud provider are you using?
AWS

4. What commands did you run? What is the simplest way to reproduce this issue?

$ cat test.yaml
apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
  labels:
    kops.k8s.io/cluster: xyz
  name: mytest-IG
spec:
  associatePublicIp: false
  cloudLabels:
    K8sClusterType: Kops
    k8s.io/cluster-autoscaler: enabled
  image: ami-0384f963b10435324
  machineType: m5.large
  maxSize: 5
  minSize: 1
  nodeLabels:
    node-role: my-misc
  role: Node
  rootVolumeOptimization: true
  rootVolumeSize: 30
  subnets:
  - us-east-1a
  - us-east-1b
  - us-east-1c
  taints:
  - dedicated=my-misc:NoSchedule

kops create -f test.yaml

5. What happened after the commands executed?

mytest-IG created an AWS instance **without** setting instanceMetadata.httpTokens as required.

6. What did you expect to happen?

if cluster.IsKubernetesGTE("1.22") {

mytest-IG will create an AWS instance **with** setting instanceMetadata.httpTokens as required.

7. Please provide your cluster manifest. Execute
kops get --name my.example.com -o yaml to display your cluster manifest.
You may want to remove your cluster name and other sensitive information.

any k8s cluster

8. Please run the commands with most verbose logging by adding the -v 10 flag.
Paste the logs into this report, or in a gist and provide the gist link here.

maybe not need now, mainly a question to confirm.

9. Anything else do we need to know?

maybe not need now, mainly a question to confirm.
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 18, 2024
@xqzhang2015 xqzhang2015 changed the title kops 1.25: AWS InstanceGroupSpec.InstanceMetadataOptions.HttpTokens is required by default kops 1.25: AWS InstanceGroupSpec.InstanceMetadataOptions.HttpTokens is NOT required by default Apr 18, 2024
@hakman
Copy link
Member

hakman commented Apr 18, 2024

@xqzhang2015 Could you try using the latest kOps release?

@xqzhang2015
Copy link
Author

@hakman Yes, I could.
Here I'm just curious about how the mechanism/code works here(in 1.25), which maybe I don't know about it thoroughly.

@hakman
Copy link
Member

hakman commented Apr 18, 2024

@hakman Yes, I could. Here I'm just curious about how the mechanism/code works here(in 1.25), which maybe I don't know about it thoroughly.

Based on what I see in 1.25 code, should be part of the IG spec. In later kOps versions, it is implicit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants