Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

update Review Guidelines for workloads #3334

Merged
merged 3 commits into from
Jan 25, 2018

Conversation

dhilipkumars
Copy link
Contributor

Initial update with Best Practises. PTAL

Ref: #3011


Thank you for contributing to kubernetes/charts. Before you submit this PR we'd like to
make sure you are aware of our technical requirements and best practices:

For a quick overview across what we will look at reviewing your PR, please read
our review guidelines:

Following our best practices right from the start will accelerate the review process and
help get your PR merged quicker.

When updates to your PR are requested, please add new commits and do not squash the
history. This will make it easier to identify new changes. The PR will be squashed
anyways when it is merged. Thanks.


Initial update with Best Practises.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 15, 2018
@dhilipkumars
Copy link
Contributor Author

cc : @kubernetes/charts-maintainers

Copy link
Contributor

@mattfarina mattfarina left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together!

A little feedback (mostly nits)...


## Kubernetes Native Workloads.

While reviewing Charts that contains workloads such as [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/), [Statefulset](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/), [Daemonset](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) and [Jobs](https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/) below points should be considered. These are to seen as best practises rather than strict enforcement.
Copy link
Contributor

Choose a reason for hiding this comment

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

Some nits...

While reviewing Charts that contains workloads

should be contain

and...

below points should be considered.

should be:

the below points should be considered.

I also noticed practises is misspelled. It should be practices.


While reviewing Charts that contains workloads such as [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/), [Statefulset](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/), [Daemonset](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) and [Jobs](https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/) below points should be considered. These are to seen as best practises rather than strict enforcement.

1. Any workload that are stateless and long running (servers) in nature are to be created as deployments. Deployments in turn creates replica sets.
Copy link
Contributor

Choose a reason for hiding this comment

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

workload should be plural as workloads

While reviewing Charts that contains workloads such as [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/), [Statefulset](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/), [Daemonset](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) and [Jobs](https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/) below points should be considered. These are to seen as best practises rather than strict enforcement.

1. Any workload that are stateless and long running (servers) in nature are to be created as deployments. Deployments in turn creates replica sets.
2. Unless there is a compelling reason replica sets or replica controllers are are to be avoided as workload types.
Copy link
Contributor

Choose a reason for hiding this comment

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

replica controllers should be replication controllers


1. Any workload that are stateless and long running (servers) in nature are to be created as deployments. Deployments in turn creates replica sets.
2. Unless there is a compelling reason replica sets or replica controllers are are to be avoided as workload types.
3. Workloads that are stateful in nature such as Databases, Key Value Store, Messages Queues , In-memory caches are to be created as statefulsets
Copy link
Contributor

Choose a reason for hiding this comment

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

There's an extra space between Messages Queues and the comma after it.

Might also be useful to call it StatefulSet everywhere to keep the case consistent in the doc.

1. Any workload that are stateless and long running (servers) in nature are to be created as deployments. Deployments in turn creates replica sets.
2. Unless there is a compelling reason replica sets or replica controllers are are to be avoided as workload types.
3. Workloads that are stateful in nature such as Databases, Key Value Store, Messages Queues , In-memory caches are to be created as statefulsets
4. It is recommended that Deployments and Statefulsets configure their workloads with [Pod Disruption Budget](https://kubernetes.io/docs/concepts/workloads/pods/disruptions/) for high availability.
Copy link
Contributor

Choose a reason for hiding this comment

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

It might read better if after "their workloads with" there was an a.

3. Workloads that are stateful in nature such as Databases, Key Value Store, Messages Queues , In-memory caches are to be created as statefulsets
4. It is recommended that Deployments and Statefulsets configure their workloads with [Pod Disruption Budget](https://kubernetes.io/docs/concepts/workloads/pods/disruptions/) for high availability.
5. For workloads such as databases, KV store, etc., that replicates data it is recommended to configure interpod anti-affinity.
6. It is recommended to have default workload update strategy configured that is suitable for this chart
Copy link
Contributor

Choose a reason for hiding this comment

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

Might read better to update

to have default workload update

to

to have a default workload update

5. For workloads such as databases, KV store, etc., that replicates data it is recommended to configure interpod anti-affinity.
6. It is recommended to have default workload update strategy configured that is suitable for this chart
7. Batch workloads are to be created using Jobs.
8. It is best to always create workload with latest supported [api version]( https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#statefulset-v1-apps) as older version are either depcicated or soon to be depreciated.
Copy link
Contributor

Choose a reason for hiding this comment

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

The latest is only supported in 1.9. apps/v1 isn't supporting in 1.8. Because of these we should use the last api version. Many providers don't even provide 1.9 yet (like GKE).

@unguiculus
Copy link
Member

Thanks for putting this together. Do we really need it this explicit? For my taste it is a little bit too much.

Apply review comments
@dhilipkumars
Copy link
Contributor Author

@mattfarina Thanks for the review PTAL

@unguiculus Sure, its targetted for new reviewers to Chart community who may not be expert with workload apis in K8s, Also do you have any good examples for 'deployment', 'job' and 'DaemonSet' that we can be a good starting point for new contributors/reviewers?


More [configuration](https://kubernetes.io/docs/concepts/configuration/overview/) best practises.

Example Charts that follow above best practices: [Statefulset](https://github.com/kubernetes/charts/tree/master/incubator/zookeeper), [Deployment](), [DaemonSet]() and [Jobs]().
Copy link
Member

Choose a reason for hiding this comment

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

Zookeeper is not the best example. It doesn't fully follow best practices and is in incubator.

Copy link
Contributor

Choose a reason for hiding this comment

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

Might I suggest we handling the example in 2 steps.

  1. Remove them from here, as we don't have a complete best practice set, so we can get this committed.
  2. Add discussing the examples to the next charts chart meeting so we can figure out which are good to include and then handle that in a second PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed

Copy link
Contributor

Choose a reason for hiding this comment

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

@dhilipkumars if you remove that line it LGTM. Don't see a reason to not merge it then. Thanks for putting this together.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

examples to be handled separately.
@mattfarina
Copy link
Contributor

/lgtm

We can iterate on it from here if we like, I think.

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 25, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhilipkumars, mattfarina

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your 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 Jan 25, 2018
@k8s-ci-robot k8s-ci-robot merged commit 964cdd5 into helm:master Jan 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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 Indicates that a PR is ready to be merged. 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.

4 participants