<p>Datastax Spark Cassandra Connector takes &quot;spark.cassandra.connection.host&quot; for connecting to cassandra cluster.</p>
<ol>
<li><p>Can we provide headless service of C* cluster on K8S environment as host to this parameter(&quot;spark.cassandra.connection.host&quot;).</p>
</li>
<li><p>Will it resolve the contact points?</p>
</li>
<li><p>What is the preferred way of connecting with C* cluster on the K8s environment with Spark Cassandra Connector?</p>
</li>
</ol>

<p>By default, SCC resolves all provided contact points into IP addresses on the first connect, and then only uses these IP addresses for reconnection. And after initial connection happened, it discover the rest of the cluster. Usually this is not a problem as SCC should receive notifications about nodes up &amp; down and track nodes IP addresses.   But in practice, it could happen that nodes are restarted too fast, and notifications are not received, so Spark jobs that use SCC could stuck trying to connect to the IP addresses that aren't valid anymore - I hit this multiple times on the DC/OS.</p>
<p>This problem is solved with the <a href="https://www.datastax.com/blog/2020/05/advanced-apache-cassandra-analytics-now-open-all" rel="nofollow noreferrer">release of SCC 2.5.0</a> that includes a fix for <a href="https://datastax-oss.atlassian.net/browse/SPARKC-571" rel="nofollow noreferrer">SPARKC-571</a>. It introduced a new configuration parameter - <code>spark.cassandra.connection.resolveContactPoints</code> that when it's set to <code>false</code> (<code>true</code> by default) will always use hostnames of the contact points for both initial connection &amp; reconnection, avoiding the problems with changed IP addresses.</p>
<p>So on K8S I would try to use this configuration parameter with just normal Cassandra deployment.</p>
