<p>I must deploy a kubernetes cluster with <a href="https://coreos.com/tectonic/" rel="nofollow noreferrer">tectonic</a> for a client and I need a kuberenetes feature gate enabled, is that possible?</p>

<p>needed feature gate: <a href="https://kubernetes.io/blog/2018/04/13/local-persistent-volumes-beta/" rel="nofollow noreferrer">https://kubernetes.io/blog/2018/04/13/local-persistent-volumes-beta/</a> </p>

<p>needed for: <a href="https://www.arangodb.com/2018/03/arangodb-operator-kubernetes-stateful-cluster-deployments/" rel="nofollow noreferrer">https://www.arangodb.com/2018/03/arangodb-operator-kubernetes-stateful-cluster-deployments/</a></p>

<p>Kubernetes version: 1.9.6 (as provided by 1.9.6-tectonic.1)</p>

Radu Mazilu
<p>You don't need to enable feature gate for using local-storage in kubernetes cluster after kubernetes 1.10.</p>

<p>You can directly use <code>local-storage</code> same as any other storage class.</p>

<p>Please have a look at my following answer, how to setup <code>local-storage</code> PV, PVC in kubernetes.</p>

<p>EDIT: As you're on kubernetes 1.9, you can do it this way:</p>

<p>You need to provide the feature-gates while starting the cluster using <code>kubeadm init --config=config.yaml</code> to <code>apiserver</code>, <code>controller-manager</code> and <code>scheduler</code>. Please refer following config:</p>

<pre><code> apiVersion: kubeadm.k8s.io/v1alpha1
 kind: MasterConfiguration
 apiServerExtraArgs:
   service-node-port-range: 80-32767
   feature-gates: "PersistentLocalVolumes=true,VolumeScheduling=true,MountPropagation=true"
 controllerManagerExtraArgs:
   feature-gates: "PersistentLocalVolumes=true,VolumeScheduling=true,MountPropagation=true"
 schedulerExtraArgs:
   feature-gates: "PersistentLocalVolumes=true,VolumeScheduling=true,MountPropagation=true"
</code></pre>

<p>Then you need to create your own storage class, as there is no local-storage class present. So create your own class as follow:</p>

<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-storage-data
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
</code></pre>

<p>Now you can create your PV and PVC in following way:</p>

<p>PV Definition:</p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: mysql-mariadb-0
  labels:
    pod-name: mariadb-0
  annotations:
    "volume.alpha.kubernetes.io/node-affinity": '{
      "requiredDuringSchedulingIgnoredDuringExecution": {
        "nodeSelectorTerms": [
          { "matchExpressions": [
              { "key": "kubernetes.io/hostname",
                "operator": "In",
                "values": ["prod-mysql-0"]
              }
          ]}
        ]}}'
spec:
  capacity:
    storage: 2Gi
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage-data
  local:
    path: /mnt/local-storage/mysql-data-0
</code></pre>

<p>PVC definition:</p>

<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  labels:
    app: mariadb
  name: mysql-mariadb-0
  namespace: mysql
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi
  storageClassName: local-storage-data
  selector:
    matchLabels:
      pod-name: mariadb-0
</code></pre>

<blockquote>
  <p><a href="https://stackoverflow.com/questions/52948124/is-it-possible-to-mount-different-pods-to-the-same-portion-of-a-local-persistent/52952505#52952505">Is it possible to mount different pods to the same portion of a local persistent volume?</a></p>
</blockquote>

<p>Hope this helps</p>
