<p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.):<br>
Yes</p>
<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):</p>
<ul dir="auto">
<li>glusterfs</li>
<li>volume</li>
<li>provisioning</li>
</ul>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one):<br>
BUG REPORT</p>

<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;4&quot;, GitVersion:&quot;v1.4.3&quot;, GitCommit:&quot;4957b090e9a4f6a68b4a40375408fdc74a212260&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2016-10-16T06:36:33Z&quot;, GoVersion:&quot;go1.7.1&quot;, Compiler:&quot;gc&quot;, Platform:&quot;darwin/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;4&quot;, GitVersion:&quot;v1.4.1&quot;, GitCommit:&quot;33cf7b9acbb2cb7c9c72a10d6636321fb180b159&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2016-10-10T18:13:36Z&quot;, GoVersion:&quot;go1.6.3&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}"><pre class="notranslate"><code class="notranslate">Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.3", GitCommit:"4957b090e9a4f6a68b4a40375408fdc74a212260", GitTreeState:"clean", BuildDate:"2016-10-16T06:36:33Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.1", GitCommit:"33cf7b9acbb2cb7c9c72a10d6636321fb180b159", GitTreeState:"clean", BuildDate:"2016-10-10T18:13:36Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
</code></pre></div>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>: On-prem VSphere</li>
<li><strong>OS</strong> (e.g. from /etc/os-release): Ubuntu 16.04 LTS</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>):</li>
<li><strong>Install tools</strong>: Kubeadm</li>
<li><strong>Others</strong>:</li>
<li>Heketi</li>
<li>GlusterFS</li>
</ul>
<p dir="auto"><strong>What happened</strong>:<br>
When provisioning a GlusterFS volume via PVC, GlusterFS volume is created but with a durability_type of "None" instead of "replicate" according to:</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/kubernetes/kubernetes/blob/4e393fadf3df60bc15696e9d965f635fefb2a6e9/pkg/volume/glusterfs/glusterfs.go#L60">kubernetes/pkg/volume/glusterfs/glusterfs.go</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 60
      in
      <a data-pjax="true" class="commit-tease-sha" href="/kubernetes/kubernetes/commit/4e393fadf3df60bc15696e9d965f635fefb2a6e9">4e393fa</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L60" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="60"></td>
          <td id="LC60" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">durabilitytype</span>            <span class="pl-c1">=</span> <span class="pl-s">"replicate"</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">When doing a <code class="notranslate">heketi volume info</code> on the created PV, this is the result:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[root@415dd3a6d47d /]# heketi-cli volume info 2f85f8c8c7eabf2daf3b50065bf3160d
