k8s.io/kubernetes@v1.29.3/pkg/controller/volume/persistentvolume/config/types.go (about)

     1  /*
     2  Copyright 2019 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package config
    18  
    19  import (
    20  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    21  )
    22  
    23  // PersistentVolumeBinderControllerConfiguration contains elements describing
    24  // PersistentVolumeBinderController.
    25  type PersistentVolumeBinderControllerConfiguration struct {
    26  	// pvClaimBinderSyncPeriod is the period for syncing persistent volumes
    27  	// and persistent volume claims.
    28  	PVClaimBinderSyncPeriod metav1.Duration
    29  	// volumeConfiguration holds configuration for volume related features.
    30  	VolumeConfiguration VolumeConfiguration
    31  	// DEPRECATED: VolumeHostCIDRDenylist is a list of CIDRs that should not be reachable by the
    32  	// controller from plugins.
    33  	VolumeHostCIDRDenylist []string
    34  	// DEPRECATED: VolumeHostAllowLocalLoopback indicates if local loopback hosts (127.0.0.1, etc)
    35  	// should be allowed from plugins.
    36  	VolumeHostAllowLocalLoopback bool
    37  }
    38  
    39  // VolumeConfiguration contains *all* enumerated flags meant to configure all volume
    40  // plugins. From this config, the controller-manager binary will create many instances of
    41  // volume.VolumeConfig, each containing only the configuration needed for that plugin which
    42  // are then passed to the appropriate plugin. The ControllerManager binary is the only part
    43  // of the code which knows what plugins are supported and which flags correspond to each plugin.
    44  type VolumeConfiguration struct {
    45  	// enableHostPathProvisioning enables HostPath PV provisioning when running without a
    46  	// cloud provider. This allows testing and development of provisioning features. HostPath
    47  	// provisioning is not supported in any way, won't work in a multi-node cluster, and
    48  	// should not be used for anything other than testing or development.
    49  	EnableHostPathProvisioning bool
    50  	// enableDynamicProvisioning enables the provisioning of volumes when running within an environment
    51  	// that supports dynamic provisioning. Defaults to true.
    52  	EnableDynamicProvisioning bool
    53  	// persistentVolumeRecyclerConfiguration holds configuration for persistent volume plugins.
    54  	PersistentVolumeRecyclerConfiguration PersistentVolumeRecyclerConfiguration
    55  	// volumePluginDir is the full path of the directory in which the flex
    56  	// volume plugin should search for additional third party volume plugins
    57  	FlexVolumePluginDir string
    58  }
    59  
    60  // PersistentVolumeRecyclerConfiguration contains elements describing persistent volume plugins.
    61  type PersistentVolumeRecyclerConfiguration struct {
    62  	// maximumRetry is number of retries the PV recycler will execute on failure to recycle
    63  	// PV.
    64  	MaximumRetry int32
    65  	// minimumTimeoutNFS is the minimum ActiveDeadlineSeconds to use for an NFS Recycler
    66  	// pod.
    67  	MinimumTimeoutNFS int32
    68  	// podTemplateFilePathNFS is the file path to a pod definition used as a template for
    69  	// NFS persistent volume recycling
    70  	PodTemplateFilePathNFS string
    71  	// incrementTimeoutNFS is the increment of time added per Gi to ActiveDeadlineSeconds
    72  	// for an NFS scrubber pod.
    73  	IncrementTimeoutNFS int32
    74  	// podTemplateFilePathHostPath is the file path to a pod definition used as a template for
    75  	// HostPath persistent volume recycling. This is for development and testing only and
    76  	// will not work in a multi-node cluster.
    77  	PodTemplateFilePathHostPath string
    78  	// minimumTimeoutHostPath is the minimum ActiveDeadlineSeconds to use for a HostPath
    79  	// Recycler pod.  This is for development and testing only and will not work in a multi-node
    80  	// cluster.
    81  	MinimumTimeoutHostPath int32
    82  	// incrementTimeoutHostPath is the increment of time added per Gi to ActiveDeadlineSeconds
    83  	// for a HostPath scrubber pod.  This is for development and testing only and will not work
    84  	// in a multi-node cluster.
    85  	IncrementTimeoutHostPath int32
    86  }