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

Issue 82: Ability to scale Pravega Controller #99

Merged
merged 1 commit into from
Nov 28, 2018

Conversation

adrianmo
Copy link
Contributor

Change log description

This PR adds the ability to scale the number of Controller replicas. It has been implemented in the pkg/pravega/sync.go file, in the same way as other components are scaled (Segmentstore, Bookkeeper), i.e., the code obtains the desired number of replicas from the updated manifest and makes sure the Controller Deployment object is in sync.

Purpose of the change

How to test the change

Checkout the repository (master branch is fine, no need to checkout this branch).

Edit the operator image used in the deploy/operator.yaml file to use the adrianmo/pravega-operator:issue-82-1 image, which contains the changes in this PR.

Follow the instructions in the README file to install the operator, deploy the operator, and create a Pravega cluster.

By default, there will only be one Controller replica.

$ kubectl get all -l pravega_cluster=pravega
NAME                                             READY     STATUS    RESTARTS   AGE                                                                            
pod/pravega-bookie-0                             1/1       Running   0          28m                                                                            
pod/pravega-bookie-1                             1/1       Running   0          28m                                                                            
pod/pravega-bookie-2                             1/1       Running   0          28m                                                                            
pod/pravega-pravega-controller-c9875fc6d-l7prt   1/1       Running   0          28m                                                                            
pod/pravega-segmentstore-0                       1/1       Running   1          28m                                                                            
pod/pravega-segmentstore-1                       1/1       Running   1          28m                                                                            
pod/pravega-segmentstore-2                       1/1       Running   1          28m                                                                            

NAME                                 TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)              AGE                                                        
service/pravega-bookie-headless      ClusterIP   None            <none>        3181/TCP             28m                                                        
service/pravega-pravega-controller   ClusterIP   10.71.254.167   <none>        10080/TCP,9090/TCP   28m                                                        

NAME                                               DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE                                                            
deployment.extensions/pravega-pravega-controller   1         1         1            1           28m                                                            

NAME                                                         DESIRED   CURRENT   READY     AGE                                                                 
replicaset.extensions/pravega-pravega-controller-c9875fc6d   1         1         1         28m                                                                 

NAME                                         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE                                                                  
deployment.apps/pravega-pravega-controller   1         1         1            1           28m                                                                  

NAME                                                   DESIRED   CURRENT   READY     AGE                                                                       
replicaset.apps/pravega-pravega-controller-c9875fc6d   1         1         1         28m                                                                       

NAME                                    DESIRED   CURRENT   AGE
statefulset.apps/pravega-bookie         3         3         28m
statefulset.apps/pravega-segmentstore   3         3         28m

To scale the number of Controller replicas, edit the PravegaCluster resource and update the controllerReplicas field.

$ kubectl edit PravegaCluster pravega

Verify that the number of Controller pods matches with the number of replicas.

$ kubectl get po -l pravega_cluster=pravega
NAME                                         READY     STATUS    RESTARTS   AGE
pravega-bookie-0                             1/1       Running   0          28m                                                                            
pravega-bookie-1                             1/1       Running   0          28m                                                                            
pravega-bookie-2                             1/1       Running   0          28m                                                                            
pravega-pravega-controller-c9875fc6d-l7prt   1/1       Running   0          28m                                                                            
pravega-pravega-controller-c9875fc6d-nsg5v   1/1       Running   0          28m                                                                            
pravega-segmentstore-0                       1/1       Running   1          28m                                                                            
pravega-segmentstore-1                       1/1       Running   1          28m                                                                            
pravega-segmentstore-2                       1/1       Running   1          28m 

Run a Pravega sample as explained here to verify that Pravega works as expected.


Signed-off-by: Adrian Moreno [email protected]

@adrianmo adrianmo self-assigned this Nov 26, 2018
@adrianmo adrianmo requested review from fpj and shrids November 26, 2018 13:31
@adrianmo
Copy link
Contributor Author

@shrids please take a look at this change and let me know if it unblocks your work on pravega/pravega#3135

@adrianmo
Copy link
Contributor Author

Copy link

@shrids shrids left a comment

Choose a reason for hiding this comment

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

+1

@adrianmo adrianmo requested a review from deenav November 27, 2018 10:19
Copy link

@fpj fpj left a comment

Choose a reason for hiding this comment

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

+1

Copy link

@deenav deenav left a comment

Choose a reason for hiding this comment

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

I have tested and verified that Pravega Controller scaling works fine with this fix.

@adrianmo adrianmo merged commit 220f918 into master Nov 28, 2018
@adrianmo adrianmo deleted the issue-82-fix-scale-controller branch November 28, 2018 16:31
adrianmo added a commit that referenced this pull request Nov 29, 2018
* master:
  Ability to scale Pravega Controller (#99)
  Issue 61: Support external connectivity (#77)
adrianmo added a commit that referenced this pull request Dec 7, 2018
* master:
  Issue 78: Clean up persistent volumes when deleting Pravega Cluster (#103)
  Issue 97: Update to operator SDK v0.2.0 (#105)
  Ability to scale Pravega Controller (#99)
  Issue 61: Support external connectivity (#77)
  Issue 95: Updated README.md (#95)
adrianmo added a commit that referenced this pull request Dec 7, 2018
* master:
  Issue 78: Clean up persistent volumes when deleting Pravega Cluster (#103)
  Issue 97: Update to operator SDK v0.2.0 (#105)
  Ability to scale Pravega Controller (#99)
  Issue 61: Support external connectivity (#77)
  Issue 95: Updated README.md (#95)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants