<p>Im trying to launch two Cassandra statefulset instances and respective PVC in a cluster created in AWS AZ (Across 3 zones, <em>eu-west-1a</em>, <em>eu-west-1b</em> &amp; <em>eu-west-1c</em>). </p>

<p>I created a node group with the following 2 nodes so as shown these nodes attach in the zones <em>eu-west-1a</em> and <em>eu-west-1b</em></p>

<pre><code>ip-192-168-47-86.eu-west-1.compute.internal - failure-domain.beta.kubernetes.io/zone=eu-west-1a,node-type=database-only
ip-192-168-3-191.eu-west-1.compute.internal - failure-domain.beta.kubernetes.io/zone=eu-west-1b,node-type=database-only
</code></pre>

<p>When I launch the Cassandra instances (using Helm) only one instance starts. The other instance shows the error,</p>

<pre><code>0/4 nodes are available: 2 node(s) didn't match node selector, 2 node(s) had no available volume zone.
</code></pre>

<p>The PVCs for these instances are bounded,</p>

<pre><code>kubectl get pvc -n storage -o wide
NAME                            STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
cassandra-data-cc-cassandra-0   Bound     pvc-81e30224-14c5-11e9-aa4e-06d38251f8aa   10Gi       RWO            gp2            4m
cassandra-data-cc-cassandra-1   Bound     pvc-abd30868-14c5-11e9-aa4e-06d38251f8aa   10Gi       RWO            gp2            3m
</code></pre>

<p>However, the PVs show that they are in zones <em>eu-west-1b</em> &amp; <em>eu-west-1c</em></p>

<pre><code>kubectl get pv -n storage --show-labels
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS    CLAIM                                   STORAGECLASS   REASON    AGE       LABELS
pvc-81e30224-14c5-11e9-aa4e-06d38251f8aa   10Gi       RWO            Delete           Bound     storage/cassandra-data-cc-cassandra-0   gp2                      7m        failure-domain.beta.kubernetes.io/region=eu-west-1,failure-domain.beta.kubernetes.io/zone=eu-west-1b
pvc-abd30868-14c5-11e9-aa4e-06d38251f8aa   10Gi       RWO            Delete           Bound     storage/cassandra-data-cc-cassandra-1   gp2                      6m        failure-domain.beta.kubernetes.io/region=eu-west-1,failure-domain.beta.kubernetes.io/zone=eu-west-1c
</code></pre>

<p>I have tried adding the following topology to the <code>StorageClass</code> to no avail,</p>

<pre><code>allowedTopologies:
- matchLabelExpressions:
  - key: failure-domain.beta.kubernetes.io/zone
    values:
    - eu-west-1a
    - eu-west-1b
</code></pre>

<p>But despite of this I can still see the PVs in the zones, <code>eu-west-1b</code> &amp; <code>eu-west-1c</code>. </p>

<p>Using K8 1.11.</p>

<p>Any other possible fixes ?</p>

<p>Looking at <a href="https://v1-11.docs.kubernetes.io/docs/concepts/storage/storage-classes/" rel="nofollow noreferrer">https://v1-11.docs.kubernetes.io/docs/concepts/storage/storage-classes/</a> <code>allowedTopologies</code> doesnt exist.</p>

<p>So I used <code>zones: eu-west-1a, eu-west-1b</code> in the <code>StorageClass</code> which seems to have worked.</p>

<pre><code>provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp2
  zones: eu-west-1a, eu-west-1b
</code></pre>
