I am deploying kubernetes pod through blue green deployment. The POD is a micro-service which uses Ignite in embedded mode and forms a cluster when deployed hence data is shared among the service instances. Things were working fine during rolling deployment.
However during Blue Green Deployment using harness a new services is created for green deployment as well as the deployment Objects and Pods are created. During this time the configuration of Ignite Still points to the original service (blue service) this is done as later in blue green deployment services are switched. However once the services are switched Ignite fails to form a cluster and data is not shared among the instances.
Configuration used to form Cluster
k8sConnectionConfiguration -> object is crated by setting namespace and Service Name TcpDiscoverySpi is created using TcpDiscoveryKubernetesIpFinder
KubernetesConnectionConfiguration connConfig = new KubernetesConnectionConfiguration();
connConfig.setNamespace("namespace");
connConfig.setServiceName("service-name");
TcpDiscoveryKubernetesIpFinder tcpDiscoveryKubernetesIpFinder = new TcpDiscoveryKubernetesIpFinder(connConfig);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(tcpDiscoveryKubernetesIpFinder);
igniteConfig.setDiscoverySpi(spi);