I am trying to run ignite in kubernetes env with the following configuration.
Cluster-role.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: ignite
namespace: ignite
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: ignite
namespace: ignite
rules:
- apiGroups:
- ""
resources: # Here are the resources you can access
- pods
- endpoints
verbs: # That is what you can do with them
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ignite
roleRef:
kind: Role
name: ignite
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: ignite
namespace: ignite
deployment.yaml
# An example of a Kubernetes configuration for pod deployment.
apiVersion: apps/v1
kind: Deployment
metadata:
# Cluster name.
name: ignite-cluster
namespace: ignite
spec:
# The initial number of pods to be started by Kubernetes.
replicas: 2
selector:
matchLabels:
app: ignite
template:
metadata:
labels:
app: ignite
spec:
serviceAccountName: ignite
terminationGracePeriodSeconds: 60000
containers:
# Custom pod name.
- name: ignite-node
image: apacheignite/ignite:2.16.0
#image: gridgain/community
env:
- name: OPTION_LIBS
value: ignite-kubernetes,ignite-rest-http
- name: CONFIG_URI
value: file:///ignite/config/node-configuration.xml
resources:
requests:
memory: "1Gi"
cpu: "1"
limits:
memory: "2Gi"
cpu: "2"
ports:
# Ports to open.
- containerPort: 47100 # communication SPI port
name: discovery
- containerPort: 47500 # discovery SPI port
name: communication
- containerPort: 49112 # dafault JMX port
name: jmx
- containerPort: 10800 # thin clients/JDBC driver port
name: thinclients
- containerPort: 8080 # REST API
name: rest
volumeMounts:
- mountPath: /ignite/config
name: config-vol
volumes:
- name: config-vol
configMap:
name: ignite-config
node-configuration.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: ignite-config
namespace: ignite
data:
node-configuration.xml: |
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="stripedPoolSize" value="16" />
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder">
<property name="namespace" value="ignite" />
<property name="serviceName" value="ignite-service" />
</bean>
</property>
</bean>
</property>
<property name="cacheConfiguration">
<list>
<bean abstract="true" class="org.apache.ignite.configuration.CacheConfiguration" id="receiver-cache-template-bean">
<!-- when you create a template via XML configuration, you must add an asterisk to the name of the template -->
<property name="name" value="my-receiver-*" />
<property name="atomicityMode" value="TRANSACTIONAL" />
<!-- Other cache parameters -->
</bean>
</list>
</property>
</bean>
</beans>
Service.yaml
apiVersion: v1
kind: Service
metadata:
# The name must be equal to KubernetesConnectionConfiguration.serviceName
name: ignite-service
# The name must be equal to KubernetesConnectionConfiguration.namespace
namespace: ignite
labels:
app: ignite
spec:
type: LoadBalancer
ports:
- name: rest
port: 8080
targetPort: 8080
- name: thinclients
port: 10800
targetPort: 10800
- name: discovery
protocol: TCP
port: 47500
targetPort: 47500
- name: communication
protocol: TCP
port: 47100
targetPort: 47100
- name: jmx
protocol: TCP
port: 49112
targetPort: 49112
# Optional - remove 'sessionAffinity' property if the cluster
# and applications are deployed within Kubernetes
# sessionAffinity: ClientIP
selector:
# Must be equal to the label set for pods.
app: ignite
status:
loadBalancer: {}
After starting the containers, following errors are noticed in the logs.
[21:11:40,371][SEVERE][main][TcpDiscoverySpi] Failed to get registered addresses from IP finder (retrying every 2000ms; change 'reconnectDelay' to configure the frequency of retries) [maxTimeout=0]
class org.apache.ignite.spi.IgniteSpiException: Failed to retrieve Ignite pods IP addresses.
at org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder.getRegisteredAddresses(TcpDiscoveryKubernetesIpFinder.java:81)
at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.registeredAddresses(TcpDiscoverySpi.java:2057)
at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.resolvedAddresses(TcpDiscoverySpi.java:1992)
at org.apache.ignite.spi.discovery.tcp.ServerImpl.sendJoinRequestMessage(ServerImpl.java:1283)
at org.apache.ignite.spi.discovery.tcp.ServerImpl.joinTopology(ServerImpl.java:1120)
at org.apache.ignite.spi.discovery.tcp.ServerImpl.spiStart(ServerImpl.java:472)
at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.spiStart(TcpDiscoverySpi.java:2206)
at org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:277)
at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:1076)
at org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1774)
at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1161)
at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1725)
at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1647)
at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1089)
at org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:983)
at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:889)
at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:808)
at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:678)
at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:647)
at org.apache.ignite.Ignition.start(Ignition.java:325)
at org.apache.ignite.startup.cmdline.CommandLineStartup.main(CommandLineStartup.java:365)
Caused by: class org.apache.ignite.IgniteException: Failed to retrieve Ignite pods IP addresses.
at org.apache.ignite.internal.kubernetes.connection.KubernetesServiceAddressResolver.getServiceAddresses(KubernetesServiceAddressResolver.java:123)
at org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder.getRegisteredAddresses(TcpDiscoveryKubernetesIpFinder.java:76)
... 20 more
Tried all most of the suggestions on stackoverflow still same issue. If I change the image from apache to gridgain, every thing is working fine but not with image from Apache. Requirement is to use apache only.
Any help here is appreciated. Thank You.
1