Name: vol_2f85f8c8c7eabf2daf3b50065bf3160d
Size: 5
Volume Id: 2f85f8c8c7eabf2daf3b50065bf3160d
Cluster Id: 0ea05409eedd61cf1678d2e8693bdae8
Mount: 10.130.7.153:vol_2f85f8c8c7eabf2daf3b50065bf3160d
Mount Options: backup-volfile-servers=
Durability Type: none"><pre class="notranslate"><code class="notranslate">[root@415dd3a6d47d /]# heketi-cli volume info 2f85f8c8c7eabf2daf3b50065bf3160d
Name: vol_2f85f8c8c7eabf2daf3b50065bf3160d
Size: 5
Volume Id: 2f85f8c8c7eabf2daf3b50065bf3160d
Cluster Id: 0ea05409eedd61cf1678d2e8693bdae8
Mount: 10.130.7.153:vol_2f85f8c8c7eabf2daf3b50065bf3160d
Mount Options: backup-volfile-servers=
Durability Type: none
</code></pre></div>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<p dir="auto">Durability Type should be <code class="notranslate">replicate</code>.</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):</p>
<ul dir="auto">
<li>Create a default storageclass for glusterfs that points to heketi's REST server</li>
<li>In your PVC, use glusterfs StorageClass</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: glusterclaim-1
      annotations:
        volume.beta.kubernetes.io/storage-class: &quot;glusterfs&quot;
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: &quot;5Gi&quot;"><pre class="notranslate"><code class="notranslate">    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: glusterclaim-1
      annotations:
        volume.beta.kubernetes.io/storage-class: "glusterfs"
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: "5Gi"
</code></pre></div>
<ul dir="auto">
<li>After doing a <code class="notranslate">kubectl get pv</code>, notice that the PV is created and bounded to the claim</li>
<li>Connect to the heketi server and do a <code class="notranslate">heketi volume list</code> and do a <code class="notranslate">heketi volume info</code> on the newly created volume.</li>
<li>You should notice that the volume is created with a Durability Type of 'none'</li>
</ul>
<p dir="auto"><strong>Anything else do we need to know</strong>:</p>
<p dir="auto">Broken out from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="40954231" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1007" data-hovercard-type="pull_request" data-hovercard-url="/kubernetes/kubernetes/pull/1007/hovercard" href="https://github.com/kubernetes/kubernetes/pull/1007">#1007</a>, which was unwieldy.</p>
<p dir="auto">A configuration system needs to be able to diff a new desired state generated from the configuration with the current desired state registered with the system, in a generic, extensible manner, in order to determine which objects require updates (as well as potentially what kinds of updates). In order to do this, it needs uniform structure across all API objects, clean separation of input and output values, and clean differentiation of user-provided values and automatically determined values, including default values.</p>
<p dir="auto">Currently, our API objects contain:</p>
<ul dir="auto">
<li>(all, even lists which is questionable) JSONBase, which includes Kind, ID, CreationTimestamp, SelfLink, ResourceVersion, and APIVersion</li>
<li>(Pod, ReplicationController, Service) Labels</li>
<li>(Pod, ReplicationController) DesiredState</li>
<li>(Pod only) CurrentState</li>
</ul>
<p dir="auto">In JSONBase, only ID is explicitly provided by the client and only ResourceVersion is mutable.</p>
<p dir="auto">In Pod, DesiredState and CurrentState use the same schema, mixing input and output fields (Manifest, RestartPolicy, Host, HostIP, PodIP, Info).</p>
<p dir="auto">Service lacks DesiredState and CurrentState.</p>
<p dir="auto">ReplicationController lacks CurrentState (though that may change with <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="39314912" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/736" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/736/hovercard" href="https://github.com/kubernetes/kubernetes/issues/736">#736</a>).</p>
<p dir="auto">Proposals:</p>
<ol dir="auto">
<li>Nest JSONBase in a named field, such as Metadata, to more coarsely bucket them within the objects.</li>
<li>Move Labels to JSONBase, so that they're in the same position in every object, together with other generic object metadata. Split Labels into FinalLabels and DynamicLabels. FinalLabels could only be specified at creation time, and would not be mutable. DynamicLabels would be applied at run time and would be ignored in the reconciliation diff. If people thought it would be useful, we could introduce a convenience field (e.g., Labels) that presented a merged view. An alternative would be to represent finality as a bit on each label.</li>
<li>Duplicate DesiredState into PrimaryDesiredState, FallbackDesiredState, and DesiredState, and add these to every object. PrimaryDesiredState would be the state set from configuration, and would be the only part of the objects diff'ed by the configuration reconciliation process. FallbackDesiredState would be set by automated processes, such as default values provided by configuration and deployment tools, default values initialized by apiserver itself, values filled in by other automation systems such as auto-scalers (e.g., the replicas field in replicationController), and so on. The PrimaryDesiredState values would always override the FallbackDesiredState values (called shadow values in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="40954231" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1007" data-hovercard-type="pull_request" data-hovercard-url="/kubernetes/kubernetes/pull/1007/hovercard" href="https://github.com/kubernetes/kubernetes/pull/1007">#1007</a>). DesiredState would present a merged view for components that needed to act upon the full DesiredState. Again, an alternative would be to keep track of whether values should be diff'ed with a bit on each field. That has at least one disadvantage, in that automatically initialized values would be lost in the case that they were overwritten by configuration that was then later reverted. However, it may be simpler for components that don't care about the distinction and may be more space efficient, depending on our internal representation.</li>
<li>Add CurrentState to all objects that are lacking it.</li>
<li>Use different representations for desired and current state in Pod, appropriately divide the fields between them, and merge ContainerManifest into the new PodDesiredState type.</li>
</ol>