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

Openshift. 2 pods running, dont form cluster and not connection to OpenShift -> next RestClientException. #400

Open
Frostetsky opened this issue Sep 13, 2022 · 1 comment

Comments

@Frostetsky
Copy link

Frostetsky commented Sep 13, 2022

Help pls. Everything seems to be elementary, but nothing happens

Java Configuration

private Config config() {
        Config config = new Config();
        config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);
        config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
        config.getNetworkConfig().getJoin().getKubernetesConfig().setEnabled(true)
                .setProperty("namespace", "default")
                .setProperty("service-name", "hazelcast-service");
        return config;
    }

dc.yaml

securityContext: {}
          ports:
            - containerPort: 9081
              protocol: TCP
            - containerPort: 5701
              protocol: TCP
          imagePullPolicy: Always
          volumeMounts:

svc.yaml

apiVersion: v1
kind: Service
metadata:
  labels:
    app: my-app
  name: 'my-app'
spec:
  ports:
    - name: tcp-9081
      port: 9081
      protocol: TCP
      targetPort: 9081
  selector:
    deploymentconfig: 'my-app'
  type: ClusterIP

hazelcast-service.yaml

apiVersion: v1
kind: Service
metadata:
  name: hazelcast-service
spec:
  selector:
    app: my-app
  ports:
    - name: hazelcast
      port: 5701
  type: LoadBalancer

Error stacktrace

WARNING: Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance results. Arguments to be used:
 --add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED
