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

Create New Default StorageClass: kops-ssd-1-17 #8582

Merged

Conversation

joshbranham
Copy link
Contributor

@joshbranham joshbranham commented Feb 17, 2020

Since kops manages the default storageclass for AWS, I feel we should add some improvements.

First, we can allow volume expansion now which is handy. https://kubernetes.io/docs/concepts/storage/persistent-volumes/#expanding-persistent-volumes-claims

Second, in order to prevent race conditions with Pods, setting the volumeBindingMode will only create a PV for a PVC and mount it to a node once the pod is scheduled.

https://kubernetes.io/docs/concepts/storage/storage-classes/#volume-binding-mode

Third, enable default EBS encryption. This one is debatable but I think for a production-ready kubernetes cluster in AWS this a best practice default.

This PR has the volumeBindingMode set as well, but I made a new PR since I am suggesting a few other changes. #8416

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 17, 2020
@joshbranham
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Feb 17, 2020
@joshbranham joshbranham force-pushed the feature/better-default-storageclass branch from 5c63cbc to b2247eb Compare February 17, 2020 16:28
@joshbranham joshbranham changed the title WIP: Improved Default gp2 StorageClass AWS Create New Default StorageClass: gp2-kops Feb 17, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 17, 2020
@johngmyers
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 17, 2020
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gp2-kops
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add purpose instead of the generic kops keyword?

Suggested change
name: gp2-kops
name: gp2-wait

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's another good option that avoids my prefix vs suffix nit-pick :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the purpose bit makes it too specific since I am also suggesting we set some other non-default settings

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gp2-kops
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to nit-pick... I'm wondering if we should use a consistent prefix, rather than a suffix. We've started doing this with e.g. clusterroles, and there we've used kops: but I don't know if the colon is available everywhere (?). WDYT about kops-gp2 or kops:gp2 in general?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is a good idea to start with something consistent and move forward with it. Unfortunately it won't let us do kops:gp2 but I think kops-gp2 make sense @justinsb

Thoughts @hakman

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kops-gp2-1-18? I am sure we will change it again someday. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think it's OK to change these going forwards; "kops-gp2" can mean "the gp2 class, but otherwise whatever kops recommends". We should probably have a note that if people want to lock in a specific behaviour, they should probably use their own storage class (though to be honest I'm not sure how users could do that without knowing what features are coming in the future).

This is sort of philosophy with most of the kops fields - if you leave it unspecified, that means "whatever kops recommends" (I sometimes call it omakase). But if you care, you should specify it, in which case kops honors your intention. We can - and do - change the defaults, but if you specify a field we either honor it or it is an error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(BTW, if we wanted to, we could also name this kops-ssd, and then offer storage classes that work across clouds, though I personally find it better to just use the default storage class in my apps)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(BTW, if we wanted to, we could also name this kops-ssd, and then offer storage classes that work across clouds, though I personally find it better to just use the default storage class in my apps)

I do like the idea of kops-ssd as a starting point. Should I add a version to it as well? I would like to see this go out whenever it can, so should I target 1.16 or 1.17? Therefore the name could be:

kops-ssd-1-16 for instance

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer we target 1.17. This is too featureish to go into 1.16 at this time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshbranham
Copy link
Contributor Author

although if we are trying to target a better default for new clusters, then maybe release notes with steps to --force update the existing one is the better approach than modifying the name? At least in this case, it won't effect existing volumes. However I could see this pattern of fix the default for new clusters > release notes for manual fix on existing being harder to implement for things like deployments where labels can't change etc and --force just deletes the old causing potentially downtime for that workload. Hmmmmm

@johngmyers
Copy link
Member

I was under the impression that we were targeting a better default for new volumes, even on old clusters.

@joshbranham
Copy link
Contributor Author

I was under the impression that we were targeting a better default for new volumes, even on old clusters.

That seems like the easiest path forward. If you agree then I’ll just go with kops-ssd-1-17. The likelihood we change these settings much is low so I doubt we’ll run into multiple tweaks per k8s/kops minor version

@joshbranham joshbranham force-pushed the feature/better-default-storageclass branch from b2247eb to 9f033f8 Compare February 19, 2020 17:43
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 19, 2020
@joshbranham joshbranham changed the title Create New Default StorageClass: gp2-kops Create New Default StorageClass: kops-ssd-1-17 Feb 19, 2020
@cpanato
Copy link
Member

cpanato commented Feb 20, 2020

@joshbranham i will close my PR

@johngmyers
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 21, 2020
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@justinsb
Copy link
Member

Thanks @joshbranham

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joshbranham, justinsb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 14, 2020
@joshbranham
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit ae51a5b into kubernetes:master Mar 14, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Mar 14, 2020
@joshbranham joshbranham deleted the feature/better-default-storageclass branch March 14, 2020 16:22
k8s-ci-robot added a commit that referenced this pull request Mar 14, 2020
…82-release-1.17

Automated cherry pick of #8582: Create New Default StorageClass: kops-ssd-1-17
@dignajar
Copy link

this PR is so strange, changing default value from the previous version (backward compatibility will fail) and adding a version number to the storage class name?

What is going to happen after we update from an early version to v1.17; We are going to have two defaults and if for some reason we re-deploy some application will take another type of storage class.

@joshbranham
Copy link
Contributor Author

joshbranham commented Jul 23, 2020

The two defaults issue was fixed, pr is linked here. The storage class is essentially parameters to tell EBS what to use when making the volume. It has no impact on existing volumes and you can delete storage classes without affecting existing volumes. This change was just meant to make expanding volumes possible, primarily. Do you see an issue still even with the linked PRs? I will agree the defaulting behavior was a mistake, and hard to manage in long lived clusters anyways when things are always apply-only.

In my case, we manage our storage classes ourselves and enforce via OPA which classes devs can use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants