<p>I have created Cassandra stateful/headless cluster on AWS and it's working fine inside the cluster. The only problem is I am not able to access it from outside cluster. I tried most of the things on the Kubernetes documentation or StackOverflow references, but still not able to solve it.</p>

<p>I have a working security group from AWS.
Here are my service and statefulset yaml files.</p>

<pre>
apiVersion: v1
kind: Service
metadata:
  name: cassandra
spec:
  externalTrafficPolicy: Local
  ports:
  - nodePort: 30000
    port: 30000
    protocol: TCP
    targetPort: 9042
  selector:
    app: cassandra
  type: NodePort
</pre>

<pre>
apiVersion: "apps/v1"
kind: StatefulSet
metadata:
  name: cassandra
spec:
  serviceName: cassandra
  replicas: 2
  selector:
    matchLabels:
      app: cassandra
  template:
    metadata:
      labels:
        role: cassandra
        app: cassandra
    spec:
      terminationGracePeriodSeconds: 10
      containers:
        - env:
            - name: MAX_HEAP_SIZE
              value: 1024M
            - name: HEAP_NEWSIZE
              value: 1024M
            - name: CASSANDRA_SEEDS
              value: "cassandra-0.cassandra.default.svc.cluster.local"
            - name: CASSANDRA_CLUSTER_NAME
              value: "SetuCassandra"
            - name: CASSANDRA_DC
              value: "DC1-SetuCassandra"
            - name: CASSANDRA_RACK
              value: "Rack1-SetuCassandra"
            - name: CASSANDRA_SEED_PROVIDER
              value: io.k8s.cassandra.KubernetesSeedProvider
            - name: POD_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
          image: library/cassandra:3.11
          name: cassandra
          volumeMounts:
            - mountPath: /cassandra-storage
              name: cassandra-storage
          ports:
            - containerPort: 9042
              name: cql
  volumeClaimTemplates:
  - metadata:
      name: cassandra-storage
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 320Gi
</pre>

<p>I appreciate any help on this.</p>

<p>There are not enough details on the AWS security groups. But my guess is that your security group(s) in your cluster are not allowing traffic from the security groups or IP addresses from the other cluster. Something like this:</p>

<p><a href="https://i.stack.imgur.com/DuimM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DuimM.png" alt="enter image description here"></a></p>
