{"action":"created","comment":{"url":"https://api.github.com/repos/portworx/pxdocs/pulls/comments/343393260","pull_request_review_id":312897066,"id":343393260,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM0MzM5MzI2MA==","diff_hunk":"@@ -0,0 +1,217 @@\n+---\n+title: Volume Placement Strategies\n+weight: 4\n+keywords: portworx, storage class, container, Kubernetes, storage, Docker, k8s, flexvol, pv, persistent disk,StatefulSets, volume placement\n+description: Learn how to use Portworx Volume Placement Strategies to control how volumes are placed across your cluster\n+series: k8s-vol\n+---\n+When you provision volumes, Portworx places them throughout the cluster and across zones to provide fault tolerance. While this default manner of operation works well in many scenarios, you may wish to control how Portworx handles volume and replica provisioning more explicitly. You can do this by creating VolumePlacementStrategy CRDs.\n+\n+Within a VolumePlacementStrategy CRD, you can specify a series of rules which control volume and volume replica provisioning on nodes and pools in the cluster based on the labels they have.\n+\n+## Understand the VolumePlacementStrategy spec\n+\n+You can define your VolumePlacementStrategy by creating a spec containing affinity rules. Affinity rules instruct Portworx on where to place volumes and volume replicas within your cluster and come in two flavors: affinity and antiaffinity. For more information on specific rules, see the following sections of the CRD reference guide:\n+\n+* [replicaAffinity](/portworx-install-with-kubernetes/storage-operations/create-pvcs/volume-placementp-strategies/crd-reference#replicaaffinity)\n+* [replicaAntiAffinity](/portworx-install-with-kubernetes/storage-operations/create-pvcs/volume-placementp-strategies/crd-reference#replicaantiaffinity)\n+* [volumeAffinity](/portworx-install-with-kubernetes/storage-operations/create-pvcs/volume-placementp-strategies/crd-reference#volumeaffinity)\n+* [volumeAntiAffinity](/portworx-install-with-kubernetes/storage-operations/create-pvcs/volume-placementp-strategies/crd-reference#volumeantiaffinity)\n+\n+### Example\n+\n+```text\n+apiVersion: portworx.io/v1beta2\n+kind: VolumePlacementStrategy\n+metadata:\n+  name: <your_strategy_name>\n+spec:\n+    replicaAffinity:         <1>\n+      key: media_type        <2>\n+      operator: In           <3>\n+      values:\n+        - \"SSD\"              <4>\n+    replicaAntiaffinity:\n+    - <your_fields>\n+```\n+\n+The example above instructs Portworx to perform the following:\n+\n+1. `replicaAffinity` directs Portworx to create replicas under the preferred conditions defined beneath it\n+2. `key` specifies the `media_type` label, directing Portworx to create replicas on a certain media type\n+3. `operator` specifies the `In` operator, directing Portworx to create replicas in the media type\n+4. `values` specifies the `SSD` labels, directing Portworx to create replicas on SSDs\n+\n+## Understand the VolumePlacementStrategy CRD's place within your cluster\n+\n+Portworx links a VolumePlacementStrategy to a StorageClass through the StorageClass `placement_strategy` parameter. All PVCs that refer to that StorageClass adhere to the linked VolumePlacementStrategy rules. Volumes provisioned from the PVCs place, and have their replicas placed, according to the rules defined in the placement strategy.","path":"content/portworx-install-with-kubernetes/storage-operations/create-pvcs/volume-placementp-strategies/_index.md","position":47,"original_position":47,"commit_id":"41cd3ad71bc9eb4df7bfb87fc2604bd09823873b","original_commit_id":"a5e079bb29384d7dec588167c1d7bd457a17084f","user":{"login":"adikulkarni0","id":57369191,"node_id":"MDQ6VXNlcjU3MzY5MTkx","avatar_url":"https://avatars1.githubusercontent.com/u/57369191?v=4","gravatar_id":"","url":"https://api.github.com/users/adikulkarni0","html_url":"https://github.com/adikulkarni0","followers_url":"https://api.github.com/users/adikulkarni0/followers","following_url":"https://api.github.com/users/adikulkarni0/following{/other_user}","gists_url":"https://api.github.com/users/adikulkarni0/gists{/gist_id}","starred_url":"https://api.github.com/users/adikulkarni0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adikulkarni0/subscriptions","organizations_url":"https://api.github.com/users/adikulkarni0/orgs","repos_url":"https://api.github.com/users/adikulkarni0/repos","events_url":"https://api.github.com/users/adikulkarni0/events{/privacy}","received_events_url":"https://api.github.com/users/adikulkarni0/received_events","type":"User","site_admin":false},"body":"Should this be \"Volumes are provisioned\"?","created_at":"2019-11-07T00:09:07Z","updated_at":"2019-11-07T00:09:07Z","html_url":"https://github.com/portworx/pxdocs/pull/512#discussion_r343393260","pull_request_url":"https://api.github.com/repos/portworx/pxdocs/pulls/512","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/portworx/pxdocs/pulls/comments/343393260"},"html":{"href":"https://github.com/portworx/pxdocs/pull/512#discussion_r343393260"},"pull_request":{"href":"https://api.github.com/repos/portworx/pxdocs/pulls/512"}}},"pull_request":{"url":"https://api.github.com/repos/portworx/pxdocs/pulls/512","id":337726464,"node_id":"MDExOlB1bGxSZXF1ZXN0MzM3NzI2NDY0","html_url":"https://github.com/portworx/pxdocs/pull/512","diff_url":"https://github.com/portworx/pxdocs/pull/512.diff","patch_url":"https://github.com/portworx/pxdocs/pull/512.patch","issue_url":"https://api.github.com/repos/portworx/pxdocs/issues/512","number":512,"state":"open","locked":false,"title":"Pd 319 volume placement strategies","user":{"login":"nathan-px","id":53194370,"node_id":"MDQ6VXNlcjUzMTk0Mzcw","avatar_url":"https://avatars3.githubusercontent.com/u/53194370?v=4","gravatar_id":"","url":"https://api.github.com/users/nathan-px","html_url":"https://github.com/nathan-px","followers_url":"https://api.github.com/users/nathan-px/followers","following_url":"https://api.github.com/users/nathan-px/following{/other_user}","gists_url":"https://api.github.com/users/nathan-px/gists{/gist_id}","starred_url":"https://api.github.com/users/nathan-px/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathan-px/subscriptions","organizations_url":"https://api.github.com/users/nathan-px/orgs","repos_url":"https://api.github.com/users/nathan-px/repos","events_url":"https://api.github.com/users/nathan-px/events{/privacy}","received_events_url":"https://api.github.com/users/nathan-px/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-11-06T22:35:05Z","updated_at":"2019-11-07T00:09:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a65238d7140d15cd28668a1ea0581081378927b","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sangleganesh","id":13683186,"node_id":"MDQ6VXNlcjEzNjgzMTg2","avatar_url":"https://avatars3.githubusercontent.com/u/13683186?v=4","gravatar_id":"","url":"https://api.github.com/users/sangleganesh","html_url":"https://github.com/sangleganesh","followers_url":"https://api.github.com/users/sangleganesh/followers","following_url":"https://api.github.com/users/sangleganesh/following{/other_user}","gists_url":"https://api.github.com/users/sangleganesh/gists{/gist_id}","starred_url":"https://api.github.com/users/sangleganesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sangleganesh/subscriptions","organizations_url":"https://api.github.com/users/sangleganesh/orgs","repos_url":"https://api.github.com/users/sangleganesh/repos","events_url":"https://api.github.com/users/sangleganesh/events{/privacy}","received_events_url":"https://api.github.com/users/sangleganesh/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/portworx/pxdocs/pulls/512/commits","review_comments_url":"https://api.github.com/repos/portworx/pxdocs/pulls/512/comments","review_comment_url":"https://api.github.com/repos/portworx/pxdocs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/portworx/pxdocs/issues/512/comments","statuses_url":"https://api.github.com/repos/portworx/pxdocs/statuses/41cd3ad71bc9eb4df7bfb87fc2604bd09823873b","head":{"label":"nathan-px:PD-319-volume-placement-strategies","ref":"PD-319-volume-placement-strategies","sha":"41cd3ad71bc9eb4df7bfb87fc2604bd09823873b","user":{"login":"nathan-px","id":53194370,"node_id":"MDQ6VXNlcjUzMTk0Mzcw","avatar_url":"https://avatars3.githubusercontent.com/u/53194370?v=4","gravatar_id":"","url":"https://api.github.com/users/nathan-px","html_url":"https://github.com/nathan-px","followers_url":"https://api.github.com/users/nathan-px/followers","following_url":"https://api.github.com/users/nathan-px/following{/other_user}","gists_url":"https://api.github.com/users/nathan-px/gists{/gist_id}","starred_url":"https://api.github.com/users/nathan-px/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathan-px/subscriptions","organizations_url":"https://api.github.com/users/nathan-px/orgs","repos_url":"https://api.github.com/users/nathan-px/repos","events_url":"https://api.github.com/users/nathan-px/events{/privacy}","received_events_url":"https://api.github.com/users/nathan-px/received_events","type":"User","site_admin":false},"repo":{"id":198291488,"node_id":"MDEwOlJlcG9zaXRvcnkxOTgyOTE0ODg=","name":"pxdocs","full_name":"nathan-px/pxdocs","private":false,"owner":{"login":"nathan-px","id":53194370,"node_id":"MDQ6VXNlcjUzMTk0Mzcw","avatar_url":"https://avatars3.githubusercontent.com/u/53194370?v=4","gravatar_id":"","url":"https://api.github.com/users/nathan-px","html_url":"https://github.com/nathan-px","followers_url":"https://api.github.com/users/nathan-px/followers","following_url":"https://api.github.com/users/nathan-px/following{/other_user}","gists_url":"https://api.github.com/users/nathan-px/gists{/gist_id}","starred_url":"https://api.github.com/users/nathan-px/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathan-px/subscriptions","organizations_url":"https://api.github.com/users/nathan-px/orgs","repos_url":"https://api.github.com/users/nathan-px/repos","events_url":"https://api.github.com/users/nathan-px/events{/privacy}","received_events_url":"https://api.github.com/users/nathan-px/received_events","type":"User","site_admin":false},"html_url":"https://github.com/nathan-px/pxdocs","description":"Source for upcoming version of docs.portworx.com","fork":true,"url":"https://api.github.com/repos/nathan-px/pxdocs","forks_url":"https://api.github.com/repos/nathan-px/pxdocs/forks","keys_url":"https://api.github.com/repos/nathan-px/pxdocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nathan-px/pxdocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nathan-px/pxdocs/teams","hooks_url":"https://api.github.com/repos/nathan-px/pxdocs/hooks","issue_events_url":"https://api.github.com/repos/nathan-px/pxdocs/issues/events{/number}","events_url":"https://api.github.com/repos/nathan-px/pxdocs/events","assignees_url":"https://api.github.com/repos/nathan-px/pxdocs/assignees{/user}","branches_url":"https://api.github.com/repos/nathan-px/pxdocs/branches{/branch}","tags_url":"https://api.github.com/repos/nathan-px/pxdocs/tags","blobs_url":"https://api.github.com/repos/nathan-px/pxdocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nathan-px/pxdocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nathan-px/pxdocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/nathan-px/pxdocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nathan-px/pxdocs/statuses/{sha}","languages_url":"https://api.github.com/repos/nathan-px/pxdocs/languages","stargazers_url":"https://api.github.com/repos/nathan-px/pxdocs/stargazers","contributors_url":"https://api.github.com/repos/nathan-px/pxdocs/contributors","subscribers_url":"https://api.github.com/repos/nathan-px/pxdocs/subscribers","subscription_url":"https://api.github.com/repos/nathan-px/pxdocs/subscription","commits_url":"https://api.github.com/repos/nathan-px/pxdocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/nathan-px/pxdocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/nathan-px/pxdocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/nathan-px/pxdocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/nathan-px/pxdocs/contents/{+path}","compare_url":"https://api.github.com/repos/nathan-px/pxdocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nathan-px/pxdocs/merges","archive_url":"https://api.github.com/repos/nathan-px/pxdocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nathan-px/pxdocs/downloads","issues_url":"https://api.github.com/repos/nathan-px/pxdocs/issues{/number}","pulls_url":"https://api.github.com/repos/nathan-px/pxdocs/pulls{/number}","milestones_url":"https://api.github.com/repos/nathan-px/pxdocs/milestones{/number}","notifications_url":"https://api.github.com/repos/nathan-px/pxdocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nathan-px/pxdocs/labels{/name}","releases_url":"https://api.github.com/repos/nathan-px/pxdocs/releases{/id}","deployments_url":"https://api.github.com/repos/nathan-px/pxdocs/deployments","created_at":"2019-07-22T19:44:33Z","updated_at":"2019-11-06T22:42:49Z","pushed_at":"2019-11-06T23:56:50Z","git_url":"git://github.com/nathan-px/pxdocs.git","ssh_url":"git@github.com:nathan-px/pxdocs.git","clone_url":"https://github.com/nathan-px/pxdocs.git","svn_url":"https://github.com/nathan-px/pxdocs","homepage":null,"size":45106,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"portworx:master","ref":"master","sha":"ec2f4460034e68169d68b2cd40f683ae0ff17f5d","user":{"login":"portworx","id":12014092,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMDE0MDky","avatar_url":"https://avatars3.githubusercontent.com/u/12014092?v=4","gravatar_id":"","url":"https://api.github.com/users/portworx","html_url":"https://github.com/portworx","followers_url":"https://api.github.com/users/portworx/followers","following_url":"https://api.github.com/users/portworx/following{/other_user}","gists_url":"https://api.github.com/users/portworx/gists{/gist_id}","starred_url":"https://api.github.com/users/portworx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portworx/subscriptions","organizations_url":"https://api.github.com/users/portworx/orgs","repos_url":"https://api.github.com/users/portworx/repos","events_url":"https://api.github.com/users/portworx/events{/privacy}","received_events_url":"https://api.github.com/users/portworx/received_events","type":"Organization","site_admin":false},"repo":{"id":142054032,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIwNTQwMzI=","name":"pxdocs","full_name":"portworx/pxdocs","private":false,"owner":{"login":"portworx","id":12014092,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMDE0MDky","avatar_url":"https://avatars3.githubusercontent.com/u/12014092?v=4","gravatar_id":"","url":"https://api.github.com/users/portworx","html_url":"https://github.com/portworx","followers_url":"https://api.github.com/users/portworx/followers","following_url":"https://api.github.com/users/portworx/following{/other_user}","gists_url":"https://api.github.com/users/portworx/gists{/gist_id}","starred_url":"https://api.github.com/users/portworx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portworx/subscriptions","organizations_url":"https://api.github.com/users/portworx/orgs","repos_url":"https://api.github.com/users/portworx/repos","events_url":"https://api.github.com/users/portworx/events{/privacy}","received_events_url":"https://api.github.com/users/portworx/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/portworx/pxdocs","description":"Source for upcoming version of docs.portworx.com","fork":false,"url":"https://api.github.com/repos/portworx/pxdocs","forks_url":"https://api.github.com/repos/portworx/pxdocs/forks","keys_url":"https://api.github.com/repos/portworx/pxdocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/portworx/pxdocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/portworx/pxdocs/teams","hooks_url":"https://api.github.com/repos/portworx/pxdocs/hooks","issue_events_url":"https://api.github.com/repos/portworx/pxdocs/issues/events{/number}","events_url":"https://api.github.com/repos/portworx/pxdocs/events","assignees_url":"https://api.github.com/repos/portworx/pxdocs/assignees{/user}","branches_url":"https://api.github.com/repos/portworx/pxdocs/branches{/branch}","tags_url":"https://api.github.com/repos/portworx/pxdocs/tags","blobs_url":"https://api.github.com/repos/portworx/pxdocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/portworx/pxdocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/portworx/pxdocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/portworx/pxdocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/portworx/pxdocs/statuses/{sha}","languages_url":"https://api.github.com/repos/portworx/pxdocs/languages","stargazers_url":"https://api.github.com/repos/portworx/pxdocs/stargazers","contributors_url":"https://api.github.com/repos/portworx/pxdocs/contributors","subscribers_url":"https://api.github.com/repos/portworx/pxdocs/subscribers","subscription_url":"https://api.github.com/repos/portworx/pxdocs/subscription","commits_url":"https://api.github.com/repos/portworx/pxdocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/portworx/pxdocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/portworx/pxdocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/portworx/pxdocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/portworx/pxdocs/contents/{+path}","compare_url":"https://api.github.com/repos/portworx/pxdocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/portworx/pxdocs/merges","archive_url":"https://api.github.com/repos/portworx/pxdocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/portworx/pxdocs/downloads","issues_url":"https://api.github.com/repos/portworx/pxdocs/issues{/number}","pulls_url":"https://api.github.com/repos/portworx/pxdocs/pulls{/number}","milestones_url":"https://api.github.com/repos/portworx/pxdocs/milestones{/number}","notifications_url":"https://api.github.com/repos/portworx/pxdocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/portworx/pxdocs/labels{/name}","releases_url":"https://api.github.com/repos/portworx/pxdocs/releases{/id}","deployments_url":"https://api.github.com/repos/portworx/pxdocs/deployments","created_at":"2018-07-23T18:34:11Z","updated_at":"2019-11-06T23:21:29Z","pushed_at":"2019-11-06T23:56:52Z","git_url":"git://github.com/portworx/pxdocs.git","ssh_url":"git@github.com:portworx/pxdocs.git","clone_url":"https://github.com/portworx/pxdocs.git","svn_url":"https://github.com/portworx/pxdocs","homepage":null,"size":43228,"stargazers_count":4,"watchers_count":4,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":52,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":37,"open_issues":52,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/portworx/pxdocs/pulls/512"},"html":{"href":"https://github.com/portworx/pxdocs/pull/512"},"issue":{"href":"https://api.github.com/repos/portworx/pxdocs/issues/512"},"comments":{"href":"https://api.github.com/repos/portworx/pxdocs/issues/512/comments"},"review_comments":{"href":"https://api.github.com/repos/portworx/pxdocs/pulls/512/comments"},"review_comment":{"href":"https://api.github.com/repos/portworx/pxdocs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/portworx/pxdocs/pulls/512/commits"},"statuses":{"href":"https://api.github.com/repos/portworx/pxdocs/statuses/41cd3ad71bc9eb4df7bfb87fc2604bd09823873b"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"adikulkarni0"}}