$ export KARPENTER_NAMESPACE="karpenter"
$ export KARPENTER_VERSION="1.6.3"
$ export K8S_VERSION="1.33"
$ export AWS_PARTITION=$(aws sts get-caller-identity --query "Arn" | cut -d: -f2)
$ export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
$ export AWS_DEFAULT_REGION="us-west-2"
$ export CLUSTER_NAME="niikawa-karpenter-demo"
$ export VPC_ID="vpc-0a7b230729923d078"
$ export AWS_AVAILABILITY_ZONE_A="us-west-2a"
$ export AWS_AVAILABILITY_ZONE_B="us-west-2b"
$ export PRIVATE_SUBNET_A_ID="subnet-078769ea3a250f04f"
$ export PRIVATE_SUBNET_B_ID="subnet-0d5c6423d30407c1c"
$ export PUBLIC_SUBNET_A_ID="subnet-02505e6f42011d08b"
$ export PUBLIC_SUBNET_B_ID="subnet-004f6c6d374b5a3e4"
$ export KMS_KEY_ID="arn:aws:kms:us-west-2:111111111111:key/1a99192c-4362-40ac-b96c-02c7274e8d96"
$ cat << EOF > karpenter-cluster-customize.yaml
** 前述のYAMLをここに貼りつけ **
← EOFを入力
$ eksctl create cluster -f karpenter-cluster-customize.yaml
2025-09-15 14:49:52 [ℹ] eksctl version 0.214.0
2025-09-15 14:49:52 [ℹ] using region us-west-2
2025-09-15 14:49:52 [✔] using existing VPC (vpc-0a7b230729923d078) and subnets (private:map[us-west-2a:{subnet-078769ea3a250f04f us-west-2a 10.100.0.128/26 0 } us-west-2b:{subnet-0d5c6423d30407c1c us-west-2b 10.100.0.192/26 0 }] public:map[us-west-2a:{subnet-02505e6f42011d08b us-west-2a 10.100.0.0/27 0 } us-west-2b:{subnet-004f6c6d374b5a3e4 us-west-2b 10.100.0.32/27 0 }])
2025-09-15 14:49:52 [!] custom VPC/subnets will be used; if resulting cluster doesn't function as expected, make sure to review the configuration of VPC/subnets
2025-09-15 14:49:52 [ℹ] nodegroup "niikawa-karpenter-demo-ng" will use "" [AmazonLinux2023/1.33]
2025-09-15 14:49:52 [ℹ] using Kubernetes version 1.33
2025-09-15 14:49:52 [ℹ] creating EKS cluster "niikawa-karpenter-demo" in "us-west-2" region with managed nodes
2025-09-15 14:49:52 [ℹ] 1 nodegroup (niikawa-karpenter-demo-ng) was included (based on the include/exclude rules)
2025-09-15 14:49:52 [ℹ] will create a CloudFormation stack for cluster itself and 1 managed nodegroup stack(s)
2025-09-15 14:49:52 [ℹ] if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-west-2 --cluster=niikawa-karpenter-demo'
2025-09-15 14:49:52 [ℹ] Kubernetes API endpoint access will use default of {publicAccess=true, privateAccess=false} for cluster "niikawa-karpenter-demo" in "us-west-2"
2025-09-15 14:49:52 [ℹ] CloudWatch logging will not be enabled for cluster "niikawa-karpenter-demo" in "us-west-2"
2025-09-15 14:49:52 [ℹ] you can enable it with 'eksctl utils update-cluster-logging --enable-types={SPECIFY-YOUR-LOG-TYPES-HERE (e.g. all)} --region=us-west-2 --cluster=niikawa-karpenter-demo'
2025-09-15 14:49:52 [ℹ] default addons metrics-server were not specified, will install them as EKS addons
2025-09-15 14:49:52 [ℹ]
2 sequential tasks: { create cluster control plane "niikawa-karpenter-demo",
2 sequential sub-tasks: {
6 sequential sub-tasks: {
1 task: { create addons },
wait for control plane to become ready,
associate IAM OIDC provider,
no tasks,
update VPC CNI to use IRSA if required,
create IAM identity mappings,
},
create managed nodegroup "niikawa-karpenter-demo-ng",
}
}
2025-09-15 14:49:52 [ℹ] building cluster stack "eksctl-niikawa-karpenter-demo-cluster"
2025-09-15 14:49:53 [ℹ] deploying stack "eksctl-niikawa-karpenter-demo-cluster"
2025-09-15 14:50:23 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-cluster"
2025-09-15 14:50:53 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-cluster"
2025-09-15 14:51:53 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-cluster"
2025-09-15 14:52:53 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-cluster"
2025-09-15 14:53:53 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-cluster"
2025-09-15 14:54:53 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-cluster"
2025-09-15 14:55:53 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-cluster"
2025-09-15 14:56:53 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-cluster"
2025-09-15 14:57:53 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-cluster"
2025-09-15 14:57:55 [ℹ] creating addon: eks-pod-identity-agent
2025-09-15 14:57:55 [ℹ] successfully created addon: eks-pod-identity-agent
2025-09-15 14:57:56 [!] recommended policies were found for "vpc-cni" addon, but since OIDC is disabled on the cluster, eksctl cannot configure the requested permissions; the recommended way to provide IAM permissions for "vpc-cni" addon is via pod identity associations; after addon creation is completed, add all recommended policies to the config file, under `addon.PodIdentityAssociations`, and run `eksctl update addon`
2025-09-15 14:57:56 [ℹ] creating addon: vpc-cni
2025-09-15 14:57:56 [ℹ] successfully created addon: vpc-cni
2025-09-15 14:57:57 [ℹ] creating addon: kube-proxy
2025-09-15 14:57:57 [ℹ] successfully created addon: kube-proxy
2025-09-15 14:57:57 [ℹ] creating addon: coredns
2025-09-15 14:57:58 [ℹ] successfully created addon: coredns
2025-09-15 14:57:58 [ℹ] creating addon: metrics-server
2025-09-15 14:57:58 [ℹ] successfully created addon: metrics-server
2025-09-15 14:59:59 [ℹ] addon "vpc-cni" active
2025-09-15 15:00:00 [ℹ] deploying stack "eksctl-niikawa-karpenter-demo-addon-vpc-cni"
2025-09-15 15:00:00 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-addon-vpc-cni"
2025-09-15 15:00:30 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-addon-vpc-cni"
2025-09-15 15:00:31 [ℹ] updating addon
2025-09-15 15:00:41 [ℹ] addon "vpc-cni" active
2025-09-15 15:00:41 [ℹ] checking arn arn:aws:iam::111111111111:role/KarpenterNodeRole-niikawa-karpenter-demo against entries in the auth ConfigMap
2025-09-15 15:00:41 [ℹ] adding identity "arn:aws:iam::111111111111:role/KarpenterNodeRole-niikawa-karpenter-demo" to auth ConfigMap
2025-09-15 15:00:42 [ℹ] building managed nodegroup stack "eksctl-niikawa-karpenter-demo-nodegroup-niikawa-karpenter-demo-ng"
2025-09-15 15:00:42 [ℹ] deploying stack "eksctl-niikawa-karpenter-demo-nodegroup-niikawa-karpenter-demo-ng"
2025-09-15 15:00:42 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-nodegroup-niikawa-karpenter-demo-ng"
2025-09-15 15:01:12 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-nodegroup-niikawa-karpenter-demo-ng"
2025-09-15 15:01:56 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-nodegroup-niikawa-karpenter-demo-ng"
2025-09-15 15:03:27 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-nodegroup-niikawa-karpenter-demo-ng"
2025-09-15 15:03:27 [ℹ] waiting for the control plane to become ready
2025-09-15 15:03:27 [✔] saved kubeconfig as "/home/cloudshell-user/.kube/config"
2025-09-15 15:03:27 [ℹ] no tasks
2025-09-15 15:03:27 [✔] all EKS cluster resources for "niikawa-karpenter-demo" have been created
2025-09-15 15:03:27 [ℹ] nodegroup "niikawa-karpenter-demo-ng" has 2 node(s)
2025-09-15 15:03:27 [ℹ] node "ip-10-100-0-188.us-west-2.compute.internal" is ready
2025-09-15 15:03:27 [ℹ] node "ip-10-100-0-254.us-west-2.compute.internal" is ready
2025-09-15 15:03:27 [ℹ] waiting for at least 1 node(s) to become ready in "niikawa-karpenter-demo-ng"
2025-09-15 15:03:27 [ℹ] nodegroup "niikawa-karpenter-demo-ng" has 2 node(s)
2025-09-15 15:03:27 [ℹ] node "ip-10-100-0-188.us-west-2.compute.internal" is ready
2025-09-15 15:03:27 [ℹ] node "ip-10-100-0-254.us-west-2.compute.internal" is ready
2025-09-15 15:03:27 [✔] created 1 managed nodegroup(s) in cluster "niikawa-karpenter-demo"
2025-09-15 15:03:28 [!] IAM permissions are required for "amazon-cloudwatch-observability" addon; the recommended way to provide IAM permissions for "amazon-cloudwatch-observability" addon is via pod identity associations; after addon creation is completed, add all recommended policies to the config file, under `addon.PodIdentityAssociations`, and run `eksctl update addon`
2025-09-15 15:03:28 [ℹ] creating addon: amazon-cloudwatch-observability
2025-09-15 15:04:11 [ℹ] addon "amazon-cloudwatch-observability" active
2025-09-15 15:04:11 [ℹ] 1 task: {
2 sequential sub-tasks: {
create IAM role for pod identity association for service account "karpenter/karpenter",
create pod identity association for service account "karpenter/karpenter",
} }2025-09-15 15:04:11 [ℹ] deploying stack "eksctl-niikawa-karpenter-demo-podidentityrole-karpenter-karpenter"
2025-09-15 15:04:11 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-podidentityrole-karpenter-karpenter"
2025-09-15 15:04:41 [ℹ] waiting for CloudFormation stack "eksctl-niikawa-karpenter-demo-podidentityrole-karpenter-karpenter"
2025-09-15 15:04:42 [ℹ] created pod identity association for service account "karpenter" in namespace "karpenter"
2025-09-15 15:04:42 [ℹ] all tasks were completed successfully
2025-09-15 15:04:44 [ℹ] kubectl command should work with "/home/cloudshell-user/.kube/config", try 'kubectl get nodes'
2025-09-15 15:04:44 [✔] EKS cluster "niikawa-karpenter-demo" in "us-west-2" region is ready
~ $