Closed vladimirkus closed 3 years ago
Just to confirm, your cluster name begins with 208
?
Was this working in kOps 1.20 or is this a brand new cluster in kOps 1.21? As the error suggests, terraform no longer allows resource names to begin with digits. Looking at some test outputs, the AWS resource types that use names that are just the cluster name are:
aws_vpc
aws_vpc_dhcp_options
aws_vpc_dhcp_options_association
aws_iam_openid_connect_provider
aws_internet_gateway
aws_route_table
- this is only the public route table, we could rename this to public-$clustername
to match the private route table resource namesaws_s3_bucket_object
- these are new in kOps 1.22 so we'll likely need to address them the same way as the others@rifelpet, yes, cluster name begins with 208
.
Cluster was working on kOps 1.20 before, it's a pretty old cluster that is up from 1.17
Without adding IRSA configuration to cluster config kops update
runs well, because of that I got the impression that this issue may be connected to the resources that participate in IRSA support.
I see, so the solution may be to add prefixes to the resource names for the resource types that use names that are just the cluster name. In this exact case aws_iam_openid_connect_provider
.
Yes, one option is we add a prefix to each terraform resource name that would otherwise begin with the cluster name. I opened a PR linked above that demonstrates the problem and will hopefully catch this in the future.
https://github.com/kubernetes/kops/pull/12202 is my attempt at fixing this. The third commit in that PR shows the exact terraform changes, and the necessary terraform state mv
s are in the PR description
/kind bug
1. What
kops
version are you running? The commandkops version
, will display this information. Version 1.21.0 (git-a5bdc3359e544b314d5695b3ed596829313fc6e3)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 akops
flag. k8s: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T20:59:07Z", GoVersion:"go1.16.6", 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? kops update cluster 208.-.-.net --yes --out output/208/ --target=terraform
5. What happened after the commands executed? Kops exited with panic on cluster update.
6. What did you expect to happen? I expected kops to update cluster config
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. I'm trying to update the existing cluster to enable IRSA Cluster spec was updated with the next:And
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.9. Anything else do we need to know? These are the only changes that have been made to cluster prior to the panic. "Name" is the name of the cluster.