io.kubernetes.client.openapi.models.V1NFSVolumeSource Java Examples

The following examples show how to use io.kubernetes.client.openapi.models.V1NFSVolumeSource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: V1Volume.java    From java with Apache License 2.0 5 votes vote down vote up
/**
 * Get nfs
 * @return nfs
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")

public V1NFSVolumeSource getNfs() {
  return nfs;
}
 
Example #2
Source File: V1PersistentVolumeSpec.java    From java with Apache License 2.0 5 votes vote down vote up
/**
 * Get nfs
 * @return nfs
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")

public V1NFSVolumeSource getNfs() {
  return nfs;
}
 
Example #3
Source File: RequestObjectBuilder.java    From twister2 with Apache License 2.0 5 votes vote down vote up
/**
   * we initially used this method to create PersistentVolumes
   * we no longer use this method
   * it is just here in case we may need it for some reason at one point
   */
  public static V1PersistentVolume createPersistentVolumeObject(String pvName) {
    V1PersistentVolume pv = new V1PersistentVolume();
    pv.setApiVersion("v1");

    // set pv name
    V1ObjectMeta meta = new V1ObjectMeta();
    meta.setName(pvName);
    pv.setMetadata(meta);

//    double volumeSize = SchedulerContext.persistentVolumeTotal(config);
    V1PersistentVolumeSpec pvSpec = new V1PersistentVolumeSpec();
    HashMap<String, Quantity> capacity = new HashMap<>();
//    capacity.put("storage", new Quantity(volumeSize + "Gi"));
    pvSpec.setCapacity(capacity);

    String storageClass = KubernetesContext.persistentStorageClass(config);
    String accessMode = KubernetesContext.storageAccessMode(config);
//    String reclaimPolicy = KubernetesContext.storageReclaimPolicy(config);
    pvSpec.setStorageClassName(storageClass);
    pvSpec.setAccessModes(Arrays.asList(accessMode));
//    pvSpec.setPersistentVolumeReclaimPolicy(reclaimPolicy);
//    pvSpec.setMountOptions(Arrays.asList("hard", "nfsvers=4.1"));

    V1NFSVolumeSource nfsVolumeSource = new V1NFSVolumeSource();
    nfsVolumeSource.setServer(SchedulerContext.nfsServerAddress(config));
    nfsVolumeSource.setPath(SchedulerContext.nfsServerPath(config));
    pvSpec.setNfs(nfsVolumeSource);

    pv.setSpec(pvSpec);

    return pv;
  }
 
Example #4
Source File: Volumes.java    From incubator-heron with Apache License 2.0 5 votes vote down vote up
@Override
public V1Volume create(Config config) {
  final V1Volume volume = newVolume(config);

  final String path = KubernetesContext.getNfsVolumePath(config);
  final String server = KubernetesContext.getNfsServer(config);
  V1NFSVolumeSource nfsVolumeSource =
      new V1NFSVolumeSource()
          .path(path)
          .server(server);
  volume.setNfs(nfsVolumeSource);

  return volume;
}
 
Example #5
Source File: V1Volume.java    From java with Apache License 2.0 4 votes vote down vote up
public void setNfs(V1NFSVolumeSource nfs) {
  this.nfs = nfs;
}
 
Example #6
Source File: V1PersistentVolumeSpec.java    From java with Apache License 2.0 4 votes vote down vote up
public void setNfs(V1NFSVolumeSource nfs) {
  this.nfs = nfs;
}