Sep 13, 2022 7:14:59 PM com.hazelcast.instance.AddressPicker
INFO: [LOCAL] [dev] [4.0.3] Prefer IPv4 stack is true, prefer IPv6 addresses is false
Sep 13, 2022 7:14:59 PM com.hazelcast.instance.AddressPicker
INFO: [LOCAL] [dev] [4.0.3] Picked [29.64.95.130]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
Sep 13, 2022 7:14:59 PM com.hazelcast.system
INFO: [29.64.95.130]:5701 [dev] [4.0.3] Hazelcast 4.0.3 (20200921 - 59ae831) starting at [29.64.95.130]:5701
Sep 13, 2022 7:14:59 PM com.hazelcast.system
INFO: [29.64.95.130]:5701 [dev] [4.0.3] Copyright (c) 2008-2020, Hazelcast, Inc. All Rights Reserved.
Sep 13, 2022 7:15:00 PM com.hazelcast.spi.impl.operationservice.impl.BackpressureRegulator
INFO: [29.64.95.130]:5701 [dev] [4.0.3] Backpressure is disabled
Sep 13, 2022 7:15:01 PM com.hazelcast.spi.discovery.integration.DiscoveryService
INFO: [29.64.95.130]:5701 [dev] [4.0.3] Kubernetes Discovery properties: { service-dns: null, service-dns-timeout: 5, service-name: hazelcast-service, service-port: 0, service-label: null, service-label-value: true, namespace: default, pod-label: null, pod-label-value: null, resolve-not-ready-addresses: true, use-node-name-as-external-address: false, kubernetes-api-retries: 3, kubernetes-master: https://kubernetes.default.svc}
Sep 13, 2022 7:15:01 PM com.hazelcast.spi.discovery.integration.DiscoveryService
INFO: [29.64.95.130]:5701 [dev] [4.0.3] Kubernetes Discovery activated with mode: KUBERNETES_API
Sep 13, 2022 7:15:01 PM com.hazelcast.instance.impl.Node
INFO: [29.64.95.130]:5701 [dev] [4.0.3] Activating Discovery SPI Joiner
Sep 13, 2022 7:15:01 PM com.hazelcast.cp.CPSubsystem
WARNING: [29.64.95.130]:5701 [dev] [4.0.3] CP Subsystem is not enabled. CP data structures will operate in UNSAFE mode! Please note that UNSAFE mode will not provide strong consistency guarantees.
Sep 13, 2022 7:15:02 PM com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl
INFO: [29.64.95.130]:5701 [dev] [4.0.3] Starting 2 partition threads and 3 generic threads (1 dedicated for priority tasks)
Sep 13, 2022 7:15:02 PM com.hazelcast.internal.diagnostics.Diagnostics
INFO: [29.64.95.130]:5701 [dev] [4.0.3] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
Sep 13, 2022 7:15:02 PM com.hazelcast.core.LifecycleService
INFO: [29.64.95.130]:5701 [dev] [4.0.3] [29.64.95.130]:5701 is STARTING
Sep 13, 2022 7:15:02 PM com.hazelcast.kubernetes.RetryUtils
WARNING: Couldn't discover Hazelcast members using Kubernetes API, [1] retrying in 1 seconds...
Sep 13, 2022 7:15:04 PM com.hazelcast.kubernetes.RetryUtils
WARNING: Couldn't discover Hazelcast members using Kubernetes API, [2] retrying in 2 seconds...
Sep 13, 2022 7:15:06 PM com.hazelcast.kubernetes.RetryUtils
WARNING: Couldn't discover Hazelcast members using Kubernetes API, [3] retrying in 3 seconds...
Sep 13, 2022 7:15:09 PM com.hazelcast.spi.discovery.integration.DiscoveryService
WARNING: [29.64.95.130]:5701 [dev] [4.0.3] Cannot fetch the current zone, ZONE_AWARE feature is disabled
Sep 13, 2022 7:15:10 PM com.hazelcast.kubernetes.RetryUtils
WARNING: Couldn't discover Hazelcast members using Kubernetes API, [1] retrying in 1 seconds...
Sep 13, 2022 7:15:11 PM com.hazelcast.kubernetes.RetryUtils
WARNING: Couldn't discover Hazelcast members using Kubernetes API, [2] retrying in 2 seconds...
Sep 13, 2022 7:15:13 PM com.hazelcast.kubernetes.RetryUtils
WARNING: Couldn't discover Hazelcast members using Kubernetes API, [3] retrying in 3 seconds...
Sep 13, 2022 7:15:17 PM com.hazelcast.internal.cluster.impl.DiscoveryJoiner
SEVERE: [29.64.95.130]:5701 [dev] [4.0.3] Failure in executing REST call
com.hazelcast.kubernetes.RestClientException: Failure in executing REST call
	at com.hazelcast.kubernetes.RestClient.call(RestClient.java:115)
	at com.hazelcast.kubernetes.RestClient.get(RestClient.java:80)
	at com.hazelcast.kubernetes.KubernetesClient$1.call(KubernetesClient.java:495)
	at com.hazelcast.kubernetes.KubernetesClient$1.call(KubernetesClient.java:489)
	at com.hazelcast.kubernetes.RetryUtils.retry(RetryUtils.java:53)
	at com.hazelcast.kubernetes.KubernetesClient.callGet(KubernetesClient.java:489)
	at com.hazelcast.kubernetes.KubernetesClient.endpointsByName(KubernetesClient.java:115)
	at com.hazelcast.kubernetes.KubernetesApiEndpointResolver.resolve(KubernetesApiEndpointResolver.java:62)
	at com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy.discoverNodes(HazelcastKubernetesDiscoveryStrategy.java:108)
	at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.discoverNodes(DefaultDiscoveryService.java:71)
	at com.hazelcast.internal.cluster.impl.DiscoveryJoiner.getPossibleAddresses(DiscoveryJoiner.java:69)
	at com.hazelcast.internal.cluster.impl.DiscoveryJoiner.getPossibleAddressesForInitialJoin(DiscoveryJoiner.java:58)
	at com.hazelcast.internal.cluster.impl.TcpIpJoiner.joinViaPossibleMembers(TcpIpJoiner.java:136)
	at com.hazelcast.internal.cluster.impl.TcpIpJoiner.doJoin(TcpIpJoiner.java:96)
	at com.hazelcast.internal.cluster.impl.AbstractJoiner.join(AbstractJoiner.java:137)
	at com.hazelcast.instance.impl.Node.join(Node.java:809)
	at com.hazelcast.instance.impl.Node.start(Node.java:464)
@bianchi2
Copy link

bianchi2 commented Nov 1, 2022

Can this be RBAC? Is service account bound to a role that allows getting and listing pods and services? Also, can you post the entire stack trace, it should have caused by part that may shed some light

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

No branches or pull requests

2 participants