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

Using existing subnets should not tag them #5700

Closed
dee-kryvenko opened this issue Aug 24, 2018 · 14 comments
Closed

Using existing subnets should not tag them #5700

dee-kryvenko opened this issue Aug 24, 2018 · 14 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@dee-kryvenko
Copy link

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

1.9.2

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.

1.9.9

3. What cloud provider are you using?

AWS

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

Simplest way - create your vpc and subnets using terraform, tag them to your liking, then use kops to create cluster in there, and then try to run terraform apply on top of what you've got.

5. What happened after the commands executed?

k8s tags got deleted from subnet

6. What did you expect to happen?

I expected kops not to touch resources that it is not ow

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.

It's not really relevant but I can provide it if needed

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?

@dee-kryvenko
Copy link
Author

I’m not sure what is this tags used for, but as alternative - let user to customize tag query to search for needed resources.

@dee-kryvenko
Copy link
Author

dee-kryvenko commented Sep 25, 2018

FYI - TF has plans to fix this on their side: hashicorp/terraform#6632. Nevertheless, I think it must be revisited if kops doing a right thing here.

k8s-ci-robot added a commit that referenced this issue Nov 9, 2018
#5700: Add command line flag for disabling Subnet ELB tags
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 24, 2018
@dmildh
Copy link

dmildh commented Jan 22, 2019

Would be nice if kops could use the provided subnetid instead of tags to avoid these issues.

@seanson
Copy link
Contributor

seanson commented Jan 22, 2019

There is now a kops flag --disable-subnet-tags that allows you to manage the subnet tags out of band.

@dmildh
Copy link

dmildh commented Jan 22, 2019

@seanson Does that mean we would still need to tag the existing AWS subnet resources with our Terraform setup that is managing the vpc? We specify the subnets: vars in our kops.config already so the configuration already contains the cidrs/types/zones etc.

@seanson
Copy link
Contributor

seanson commented Jan 22, 2019

Yes, subnets should still be tagged otherwise any services that require subnet identification like ELBs will not work.

https://github.com/kubernetes/kops/blob/master/docs/run_in_existing_vpc.md#subnet-tags

@dmildh
Copy link

dmildh commented Jan 22, 2019

Gotcha, that's what I thought. Since you can already provide all of the information in the kops.config, it would be nice if tags were not required at all for the subnets but assuming that is a Kubernetes requirement not a kops one.

@dee-kryvenko
Copy link
Author

Something that I've learned since I've opened this issue is that k8s itself using these tags for various things. So it doesn't sounds like a kops issue, but a k8s issue. Now, the issue is rather big as lies in between of different infrastructure management tools. Such as in my case, it's Terraform (which I use to manage infrastructure such as networking layer) and kubernetes. I had multiple conversations since I posted the issue with various people, and I'm getting mixed opinions. Some people tend to say terraform is not doing a right thing here, since tags supposed to be a separate entity manageable individually from different tools to facilitate service discovery. Me personally, I would argue it's not a terraform fault as they just transparently mimic what an AWS API objects looks like. In AWS - tags is not a separate entity but an attribute to other entities and hence managed the way they managed to facilitate reproducibility, immutability and idempotence. So maybe AWS is at fault here? Just guessing :)

And keep in minds it's not just TF vs k8s... I would imagine similar things could happen with CloudFormation or Ansible on the left and whatever else service-discoverable thing on the right. And also in different cloud providers and virtualization software.

This would be extremely complicated to make everyone sit together and make an RFC once and for all on what the tag is. Or maybe there is one already? Is it a key-value or just a label? Is it a separate entity or an attribute to another entity? And so on and so forth...

To me it sounds unrealistic and I'm not really sure where to move from here. Maybe I'd start from re-opening a similar ticket in k8s issues, and since I already opened similar one in TF I will link them both together.

@dmildh
Copy link

dmildh commented Jan 22, 2019

@llibicpep Thanks. At this point, I am going to just add the needed tags to my tfvars for the public and private subnets so at least it doesn't try and strip them. If Terraform adds support for wildcards in the ignore_changes option this will help but doesn't appear to be on the map yet.

@dee-kryvenko
Copy link
Author

Just to link discussions opened in TF and k8s:
hashicorp/terraform-provider-aws#5974
kubernetes/kubernetes#73190

@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 22, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants