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 430: Exposing Segmentstore Service on single IP #431

Merged
merged 15 commits into from
Jul 30, 2020

Conversation

Prabhaker24
Copy link
Contributor

@Prabhaker24 Prabhaker24 commented Jul 27, 2020

Change log description

Exposing Segmentstore Service on single IP address and Different ports

Purpose of the change

fixes #430

What the code does

Currently, Segment store pods are exposed using external IP address which is given by Service, Each pod has its own service which has a unique IP address which can be used to communicate to the Segment store, after this change we can expose segment store services on the same I/P address and different port

How to verify it

  1. To verify this change we need Bare metal kubernetes cluster and we need to specify the below fields for it to work in
    the manifest
pravega:
    . . .
    segmentStoreLoadBalancerIP: "10.243.39.103"
    segmentStoreExternalTrafficPolicy: "cluster"
    segmentStoreSvcAnnotations:
      metallb.universe.tf/allow-shared-ip: "shared-ss-ip"

and after deploying pravega we should see that all the Segment Store services should be having same LoadBalancerIP and a different port.

  1. In case of an environment which does not allow metallb service to provision the same LoadBalancerIP to services like PKS we should be able to run segment store services on different I/P addresses and same port.

I have verified both Scenarios work

prabhaker24 added 12 commits July 21, 2020 10:32
Signed-off-by: prabhaker24 <[email protected]>
Signed-off-by: prabhaker24 <[email protected]>
Signed-off-by: prabhaker24 <[email protected]>
Signed-off-by: prabhaker24 <[email protected]>
Signed-off-by: prabhaker24 <[email protected]>
Signed-off-by: prabhaker24 <[email protected]>
Signed-off-by: prabhaker24 <[email protected]>
Signed-off-by: prabhaker24 <[email protected]>
Signed-off-by: prabhaker24 <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2020

Codecov Report

Merging #431 into master will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #431      +/-   ##
==========================================
+ Coverage   76.11%   76.16%   +0.05%     
==========================================
  Files          14       14              
  Lines        3320     3327       +7     
==========================================
+ Hits         2527     2534       +7     
  Misses        705      705              
  Partials       88       88              
Impacted Files Coverage Δ
pkg/apis/pravega/v1beta1/pravega.go 97.53% <ø> (ø)
pkg/controller/pravega/pravega_segmentstore.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bea9dfe...bf746a0. Read the comment docs.

prabhaker24 added 2 commits July 27, 2020 22:03
Signed-off-by: prabhaker24 <[email protected]>
Signed-off-by: prabhaker24 <[email protected]>
@Prabhaker24 Prabhaker24 requested a review from anishakj July 28, 2020 07:28
@Prabhaker24 Prabhaker24 changed the title Expose pravega on single ip Issue 430: Exposing Segmentstore Service on single IP Jul 28, 2020
@@ -491,6 +487,15 @@ func MakeSegmentStoreExternalServices(p *api.PravegaCluster) []*corev1.Service {
},
},
}
if strings.EqualFold(p.Spec.Pravega.SegmentStoreExternalTrafficPolicy, "cluster") == true {

Choose a reason for hiding this comment

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

change "cluster" to "Cluster" to be consistent with k8s documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@bourgeoisor bourgeoisor left a comment

Choose a reason for hiding this comment

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

LGTM -- couple comments

README.md Outdated
@@ -143,6 +143,8 @@ http://<pravega-name>-pravega-controller.<namespace>:10080/

Check out the [external access documentation](doc/external-access.md) if your clients need to connect to Pravega from outside Kubernetes.

Check out the [exposing Segmentstore service on single I/P address ](https://github.com/pravega/pravega-operator/blob/4aa88641c3d5a1d5afbb2b9e628846639fd13290/doc/external-access.md#exposing-segmentstore-service-on-single-ip-address-and-different-ports) if your clients need to connect to Pravega Segment store on the same I/P address from outside Kubernetes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't IP address the standard way of writing it? (rather than I/P)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -33,6 +33,10 @@ spec:
{{- if .Values.externalAccess.enabled }}
controllerServiceAccountName: {{ .Values.serviceAccount.name }}
segmentStoreServiceAccountName: {{ .Values.serviceAccount.name }}
{{- if .Values.segmentStore.service.segmentStoreLoadBalancerIP }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that conditional needed at all? If we remove the conditional and .Values.segmentStore.service.segmentStoreLoadBalancerIP is null / not set, then it's just going to set it as below:

segmentStoreLoadBalancerIP: null`

Which is the same as not setting it (thus, we don't need that conditional)

Copy link
Contributor Author

@Prabhaker24 Prabhaker24 Jul 29, 2020

Choose a reason for hiding this comment

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

I tried doing that but I am getting this error spec.pravega.segmentStoreLoadBalancerIP in body must be of type string: "null" so I have kept the condition for now.

doc/external-access.md Outdated Show resolved Hide resolved
Copy link
Contributor

@SrishT SrishT left a comment

Choose a reason for hiding this comment

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

LGTM other than the minor changes

charts/pravega/README.md Outdated Show resolved Hide resolved
charts/pravega/templates/pravega.yaml Outdated Show resolved Hide resolved
charts/pravega/templates/pravega.yaml Outdated Show resolved Hide resolved
pkg/apis/pravega/v1beta1/pravega.go Outdated Show resolved Hide resolved
doc/external-access.md Outdated Show resolved Hide resolved

By default, Services do not share an IP address, for providing same IP address to all the services we need to set the following configurations while creating the External Service:

1) Provide annotation key as metallb.universe.tf/allow-shared-ip for all the services.
Copy link
Contributor

Choose a reason for hiding this comment

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

Also the annotation could be highlighted like metallb.universe.tf/allow-shared-ip

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Signed-off-by: prabhaker24 <[email protected]>
Copy link
Contributor

@anishakj anishakj left a comment

Choose a reason for hiding this comment

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

LGTM

@anishakj anishakj merged commit d0218ba into master Jul 30, 2020
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.

Exposing Segmentstore Service on single IP address and Different ports
6 participants