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

Add hostPort for external smart client #182

Open
leszko opened this issue Dec 20, 2019 · 3 comments
Open

Add hostPort for external smart client #182

leszko opened this issue Dec 20, 2019 · 3 comments

Comments

@leszko
Copy link

leszko commented Dec 20, 2019

Currently, when we suggest how to configure External Smart Client, we suggest creating a service per Pod (with Metacontroller).

The other option would be to use hostPort, we can add this option to the hazelcast-kubernetes plugin.

@hasancelik
Copy link
Collaborator

Smart clients need to be connected to all members at cluster but as you also mentioned at related TDD, hostPort is not suitable for it:

It(hostPort) is not an option at the moment, since currently it's only possible to statically assign the host port, which would make the limitation of scaling one Hazelcast POD / Kubernetes Node.

At kubernetes side, still there is no dynamic configuration for hostPort(range or random) as far as I can see. What is your plan to do that or am I missing something? 🙂 @leszko

@leszko
Copy link
Author

leszko commented Jan 13, 2020

Yeah, it's not possible to do it dynamically. But you could do what we actually do in case of Hazelcast Cloud and set up the static hostPort (there is even an option for that in our Helm Chart). Then, you're limited to the having max 1 Hazelcast POD per 1 Kubernetes Node (because the host port is status), but it may be good enough for some cases.

This GH issue is just to give the possibility of discovering something like that. Still the Hazelcast users need to take care of the correct Kubernetes-Hazelcast configuration.

@mikekuzak
Copy link

mikekuzak commented May 14, 2024

How do I set the port statically, is there a hostPort setting with the HZ operator? Or basically the service should not auto generate a nodePort each time I deploy the service. I want to set the NodePort statically.

apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
  name: hazelcast
spec:
  clusterSize: 3
  clusterName: dev
  repository: hazelcast/hazelcast
  version: 5.4.0-slim-jdk17
  resources:
    requests:
      memory: 256Mi
      cpu: 250m
    limits:
      memory: 3072Mi
      cpu: 8000m
#  highAvailabilityMode: NODE
  exposeExternally:
    type: Smart
    discoveryServiceType: NodePort
    memberAccess: NodePortExternalIP
  scheduling:
    topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: DoNotSchedule
        labelSelector:
          matchLabels:
            app.kubernetes.io/name: hazelcast
            app.kubernetes.io/instance: hazelcast
            app.kubernetes.io/managed-by: hazelcast-platform-operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants