Class KubernetesMembershipProvider

All Implemented Interfaces:
ChannelListener, Heartbeat, MembershipProvider

public class KubernetesMembershipProvider extends CloudMembershipProvider
A MembershipProvider that uses Kubernetes API to retrieve the members of a cluster.
  • Constructor Details

    • KubernetesMembershipProvider

      public KubernetesMembershipProvider()
  • Method Details

    • start

      public void start(int level) throws Exception
      Description copied from interface: MembershipProvider
      Start the membership provider.
      Specified by:
      start in interface MembershipProvider
      Overrides:
      start in class CloudMembershipProvider
      Parameters:
      level - the readiness level
      Channel.DEFAULT - will start all services
      Channel.MBR_RX_SEQ - starts the membership receiver
      Channel.MBR_TX_SEQ - starts the membership broadcaster
      Throws:
      Exception - if an error occurs
    • stop

      public boolean stop(int level) throws Exception
      Description copied from interface: MembershipProvider
      Stop the membership provider.
      Specified by:
      stop in interface MembershipProvider
      Overrides:
      stop in class CloudMembershipProvider
      Parameters:
      level - the readiness level
      Channel.DEFAULT - will stop all services
      Channel.MBR_RX_SEQ - stops the membership receiver
      Channel.MBR_TX_SEQ - stops the membership broadcaster
      Returns:
      true if successful
      Throws:
      Exception - if an error occurs
    • fetchMembers

      protected Member[] fetchMembers()
      Description copied from class: CloudMembershipProvider
      Fetch current cluster members from the cloud orchestration.
      Specified by:
      fetchMembers in class CloudMembershipProvider
      Returns:
      the member array
    • parsePods

      protected void parsePods(Reader reader, List<MemberImpl> members)