Documentation ¶
Index ¶
- Constants
- func Base64Decode(src string) ([]byte, error)
- func Base64Encode(src []byte) string
- func DaemonSetToSvc(ds *appsv1.DaemonSet, sty ServiceType, autoRelease ...bool) (*v1.Service, error)
- func DeploymentToSvc(dp *appsv1.Deployment, sty ServiceType, autoRelease ...bool) (*v1.Service, error)
- func FromInt(val int) intstr.IntOrString
- func FromString(val string) intstr.IntOrString
- func GetKubeClient(isInCluster ...bool) (*kubernetes.Clientset, error)
- func GetPodQOS(pod v1.PodSpec) v1.PodQOSClass
- func JSONToYAML(jbyts []byte) (ybyts []byte, err error)
- func MapsToResources(resources map[string]string) map[ResourceName]string
- func Parse(val string) intstr.IntOrString
- func RegisterK8sClient(host, ca, cert, key string) error
- func RegisterK8sClientBase64(host, ca, cert, key string) error
- func RegisterResourceLimit(limits map[ResourceName]string) error
- func RegisterResourceRequest(request map[ResourceName]string) error
- func ResourceMapsToK8s(maps map[ResourceName]string) (v1.ResourceList, error)
- func StatefulSetToSvc(sts *appsv1.StatefulSet, sty ServiceType, isHeadless bool, autoRelease ...bool) (*v1.Service, error)
- func ToJSON(v interface{}) (byts []byte, err error)
- func ToYAML(o interface{}) (byts []byte, err error)
- func ViaTLS(ca, cert, key []byte) bool
- func YAMLToJSON(ybyts []byte) (jbyts []byte, err error)
- type CephFSPersistentVolumeSource
- type ClusterRole
- func (obj *ClusterRole) Finish() (*v1beta1.ClusterRole, error)
- func (obj *ClusterRole) JSONNew(jsonbyts []byte) *ClusterRole
- func (obj *ClusterRole) SetName(name string) *ClusterRole
- func (obj *ClusterRole) SetRole(verbs, apiGroups, resources []string) *ClusterRole
- func (obj *ClusterRole) YAMLNew(yamlbyts []byte) *ClusterRole
- type ClusterRoleBinding
- func (obj *ClusterRoleBinding) Finish() (*v1beta1.ClusterRoleBinding, error)
- func (obj *ClusterRoleBinding) JSONNew(jsonbyts []byte) *ClusterRoleBinding
- func (obj *ClusterRoleBinding) SetName(name string) *ClusterRoleBinding
- func (obj *ClusterRoleBinding) SetRoleRef(name string) *ClusterRoleBinding
- func (obj *ClusterRoleBinding) Subject(name string, kind SubKind, namespace string) *ClusterRoleBinding
- func (obj *ClusterRoleBinding) YAMLNew(yamlbyts []byte) *ClusterRoleBinding
- type ConfigMap
- func (obj *ConfigMap) Apply() (*v1.ConfigMap, error)
- func (obj *ConfigMap) Finish() (cm *v1.ConfigMap, err error)
- func (obj *ConfigMap) JSONNew(jsonbyts []byte) *ConfigMap
- func (obj *ConfigMap) Release() (*v1.ConfigMap, error)
- func (obj *ConfigMap) Replace(cm *v1.ConfigMap) *ConfigMap
- func (obj *ConfigMap) SetData(data map[string]string) *ConfigMap
- func (obj *ConfigMap) SetLabels(labels map[string]string) *ConfigMap
- func (obj *ConfigMap) SetName(name string) *ConfigMap
- func (obj *ConfigMap) SetNamespace(namespace string) *ConfigMap
- func (obj *ConfigMap) SetNamespaceAndName(namespace, name string) *ConfigMap
- func (obj *ConfigMap) YAMLNew(yamlbyts []byte) *ConfigMap
- type DaemonSet
- func (obj *DaemonSet) Apply() (*v1.DaemonSet, error)
- func (obj *DaemonSet) Finish() (*v1.DaemonSet, error)
- func (obj *DaemonSet) GetPodLabel() map[string]string
- func (obj *DaemonSet) ImagePullPolicy(pullPolicy PullPolicy) *DaemonSet
- func (obj *DaemonSet) JSONNew(jsonbyts []byte) *DaemonSet
- func (obj *DaemonSet) Release() (*v1.DaemonSet, error)
- func (obj *DaemonSet) Replace(ds *v1.DaemonSet) *DaemonSet
- func (obj *DaemonSet) SetAnnotations(annotations map[string]string) *DaemonSet
- func (obj *DaemonSet) SetCMDLiveness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *DaemonSet
- func (obj *DaemonSet) SetCMDReadness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *DaemonSet
- func (obj *DaemonSet) SetContainer(name, image string, containerPort int32) *DaemonSet
- func (obj *DaemonSet) SetEnvs(envMap map[string]string) *DaemonSet
- func (obj *DaemonSet) SetHTTPLiveness(port int, path string, initDelaySec, timeoutSec, periodSec int32, ...) *DaemonSet
- func (obj *DaemonSet) SetHTTPReadness(port int, path string, initDelaySec, timeoutSec, periodSec int32, ...) *DaemonSet
- func (obj *DaemonSet) SetHistoryLimit(limit int32) *DaemonSet
- func (obj *DaemonSet) SetImagePullSecrets(secretName string) *DaemonSet
- func (obj *DaemonSet) SetLabels(labels map[string]string) *DaemonSet
- func (obj *DaemonSet) SetMinReadySeconds(sec int32) *DaemonSet
- func (obj *DaemonSet) SetName(name string) *DaemonSet
- func (obj *DaemonSet) SetNamespace(namespace string) *DaemonSet
- func (obj *DaemonSet) SetNamespaceAndName(namespace, name string) *DaemonSet
- func (obj *DaemonSet) SetPVCMounts(volumeName, mountPath string) *DaemonSet
- func (obj *DaemonSet) SetPVClaim(volumeName, claimName string) *DaemonSet
- func (obj *DaemonSet) SetPodLabels(labels map[string]string) *DaemonSet
- func (obj *DaemonSet) SetPodPriorityClass(priorityClassName string) *DaemonSet
- func (obj *DaemonSet) SetPodQos(qosClass string, autoSet ...bool) *DaemonSet
- func (obj *DaemonSet) SetPostStartExec(command []string) *DaemonSet
- func (obj *DaemonSet) SetPostStartHTTP(scheme URIScheme, host string, port int, path string, ...) *DaemonSet
- func (obj *DaemonSet) SetPreStopExec(command []string) *DaemonSet
- func (obj *DaemonSet) SetPreStopHTTP(scheme URIScheme, host string, port int, path string, ...) *DaemonSet
- func (obj *DaemonSet) SetSelector(selector map[string]string) *DaemonSet
- func (obj *DaemonSet) SetTCPLiveness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *DaemonSet
- func (obj *DaemonSet) SetTCPReadness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *DaemonSet
- func (obj *DaemonSet) YAMLNew(yamlbyts []byte) *DaemonSet
- type Deployment
- func (obj *Deployment) Apply() (*v1.Deployment, error)
- func (obj *Deployment) DelNodeAffinity(keys []string) *Deployment
- func (obj *Deployment) Finish() (dp *v1.Deployment, err error)
- func (obj *Deployment) GetPodLabel() map[string]string
- func (obj *Deployment) ImagePullPolicy(pullPolicy PullPolicy) *Deployment
- func (obj *Deployment) JSONNew(jsonbyts []byte) *Deployment
- func (obj *Deployment) Release() (*v1.Deployment, error)
- func (obj *Deployment) Replace(dp *v1.Deployment) *Deployment
- func (obj *Deployment) SetAnnotations(annotations map[string]string) *Deployment
- func (obj *Deployment) SetCMDLiveness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *Deployment
- func (obj *Deployment) SetCMDReadness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *Deployment
- func (obj *Deployment) SetContainer(name, image string, containerPort int32) *Deployment
- func (obj *Deployment) SetContainerOne(container corev1.Container) *Deployment
- func (obj *Deployment) SetDeployMaxTime(sec int32) *Deployment
- func (obj *Deployment) SetEnvs(envMap map[string]string) *Deployment
- func (obj *Deployment) SetHTTPLiveness(port int, path string, initDelaySec, timeoutSec, periodSec int32, ...) *Deployment
- func (obj *Deployment) SetHTTPReadness(port int, path string, initDelaySec, timeoutSec, periodSec int32, ...) *Deployment
- func (obj *Deployment) SetHistoryLimit(limit int32) *Deployment
- func (obj *Deployment) SetImagePullSecrets(secretName string) *Deployment
- func (obj *Deployment) SetLabels(labels map[string]string) *Deployment
- func (obj *Deployment) SetMatchExpressions(ents []LabelSelectorRequirement) *Deployment
- func (obj *Deployment) SetMinReadySeconds(sec int32) *Deployment
- func (obj *Deployment) SetName(name string) *Deployment
- func (obj *Deployment) SetNamespace(namespace string) *Deployment
- func (obj *Deployment) SetNamespaceAndName(namespace, name string) *Deployment
- func (obj *Deployment) SetPVCMounts(volumeName, mountPath string) *Deployment
- func (obj *Deployment) SetPVClaim(volumeName, claimName string) *Deployment
- func (obj *Deployment) SetPodLabels(labels map[string]string) *Deployment
- func (obj *Deployment) SetPodPriorityClass(priorityClassName string) *Deployment
- func (obj *Deployment) SetPodQos(qosClass string, autoSet ...bool) *Deployment
- func (obj *Deployment) SetPostStartExec(command []string) *Deployment
- func (obj *Deployment) SetPostStartHTTP(scheme URIScheme, host string, port int, path string, ...) *Deployment
- func (obj *Deployment) SetPreStopExec(command []string) *Deployment
- func (obj *Deployment) SetPreStopHTTP(scheme URIScheme, host string, port int, path string, ...) *Deployment
- func (obj *Deployment) SetPreferredNodeAffinity(weight int32, key string, value []string, operator NodeSelectorOperator) *Deployment
- func (obj *Deployment) SetReplicas(replicas int32) *Deployment
- func (obj *Deployment) SetRequiredAndNodeAffinity(key string, value []string, operator NodeSelectorOperator) *Deployment
- func (obj *Deployment) SetRequiredORNodeAffinity(key string, value []string, operator NodeSelectorOperator) *Deployment
- func (obj *Deployment) SetResourceLimit(limits map[ResourceName]string) *Deployment
- func (obj *Deployment) SetResourceRequst(requests map[ResourceName]string) *Deployment
- func (obj *Deployment) SetSelector(labels map[string]string) *Deployment
- func (obj *Deployment) SetTCPLiveness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *Deployment
- func (obj *Deployment) SetTCPReadness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *Deployment
- func (obj *Deployment) SetToleration(key, value string, operator TolerationOperator, effect TaintEffect, ...) *Deployment
- func (obj *Deployment) YAMLNew(yamlbyts []byte) *Deployment
- type LabelSelector
- type LabelSelectorOperator
- type LabelSelectorRequirement
- type NFSVolumeSource
- type Namespace
- type Node
- func (obj *Node) DelNodeLabels(labels map[string]string) *Node
- func (obj *Node) Finish() (node *v1.Node, err error)
- func (obj *Node) SetAnnotations(annotations map[string]string) *Node
- func (obj *Node) SetLabels(labels map[string]string) *Node
- func (obj *Node) SetTaints(key, value string, effect TaintEffect) *Node
- type NodeSelectorOperator
- type PersistentVolume
- func (obj *PersistentVolume) Apply() (*v1.PersistentVolume, error)
- func (obj *PersistentVolume) Finish() (*v1.PersistentVolume, error)
- func (obj *PersistentVolume) GetLabels() map[string]string
- func (obj *PersistentVolume) GetName() string
- func (obj *PersistentVolume) JSONNew(jsonbyte []byte) *PersistentVolume
- func (obj *PersistentVolume) Release() (*v1.PersistentVolume, error)
- func (obj *PersistentVolume) Replace(pv *v1.PersistentVolume) *PersistentVolume
- func (obj *PersistentVolume) SetAccessMode(mode PersistentVolumeAccessMode) *PersistentVolume
- func (obj *PersistentVolume) SetAccessModes(modes []PersistentVolumeAccessMode) *PersistentVolume
- func (obj *PersistentVolume) SetAnnotations(annotations map[string]string) *PersistentVolume
- func (obj *PersistentVolume) SetCapacity(capMaps map[ResourceName]string) *PersistentVolume
- func (obj *PersistentVolume) SetCephFS(cephFs *CephFSPersistentVolumeSource) *PersistentVolume
- func (obj *PersistentVolume) SetLabels(labels map[string]string) *PersistentVolume
- func (obj *PersistentVolume) SetNFS(nfs *NFSVolumeSource) *PersistentVolume
- func (obj *PersistentVolume) SetName(name string) *PersistentVolume
- func (obj *PersistentVolume) SetRBD(rbd *RBDPersistentVolumeSource) *PersistentVolume
- func (obj *PersistentVolume) SetReclaimPolicy(reclaimPolicy PersistentVolumeReclaimPolicy) *PersistentVolume
- func (obj *PersistentVolume) YAMLNew(yamlbyts []byte) *PersistentVolume
- type PersistentVolumeAccessMode
- type PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) Apply() (*v1.PersistentVolumeClaim, error)
- func (obj *PersistentVolumeClaim) Finish() (*v1.PersistentVolumeClaim, error)
- func (obj *PersistentVolumeClaim) GetLabels() map[string]string
- func (obj *PersistentVolumeClaim) GetName() string
- func (obj *PersistentVolumeClaim) GetNamespace() string
- func (obj *PersistentVolumeClaim) GetSelector() map[string]string
- func (obj *PersistentVolumeClaim) JSONNew(jsonbyts []byte) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) Release() (*v1.PersistentVolumeClaim, error)
- func (obj *PersistentVolumeClaim) Replace(pvc *v1.PersistentVolumeClaim) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetAccessMode(mode PersistentVolumeAccessMode) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetAccessModes(modes []PersistentVolumeAccessMode) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetAnnotations(annotations map[string]string) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetLabels(labels map[string]string) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetMatchExpressions(ents []LabelSelectorRequirement) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetName(name string) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetNamespace(namespace string) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetNamespaceAndName(namespace, name string) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetResourceLimits(limits map[ResourceName]string) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetResourceRequests(requests map[ResourceName]string) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetSelector(labels map[string]string) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetStorageClassName(classname string) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) SetVolumeMode(volumeMode PersistentVolumeMode) *PersistentVolumeClaim
- func (obj *PersistentVolumeClaim) YAMLNew(yamlbyts []byte) *PersistentVolumeClaim
- type PersistentVolumeMode
- type PersistentVolumeReclaimPolicy
- type Pod
- func (obj *Pod) Finish() (pod *v1.Pod, err error)
- func (obj *Pod) JSONNew(jsonbyts []byte) *Pod
- func (obj *Pod) SetContainer(name, image string, containerPort int32) *Pod
- func (obj *Pod) SetLabels(labels map[string]string) *Pod
- func (obj *Pod) SetName(name string) *Pod
- func (obj *Pod) SetNamespace(namespace string) *Pod
- func (obj *Pod) SetNamespaceAndName(namespace, name string) *Pod
- func (obj *Pod) YAMLNew(yamlbyts []byte) *Pod
- type PodQOSClass
- type Protocol
- type PullPolicy
- type QOSList
- type RBDPersistentVolumeSource
- type ResourceName
- type Secret
- func (obj *Secret) Apply() (*v1.Secret, error)
- func (obj *Secret) Finish() (*v1.Secret, error)
- func (obj *Secret) JSONNew(jsonbyts []byte) *Secret
- func (obj *Secret) Release() (*v1.Secret, error)
- func (obj *Secret) Replace(sec *v1.Secret) *Secret
- func (obj *Secret) SetDataBytes(bytes map[string][]byte) *Secret
- func (obj *Secret) SetDataString(datas map[string]string) *Secret
- func (obj *Secret) SetLabels(labels map[string]string) *Secret
- func (obj *Secret) SetName(name string) *Secret
- func (obj *Secret) SetNamespace(namespace string) *Secret
- func (obj *Secret) SetNamespaceAndName(namespace, name string) *Secret
- func (obj *Secret) SetType(secType SecretType) *Secret
- func (obj *Secret) YAMLNew(yamlbyts []byte) *Secret
- type SecretReference
- type SecretType
- type Service
- func (obj *Service) Apply() (*v1.Service, error)
- func (obj *Service) Finish() (svc *v1.Service, err error)
- func (obj *Service) Headless() *Service
- func (obj *Service) JSONNew(jsonbyts []byte) *Service
- func (obj *Service) Release() (*v1.Service, error)
- func (obj *Service) Replace(svc *v1.Service) *Service
- func (obj *Service) SetAnnotations(annotations map[string]string) *Service
- func (obj *Service) SetLabels(labels map[string]string) *Service
- func (obj *Service) SetName(name string) *Service
- func (obj *Service) SetNamespace(namespace string) *Service
- func (obj *Service) SetNamespaceAndName(namespace, name string) *Service
- func (obj *Service) SetPort(sp ServicePort) *Service
- func (obj *Service) SetPorts(ports []ServicePort) *Service
- func (obj *Service) SetSelector(selector map[string]string) *Service
- func (obj *Service) SetServiceType(sty ServiceType) *Service
- func (obj *Service) SetSessionAffinity(affinity ServiceAffinity) *Service
- func (obj *Service) YAMLNew(yamlbyts []byte) *Service
- type ServiceAccount
- type ServiceAffinity
- type ServicePort
- type ServiceType
- type StatefulSet
- func (obj *StatefulSet) Apply() (*v1.StatefulSet, error)
- func (obj *StatefulSet) Finish() (*v1.StatefulSet, error)
- func (obj *StatefulSet) GetPodLabel() map[string]string
- func (obj *StatefulSet) ImagePullPolicy(pullPolicy PullPolicy) *StatefulSet
- func (obj *StatefulSet) JSONNew(jsonbyts []byte) *StatefulSet
- func (obj *StatefulSet) Release() (*v1.StatefulSet, error)
- func (obj *StatefulSet) Replace(sts *v1.StatefulSet) *StatefulSet
- func (obj *StatefulSet) SetAnnotations(annotations map[string]string) *StatefulSet
- func (obj *StatefulSet) SetCMDLiveness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *StatefulSet
- func (obj *StatefulSet) SetCMDReadness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *StatefulSet
- func (obj *StatefulSet) SetContainer(name, image string, containerPort int32) *StatefulSet
- func (obj *StatefulSet) SetEnvs(envMap map[string]string) *StatefulSet
- func (obj *StatefulSet) SetHTTPLiveness(port int, path string, initDelaySec, timeoutSec, periodSec int32, ...) *StatefulSet
- func (obj *StatefulSet) SetHTTPReadness(port int, path string, initDelaySec, timeoutSec, periodSec int32, ...) *StatefulSet
- func (obj *StatefulSet) SetImagePullSecrets(secretName string) *StatefulSet
- func (obj *StatefulSet) SetLabels(labels map[string]string) *StatefulSet
- func (obj *StatefulSet) SetName(name string) *StatefulSet
- func (obj *StatefulSet) SetNamespace(namespace string) *StatefulSet
- func (obj *StatefulSet) SetNamespaceAndName(namespace, name string) *StatefulSet
- func (obj *StatefulSet) SetPVCMounts(volumeName, mountPath string) *StatefulSet
- func (obj *StatefulSet) SetPVCTemp(pvcName, mountPath string, mode PersistentVolumeAccessMode, ...) *StatefulSet
- func (obj *StatefulSet) SetPVClaim(volumeName, claimName string) *StatefulSet
- func (obj *StatefulSet) SetPodLabels(labels map[string]string) *StatefulSet
- func (obj *StatefulSet) SetPodPriorityClass(priorityClassName string) *StatefulSet
- func (obj *StatefulSet) SetPodQos(qosClass string, autoSet ...bool) *StatefulSet
- func (obj *StatefulSet) SetPostStartExec(command []string) *StatefulSet
- func (obj *StatefulSet) SetPostStartHTTP(scheme URIScheme, host string, port int, path string, ...) *StatefulSet
- func (obj *StatefulSet) SetPreStopExec(command []string) *StatefulSet
- func (obj *StatefulSet) SetPreStopHTTP(scheme URIScheme, host string, port int, path string, ...) *StatefulSet
- func (obj *StatefulSet) SetPreferredNodeAffinity(weight int32, key string, value []string, operator NodeSelectorOperator) *StatefulSet
- func (obj *StatefulSet) SetReplicas(replicas int32) *StatefulSet
- func (obj *StatefulSet) SetRequiredAndNodeAffinity(key string, value []string, operator NodeSelectorOperator) *StatefulSet
- func (obj *StatefulSet) SetRequiredORNodeAffinity(key string, value []string, operator NodeSelectorOperator) *StatefulSet
- func (obj *StatefulSet) SetResourceLimit(limits map[ResourceName]string) *StatefulSet
- func (obj *StatefulSet) SetResourceRequst(requests map[ResourceName]string) *StatefulSet
- func (obj *StatefulSet) SetSelector(labels map[string]string) *StatefulSet
- func (obj *StatefulSet) SetTCPLiveness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *StatefulSet
- func (obj *StatefulSet) SetTCPReadness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *StatefulSet
- func (obj *StatefulSet) YAMLNew(yamlbyts []byte) *StatefulSet
- type StorageClass
- func (obj *StorageClass) Finish() (*v1.StorageClass, error)
- func (obj *StorageClass) JSONNew(jsonbyte []byte) *StorageClass
- func (obj *StorageClass) SetAnnotations(annotations map[string]string) *StorageClass
- func (obj *StorageClass) SetLabels(labels map[string]string) *StorageClass
- func (obj *StorageClass) SetMountOptions(opts []string) *StorageClass
- func (obj *StorageClass) SetName() *StorageClass
- func (obj *StorageClass) SetParameters(parameters map[string]string) *StorageClass
- func (obj *StorageClass) SetProvisioner(provisioner string) *StorageClass
- func (obj *StorageClass) SetReclaimPolicy(reclaimPolicy PersistentVolumeReclaimPolicy) *StorageClass
- func (obj *StorageClass) SetVolumeBindingMode(bindingMode VolumeBindingMode) *StorageClass
- func (obj *StorageClass) YAMLNew(yamlbyts []byte) *StorageClass
- type SubKind
- type TaintEffect
- type TolerationOperator
- type URIScheme
- type UnionPV
- func (un *UnionPV) Finish() (pv *v1.PersistentVolume, pvc *v1.PersistentVolumeClaim, err error)
- func (un *UnionPV) Release() (pv *v1.PersistentVolume, pvc *v1.PersistentVolumeClaim, err error)
- func (un *UnionPV) SetAccessMode(mode PersistentVolumeAccessMode) *UnionPV
- func (un *UnionPV) SetAccessModes(modes []PersistentVolumeAccessMode) *UnionPV
- func (un *UnionPV) SetAnnotations(annotations map[string]string) *UnionPV
- func (un *UnionPV) SetCapacity(capMaps map[ResourceName]string) *UnionPV
- func (un *UnionPV) SetLabels(labels map[string]string) *UnionPV
- func (un *UnionPV) SetNFS(nfs *NFSVolumeSource) *UnionPV
- func (un *UnionPV) SetName(name string) *UnionPV
- func (un *UnionPV) SetNamespace(namespace string) *UnionPV
- func (un *UnionPV) SetNamespaceAndName(namespace, name string) *UnionPV
- func (un *UnionPV) SetRBD(rbd *RBDPersistentVolumeSource) *UnionPV
- func (un *UnionPV) SetVolumeMode(volumeMode PersistentVolumeMode) *UnionPV
- type VolumeBindingMode
Constants ¶
const ( BestEffortRank = iota BurstableRank GuaranteedRank )
qos rank,the higher the number, the higher the level
Variables ¶
This section is empty.
Functions ¶
func DaemonSetToSvc ¶
func DaemonSetToSvc(ds *appsv1.DaemonSet, sty ServiceType, autoRelease ...bool) (*v1.Service, error)
DaemonSetToSvc Use the Set to generate the associated SVC autoRelease[0] if true,beku will auto Release Service On Kubernetes,default can't Release Service On Kubernetes
func DeploymentToSvc ¶
func DeploymentToSvc(dp *appsv1.Deployment, sty ServiceType, autoRelease ...bool) (*v1.Service, error)
DeploymentToSvc Use the Deployment to generate the associated SVC autoRelease[0] if true,beku will auto Release Service On Kubernetes,default can't Release Service On Kubernetes
func FromInt ¶
func FromInt(val int) intstr.IntOrString
FromInt creates an IntOrString object with an int32 value. It is your responsibility not to call this method with a value greater than int32. TODO: convert to (val int32)
func FromString ¶
func FromString(val string) intstr.IntOrString
FromString creates an IntOrString object with a string value.
func GetKubeClient ¶
func GetKubeClient(isInCluster ...bool) (*kubernetes.Clientset, error)
GetKubeClient get Kubernetes apiServer
func GetPodQOS ¶
func GetPodQOS(pod v1.PodSpec) v1.PodQOSClass
GetPodQOS returns the QoS class of a pod. A pod is besteffort if none of its containers have specified any requests or limits. A pod is guaranteed only when requests and limits are specified for all the containers and they are equal. A pod is burstable if limits and requests do not match across all containers.
func JSONToYAML ¶
JSONToYAML json data translate into yaml
func MapsToResources ¶
func MapsToResources(resources map[string]string) map[ResourceName]string
MapsToResources string type resource object to beku resource resource object
func Parse ¶
func Parse(val string) intstr.IntOrString
Parse the given string and try to convert it to an integer before setting it as a string value.
func RegisterK8sClient ¶
RegisterK8sClient register k8s apiServer Client on Beku If the certificate is not required, ca,cert,key field is ""
func RegisterK8sClientBase64 ¶
RegisterK8sClientBase64 register k8s apiServer Client on Beku use the function when ca,cert,key were base64 encode. the function will base64 decode ca,cert,key ca is certificate-authority-data cert is client-certificate-data key is client-key-data
func RegisterResourceLimit ¶
func RegisterResourceLimit(limits map[ResourceName]string) error
RegisterResourceLimit register you need default resource limit, resource only include CPU and MEMORY
func RegisterResourceRequest ¶
func RegisterResourceRequest(request map[ResourceName]string) error
RegisterResourceRequest register you need default resource limit, resource only include CPU and MEMORY
func ResourceMapsToK8s ¶
func ResourceMapsToK8s(maps map[ResourceName]string) (v1.ResourceList, error)
ResourceMapsToK8s to K8s resourceList
func StatefulSetToSvc ¶
func StatefulSetToSvc(sts *appsv1.StatefulSet, sty ServiceType, isHeadless bool, autoRelease ...bool) (*v1.Service, error)
StatefulSetToSvc Use the StatefulSet to generate the associated SVC autoRelease[0] if true,beku will auto Release Service On Kubernetes,default can't Release Service On Kubernetes
func YAMLToJSON ¶
YAMLToJSON yaml data translate into json
Types ¶
type CephFSPersistentVolumeSource ¶
type CephFSPersistentVolumeSource struct { // Required: Monitors is a collection of Ceph monitors // More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it Monitors []string `json:"monitors" protobuf:"bytes,1,rep,name=monitors"` // Optional: Used as the mounted root, rather than the full Ceph tree, default is / // +optional Path string `json:"path,omitempty" protobuf:"bytes,2,opt,name=path"` // Optional: User is the rados user name, default is admin // More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it // +optional User string `json:"user,omitempty" protobuf:"bytes,3,opt,name=user"` // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret // More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it // +optional SecretFile string `json:"secretFile,omitempty" protobuf:"bytes,4,opt,name=secretFile"` // Optional: SecretRef is reference to the authentication secret for User, default is empty. // More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it // +optional SecretRef *SecretReference `json:"secretRef,omitempty" protobuf:"bytes,5,opt,name=secretRef"` // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,6,opt,name=readOnly"` }
CephFSPersistentVolumeSource ceph volume setting
type ClusterRole ¶
type ClusterRole struct {
// contains filtered or unexported fields
}
ClusterRole include kubernetes resource object ClusterRole and error
func NewClusterRole ¶
func NewClusterRole() *ClusterRole
NewClusterRole create ClusterRole and chain function call begin with this function.
func (*ClusterRole) Finish ¶
func (obj *ClusterRole) Finish() (*v1beta1.ClusterRole, error)
Finish Chain function call end with this function return Kubernetes resource object ClusterRole and error. In the function, it will check necessary parameters、input the default field。
func (*ClusterRole) JSONNew ¶
func (obj *ClusterRole) JSONNew(jsonbyts []byte) *ClusterRole
JSONNew use json data create ClusterRole
func (*ClusterRole) SetName ¶
func (obj *ClusterRole) SetName(name string) *ClusterRole
SetName set ClusterRole name
func (*ClusterRole) SetRole ¶
func (obj *ClusterRole) SetRole(verbs, apiGroups, resources []string) *ClusterRole
SetRole set cluster role verbs is func method. such as "get", "watch", "list","create", "delete" ..., you can set "*" if you want to use all the func method apiGroups is resource apiGroup. such as "v1", "apps/v1", "rbac.authorization.k8s.io"... , you can set "*" if you want to use all the resource apiGroup resources is resources object. such as "daemonsets", "deployments","replicasets", you can set "*" if you want to use all the resource object.
func (*ClusterRole) YAMLNew ¶
func (obj *ClusterRole) YAMLNew(yamlbyts []byte) *ClusterRole
YAMLNew use yaml data create ClusterRole
type ClusterRoleBinding ¶
type ClusterRoleBinding struct {
// contains filtered or unexported fields
}
ClusterRoleBinding include kubernetes resource object ClusterRoleBinding and error
func NewClusterRoleBinding ¶
func NewClusterRoleBinding() *ClusterRoleBinding
NewClusterRoleBinding create NewClusterRoleBinding and chain function call begin with this function.
func (*ClusterRoleBinding) Finish ¶
func (obj *ClusterRoleBinding) Finish() (*v1beta1.ClusterRoleBinding, error)
Finish Chain function call end with this function return Kubernetes resource object ClusterRoleBinding and error. In the function, it will check necessary parameters、input the default field。
func (*ClusterRoleBinding) JSONNew ¶
func (obj *ClusterRoleBinding) JSONNew(jsonbyts []byte) *ClusterRoleBinding
JSONNew use json data create ClusterRoleBinding
func (*ClusterRoleBinding) SetName ¶
func (obj *ClusterRoleBinding) SetName(name string) *ClusterRoleBinding
SetName set ClusterRoleBinding name
func (*ClusterRoleBinding) SetRoleRef ¶
func (obj *ClusterRoleBinding) SetRoleRef(name string) *ClusterRoleBinding
SetRoleRef set ClusterRoleBinding RoleRef
func (*ClusterRoleBinding) Subject ¶
func (obj *ClusterRoleBinding) Subject(name string, kind SubKind, namespace string) *ClusterRoleBinding
Subject set ClusterRoleBinding subject kind only support "User", "Group", "ServiceAccount" namespace it is Required when kind is "ServiceAccount" default is "". it is Optional when kind is "User" or "Group"
func (*ClusterRoleBinding) YAMLNew ¶
func (obj *ClusterRoleBinding) YAMLNew(yamlbyts []byte) *ClusterRoleBinding
YAMLNew use yaml data create ClusterRoleBinding
type ConfigMap ¶
type ConfigMap struct {
// contains filtered or unexported fields
}
ConfigMap include Kubernetes resource object ConfigMap(cm) and error.
func NewCM ¶
func NewCM() *ConfigMap
NewCM create ConfigMap(cm) and chain function call begin with this function.
func (*ConfigMap) Apply ¶
Apply it will be updated when this resource object exists in K8s, it will be created when it does not exist.
func (*ConfigMap) Finish ¶
Finish chain function call end with this function return real ConfigMap(really ConfigMap is Kubernetes resource object ConfigMap(cm) and error) In the function, it will check necessary parameters、input the default field。
func (*ConfigMap) SetNamespace ¶
SetNamespace set CofigMap(cm) namespace, default namespace value is 'dafault'
func (*ConfigMap) SetNamespaceAndName ¶
SetNamespaceAndName set ConfigMap(cm) namespace and name
type DaemonSet ¶
type DaemonSet struct {
// contains filtered or unexported fields
}
DaemonSet include Kubernets resource object DaemonSet and error
func NewDS ¶
func NewDS() *DaemonSet
NewDS create DaemonSet(ds) and chain function call begin with this function.
func (*DaemonSet) Apply ¶
Apply it will be updated when this resource object exists in K8s, it will be created when it does not exist.
func (*DaemonSet) Finish ¶
Finish Chain function call end with this function return real DaemonSet(really DaemonSet is kubernetes resource object DaemonSet and error In the function, it will check necessary parameters、input the default field
func (*DaemonSet) GetPodLabel ¶
GetPodLabel get pod labels
func (*DaemonSet) ImagePullPolicy ¶
func (obj *DaemonSet) ImagePullPolicy(pullPolicy PullPolicy) *DaemonSet
ImagePullPolicy DaemonSet pull image policy:Always,Never,IfNotPresent
func (*DaemonSet) SetAnnotations ¶
SetAnnotations set DaemonSet annotations
func (*DaemonSet) SetCMDLiveness ¶
func (obj *DaemonSet) SetCMDLiveness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *DaemonSet
SetCMDLiveness set container liveness of cmd style cmd: execute liveness probe as commond line timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe??defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*DaemonSet) SetCMDReadness ¶
func (obj *DaemonSet) SetCMDReadness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *DaemonSet
SetCMDReadness set container readness of cmd style cmd: execute readness probe as commond line timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe? defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*DaemonSet) SetContainer ¶
SetContainer set DaemonSet container name Not required when only one Container,you can input "". when many container this Field is necessary and cann't repeat image is necessary, image very important containerPort container port,this is necessary
func (*DaemonSet) SetHTTPLiveness ¶
func (obj *DaemonSet) SetHTTPLiveness(port int, path string, initDelaySec, timeoutSec, periodSec int32, headers ...map[string]string) *DaemonSet
SetHTTPLiveness set container liveness of http style port: required path: http request URL,eg: /api/v1/posts/1 initDelaySec: how long time after the first start of the program the probe is executed for the first time.(sec) timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe??defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*DaemonSet) SetHTTPReadness ¶
func (obj *DaemonSet) SetHTTPReadness(port int, path string, initDelaySec, timeoutSec, periodSec int32, headers ...map[string]string) *DaemonSet
SetHTTPReadness set container readness initDelaySec: how long time after the first start of the program the probe is executed for the first time.(sec) timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe??defaults to 1 second. Minimum value is 1,Except for the first time? on the other hand, only **first container** will be set livenessProbe
func (*DaemonSet) SetHistoryLimit ¶
SetHistoryLimit set DaemonSet history version numbers, limit default 10 the field is used to Rollback
func (*DaemonSet) SetImagePullSecrets ¶
SetImagePullSecrets set pod pull secret
func (*DaemonSet) SetMinReadySeconds ¶
SetMinReadySeconds set DaemonSet minreadyseconds default 600
func (*DaemonSet) SetNamespace ¶
SetNamespace set DaemonSet(ds) namespace, default namespace value is 'default'
func (*DaemonSet) SetNamespaceAndName ¶
SetNamespaceAndName set DaemonSet namespace and DaemonSet name and Pod Namespace
func (*DaemonSet) SetPVCMounts ¶
SetPVCMounts mount PersistentVolumeClaim on container params: volumeName:the param is SetPVClaim() function volumeName,and when you call SetPVCMounts function you must call SetPVClaim function,and no order. on the other hand SetPVCMounts() function only mount first Container,and On the Container you can volumeMount many PersistentVolumeClaim. mountPath: runtime container dir eg:/var/lib/mysql
func (*DaemonSet) SetPVClaim ¶
SetPVClaim set DaemonSet PersistentVolumeClaimVolumeSource params: volumeName: this is Custom field,you can define VolumeSource name,will be used of the container MountPath, claimName: this is PersistentVolumeClaim(PVC) name,the PVC and DaemonSet must on same namespace and exist.
func (*DaemonSet) SetPodLabels ¶
SetPodLabels set Pod Label and set DaemonSet Selector
func (*DaemonSet) SetPodPriorityClass ¶
SetPodPriorityClass set DaemonSet Pod Priority priorityClassName is Kubernetes resource object PriorityClass name priorityClassName must already exists in kubernetes cluster
func (*DaemonSet) SetPodQos ¶
SetPodQos set pod quality of service qosClass: is quality of service,the value only 'Guaranteed','Burstable' and 'BestEffort' autoSet: If your previous settings do not meet the requirements of PodQoS, we will automatically set
func (*DaemonSet) SetPostStartExec ¶
SetPostStartExec set PostStart shell command style PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*DaemonSet) SetPostStartHTTP ¶
func (obj *DaemonSet) SetPostStartHTTP(scheme URIScheme, host string, port int, path string, headers ...map[string]string) *DaemonSet
SetPostStartHTTP set PostStart http style PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*DaemonSet) SetPreStopExec ¶
SetPreStopExec set StatefulSet PreStop command PreStop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*DaemonSet) SetPreStopHTTP ¶
func (obj *DaemonSet) SetPreStopHTTP(scheme URIScheme, host string, port int, path string, headers ...map[string]string) *DaemonSet
SetPreStopHTTP set preStop http style PreStop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*DaemonSet) SetSelector ¶
SetSelector set DaemonSet(ds) Selector and Set Pod Label The Pod that matches the seletor will be selected, DaemonSet will controller the Pod.
func (*DaemonSet) SetTCPLiveness ¶
func (obj *DaemonSet) SetTCPLiveness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *DaemonSet
SetTCPLiveness set container liveness of tcp style host: default is "" port: required timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe??defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*DaemonSet) SetTCPReadness ¶
func (obj *DaemonSet) SetTCPReadness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *DaemonSet
SetTCPReadness set container readness of tcp style host: default is "" port: required timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe? defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
type Deployment ¶
type Deployment struct {
// contains filtered or unexported fields
}
Deployment include Kubernetes resource object Deployment and error
func NewDeployment ¶
func NewDeployment() *Deployment
NewDeployment create Deployment and Chain function call begin with this function.
func (*Deployment) Apply ¶
func (obj *Deployment) Apply() (*v1.Deployment, error)
Apply it will be updated when this resource object exists in K8s, it will be created when it does not exist.
func (*Deployment) DelNodeAffinity ¶
func (obj *Deployment) DelNodeAffinity(keys []string) *Deployment
DelNodeAffinity delete node affinitys keys is delete key list
func (*Deployment) Finish ¶
func (obj *Deployment) Finish() (dp *v1.Deployment, err error)
Finish Chain function call end with this function return Kubernetes resource object Deployment and error. In the function, it will check necessary parametersainput the default field
func (*Deployment) GetPodLabel ¶
func (obj *Deployment) GetPodLabel() map[string]string
GetPodLabel get Pod labels
func (*Deployment) ImagePullPolicy ¶
func (obj *Deployment) ImagePullPolicy(pullPolicy PullPolicy) *Deployment
ImagePullPolicy Deployment pull image policy:Always,Never,IfNotPresent
func (*Deployment) JSONNew ¶
func (obj *Deployment) JSONNew(jsonbyts []byte) *Deployment
JSONNew use json data create Deployment
func (*Deployment) Release ¶
func (obj *Deployment) Release() (*v1.Deployment, error)
Release release Deployment on Kubernetes
func (*Deployment) Replace ¶
func (obj *Deployment) Replace(dp *v1.Deployment) *Deployment
Replace replace Deployment by Kubernetes resource object
func (*Deployment) SetAnnotations ¶
func (obj *Deployment) SetAnnotations(annotations map[string]string) *Deployment
SetAnnotations set Deployment annotations
func (*Deployment) SetCMDLiveness ¶
func (obj *Deployment) SetCMDLiveness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *Deployment
SetCMDLiveness set container liveness of cmd style cmd: execute liveness probe as commond line timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe??defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*Deployment) SetCMDReadness ¶
func (obj *Deployment) SetCMDReadness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *Deployment
SetCMDReadness set container readness of cmd style cmd: execute readness probe as commond line timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe? defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*Deployment) SetContainer ¶
func (obj *Deployment) SetContainer(name, image string, containerPort int32) *Deployment
SetContainer set Deployment container name:name is container name ,default "" image:image is image name ,must input image containerPort: image expose containerPort,must input containerPort
func (*Deployment) SetContainerOne ¶
func (obj *Deployment) SetContainerOne(container corev1.Container) *Deployment
SetContainerOne set one container
func (*Deployment) SetDeployMaxTime ¶
func (obj *Deployment) SetDeployMaxTime(sec int32) *Deployment
SetDeployMaxTime set Deployment deploy max time,default 600s. If real deploy time more than this value,Deployment controller return err:ProgressDeadlineExceeded and Pod will Redeploy.
func (*Deployment) SetEnvs ¶
func (obj *Deployment) SetEnvs(envMap map[string]string) *Deployment
SetEnvs set Pod Environmental variable
func (*Deployment) SetHTTPLiveness ¶
func (obj *Deployment) SetHTTPLiveness(port int, path string, initDelaySec, timeoutSec, periodSec int32, headers ...map[string]string) *Deployment
SetHTTPLiveness set container liveness of http style port: required path: http request URL,eg: /api/v1/posts/1 initDelaySec: how long time after the first start of the program the probe is executed for the first time.(sec) timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe? defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*Deployment) SetHTTPReadness ¶
func (obj *Deployment) SetHTTPReadness(port int, path string, initDelaySec, timeoutSec, periodSec int32, headers ...map[string]string) *Deployment
SetHTTPReadness set container readness initDelaySec: how long time after the first start of the program the probe is executed for the first time.(sec) timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe??defaults to 1 second. Minimum value is 1,Except for the first time? on the other hand, only **first container** will be set livenessProbe
func (*Deployment) SetHistoryLimit ¶
func (obj *Deployment) SetHistoryLimit(limit int32) *Deployment
SetHistoryLimit set Deployment history version numbers, limit default 10 the field is used to Rollback
func (*Deployment) SetImagePullSecrets ¶
func (obj *Deployment) SetImagePullSecrets(secretName string) *Deployment
SetImagePullSecrets set pod pull secret
func (*Deployment) SetLabels ¶
func (obj *Deployment) SetLabels(labels map[string]string) *Deployment
SetLabels set Deployment labels
func (*Deployment) SetMatchExpressions ¶
func (obj *Deployment) SetMatchExpressions(ents []LabelSelectorRequirement) *Deployment
SetMatchExpressions set Deployment match expressions the field is used to set complicated Label.
func (*Deployment) SetMinReadySeconds ¶
func (obj *Deployment) SetMinReadySeconds(sec int32) *Deployment
SetMinReadySeconds set Deployment minreadyseconds default 600
func (*Deployment) SetName ¶
func (obj *Deployment) SetName(name string) *Deployment
SetName set Deployment name
func (*Deployment) SetNamespace ¶
func (obj *Deployment) SetNamespace(namespace string) *Deployment
SetNamespace set Deployment namespace and set Pod namespace.
func (*Deployment) SetNamespaceAndName ¶
func (obj *Deployment) SetNamespaceAndName(namespace, name string) *Deployment
SetNamespaceAndName set Deployment namespace,set Pod namespace,set Deployment name.
func (*Deployment) SetPVCMounts ¶
func (obj *Deployment) SetPVCMounts(volumeName, mountPath string) *Deployment
SetPVCMounts mount PersistentVolumeClaim on container params: volumeName:the param is SetPVClaim() function volumeName,and when you call SetPVCMounts function you must call SetPVClaim function,and no order. on the other hand SetPVCMounts() function only mount first Container,and On the Container you can volumeMount many PersistentVolumeClaim. mountPath: runtime container dir eg:/var/lib/mysql
func (*Deployment) SetPVClaim ¶
func (obj *Deployment) SetPVClaim(volumeName, claimName string) *Deployment
SetPVClaim set Deployment PersistentVolumeClaimVolumeSource params: volumeName: this is Custom field,you can define VolumeSource name,will be used of the container MountPath, claimName: this is PersistentVolumeClaim(PVC) name,the PVC and Deployment must on same namespace and exist.
func (*Deployment) SetPodLabels ¶
func (obj *Deployment) SetPodLabels(labels map[string]string) *Deployment
SetPodLabels set Pod labels when call SetLabels(),you can not use this function.
func (*Deployment) SetPodPriorityClass ¶
func (obj *Deployment) SetPodPriorityClass(priorityClassName string) *Deployment
SetPodPriorityClass set Deployment Pod Priority priorityClassName is Kubernetes resource object PriorityClass name priorityClassName must already exists in kubernetes cluster
func (*Deployment) SetPodQos ¶
func (obj *Deployment) SetPodQos(qosClass string, autoSet ...bool) *Deployment
SetPodQos set pod quality of service qosClass: is quality of service,the value only 'Guaranteed','Burstable' and 'BestEffort' autoSet: If your previous settings do not meet the requirements of PodQoS, we will automatically set
func (*Deployment) SetPostStartExec ¶
func (obj *Deployment) SetPostStartExec(command []string) *Deployment
SetPostStartExec set PostStart shell command style PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*Deployment) SetPostStartHTTP ¶
func (obj *Deployment) SetPostStartHTTP(scheme URIScheme, host string, port int, path string, headers ...map[string]string) *Deployment
SetPostStartHTTP set PostStart http style PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*Deployment) SetPreStopExec ¶
func (obj *Deployment) SetPreStopExec(command []string) *Deployment
SetPreStopExec set StatefulSet PreStop command PreStop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*Deployment) SetPreStopHTTP ¶
func (obj *Deployment) SetPreStopHTTP(scheme URIScheme, host string, port int, path string, headers ...map[string]string) *Deployment
SetPreStopHTTP set preStop http style PreStop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*Deployment) SetPreferredNodeAffinity ¶
func (obj *Deployment) SetPreferredNodeAffinity(weight int32, key string, value []string, operator NodeSelectorOperator) *Deployment
SetPreferredNodeAffinity set node affinity for PreferredDuringSchedulingIgnoredDuringExecution style
func (*Deployment) SetReplicas ¶
func (obj *Deployment) SetReplicas(replicas int32) *Deployment
SetReplicas set Deployment replicas default 1
func (*Deployment) SetRequiredAndNodeAffinity ¶
func (obj *Deployment) SetRequiredAndNodeAffinity(key string, value []string, operator NodeSelectorOperator) *Deployment
SetRequiredAndNodeAffinity set node affinity for RequiredDuringSchedulingIgnoredDuringExecution style A list of keys, many key do AND operation.
func (*Deployment) SetRequiredORNodeAffinity ¶
func (obj *Deployment) SetRequiredORNodeAffinity(key string, value []string, operator NodeSelectorOperator) *Deployment
SetRequiredORNodeAffinity set node affinity for RequiredDuringSchedulingIgnoredDuringExecution style A list of keys, many key do OR operation.
func (*Deployment) SetResourceLimit ¶
func (obj *Deployment) SetResourceLimit(limits map[ResourceName]string) *Deployment
SetResourceLimit set container of deployment resource limit,eg:CPU and MEMORY
func (*Deployment) SetResourceRequst ¶
func (obj *Deployment) SetResourceRequst(requests map[ResourceName]string) *Deployment
SetResourceRequst set container of deployment resource request,only CPU and MEMORY
func (*Deployment) SetSelector ¶
func (obj *Deployment) SetSelector(labels map[string]string) *Deployment
SetSelector set Deployment selector set: 1. Deployment.Spec.Selector 2. Deployment.Spec.Template.Label(the Field is Pod Labels.) and you can not be SetLabels
func (*Deployment) SetTCPLiveness ¶
func (obj *Deployment) SetTCPLiveness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *Deployment
SetTCPLiveness set container liveness of tcp style host: default is "" port: required timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe??defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*Deployment) SetTCPReadness ¶
func (obj *Deployment) SetTCPReadness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *Deployment
SetTCPReadness set container readness of tcp style host: default is "" port: required timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe? defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*Deployment) SetToleration ¶
func (obj *Deployment) SetToleration(key, value string, operator TolerationOperator, effect TaintEffect, delayTimeSec ...int64) *Deployment
SetToleration set Taints Tolerations delayTimeSec TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. +optional operator default is Equal
func (*Deployment) YAMLNew ¶
func (obj *Deployment) YAMLNew(yamlbyts []byte) *Deployment
YAMLNew use yaml data create Deployment
type LabelSelector ¶
type LabelSelector struct { // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels // map is equivalent to an element of matchExpressions, whose key field is "key", the // operator is "In", and the values array contains only "value". The requirements are ANDed. // +optional MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"` // matchExpressions is a list of label selector requirements. The requirements are ANDed. // +optional MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"` }
LabelSelector : A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.
type LabelSelectorOperator ¶
type LabelSelectorOperator string
LabelSelectorOperator :A label selector operator is the set of operators that can be used in a selector requirement.
const ( LabelSelectorOpIn LabelSelectorOperator = "In" LabelSelectorOpNotIn LabelSelectorOperator = "NotIn" LabelSelectorOpExists LabelSelectorOperator = "Exists" LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist" )
LabelSelectorOperator params
type LabelSelectorRequirement ¶
type LabelSelectorRequirement struct { // key is the label key that the selector applies to. // +patchMergeKey=key // +patchStrategy=merge Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key" protobuf:"bytes,1,opt,name=key"` // operator represents a key's relationship to a set of values. // Valid operators are In, NotIn, Exists and DoesNotExist. Operator LabelSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=LabelSelectorOperator"` // values is an array of string values. If the operator is In or NotIn, // the values array must be non-empty. If the operator is Exists or DoesNotExist, // the values array must be empty. This array is replaced during a strategic // merge patch. // +optional Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"` }
LabelSelectorRequirement : A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
type NFSVolumeSource ¶
type NFSVolumeSource struct { // Server is the hostname or IP address of the NFS server. // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs Server string `json:"server" protobuf:"bytes,1,opt,name=server"` // Path that is exported by the NFS server. // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs Path string `json:"path" protobuf:"bytes,2,opt,name=path"` // ReadOnly here will force // the NFS export to be mounted with read-only permissions. // Defaults to false. // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` }
NFSVolumeSource : Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace include Kubernets resource object Namespace and err
func NewNs ¶
func NewNs() *Namespace
NewNs create Namespace and Chain function call begin with this function.
func (*Namespace) Apply ¶
Apply it will be updated when this resource object exists in K8s, it will be created when it does not exist.
func (*Namespace) Finish ¶
Finish Chain function call end with this function return Kubernetes resource object Namespace and error. In the function, it will check necessary parameters�input the default field
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node include Kubernetes resource object node and error
func (*Node) DelNodeLabels ¶
DelNodeLabels del node labels Skip if there is no such key
func (*Node) Finish ¶
Finish Chain function call end with this function return Kubernetes resource object Node and error. In the function, it will check necessary parametersainput the default field
func (*Node) SetAnnotations ¶
SetAnnotations set Node annotations
type NodeSelectorOperator ¶
type NodeSelectorOperator string
NodeSelectorOperator A node selector operator is the set of operators that can be used in a node selector requirement.
const ( NodeSelectorOpIn NodeSelectorOperator = "In" NodeSelectorOpNotIn NodeSelectorOperator = "NotIn" NodeSelectorOpExists NodeSelectorOperator = "Exists" NodeSelectorOpDoesNotExist NodeSelectorOperator = "DoesNotExist" NodeSelectorOpGt NodeSelectorOperator = "Gt" NodeSelectorOpLt NodeSelectorOperator = "Lt" )
NodeSelector seletctors
func (NodeSelectorOperator) ToK8s ¶
func (ns NodeSelectorOperator) ToK8s() v1.NodeSelectorOperator
ToK8s local NodeSelectorOperator to kubernetes NodeSelectorOperator
type PersistentVolume ¶
type PersistentVolume struct {
// contains filtered or unexported fields
}
PersistentVolume include Kubernetes resource object PersistentVolume(pv) and error.
func NewPV ¶
func NewPV() *PersistentVolume
NewPV create PersistentVolume and chain function call begin with this function.
func (*PersistentVolume) Apply ¶
func (obj *PersistentVolume) Apply() (*v1.PersistentVolume, error)
Apply it will be updated when this resource object exists in K8s, it will be created when it does not exist.
func (*PersistentVolume) Finish ¶
func (obj *PersistentVolume) Finish() (*v1.PersistentVolume, error)
Finish chain function call end with this function return Kubernetes resource object PersistentVolume(pv) and error. In the function, it will check necessary parameters、input the default field。
func (*PersistentVolume) GetLabels ¶
func (obj *PersistentVolume) GetLabels() map[string]string
GetLabels get PersistentVolume(pv) labels
func (*PersistentVolume) GetName ¶
func (obj *PersistentVolume) GetName() string
GetName get PersistentVolume(pv) name
func (*PersistentVolume) JSONNew ¶
func (obj *PersistentVolume) JSONNew(jsonbyte []byte) *PersistentVolume
JSONNew use json data create PersistentVolume(pv)
func (*PersistentVolume) Release ¶
func (obj *PersistentVolume) Release() (*v1.PersistentVolume, error)
Release release PersistentVolume on Kubernetes
func (*PersistentVolume) Replace ¶
func (obj *PersistentVolume) Replace(pv *v1.PersistentVolume) *PersistentVolume
Replace replace PersistentVolume by Kubernetes resource object
func (*PersistentVolume) SetAccessMode ¶
func (obj *PersistentVolume) SetAccessMode(mode PersistentVolumeAccessMode) *PersistentVolume
SetAccessMode set PersistentVolume(pv) access mode, only one
func (*PersistentVolume) SetAccessModes ¶
func (obj *PersistentVolume) SetAccessModes(modes []PersistentVolumeAccessMode) *PersistentVolume
SetAccessModes set PersistentVolume(pv) access mode, many modes
func (*PersistentVolume) SetAnnotations ¶
func (obj *PersistentVolume) SetAnnotations(annotations map[string]string) *PersistentVolume
SetAnnotations set PersistentVolume(pv) annotations
func (*PersistentVolume) SetCapacity ¶
func (obj *PersistentVolume) SetCapacity(capMaps map[ResourceName]string) *PersistentVolume
SetCapacity set PersistentVolume(pv) capacity
func (*PersistentVolume) SetCephFS ¶
func (obj *PersistentVolume) SetCephFS(cephFs *CephFSPersistentVolumeSource) *PersistentVolume
SetCephFS set PersistentVolume(pv) volume source is ceph
func (*PersistentVolume) SetLabels ¶
func (obj *PersistentVolume) SetLabels(labels map[string]string) *PersistentVolume
SetLabels set PersistentVolume(pv) label
func (*PersistentVolume) SetNFS ¶
func (obj *PersistentVolume) SetNFS(nfs *NFSVolumeSource) *PersistentVolume
SetNFS set PersistentVolume(pv) volume source is nfs
func (*PersistentVolume) SetName ¶
func (obj *PersistentVolume) SetName(name string) *PersistentVolume
SetName set PersistentVolume(pv) name
func (*PersistentVolume) SetRBD ¶
func (obj *PersistentVolume) SetRBD(rbd *RBDPersistentVolumeSource) *PersistentVolume
SetRBD set PersistentVolume(pv) volume source is RBD
func (*PersistentVolume) SetReclaimPolicy ¶
func (obj *PersistentVolume) SetReclaimPolicy(reclaimPolicy PersistentVolumeReclaimPolicy) *PersistentVolume
SetReclaimPolicy set setReclaim policy
func (*PersistentVolume) YAMLNew ¶
func (obj *PersistentVolume) YAMLNew(yamlbyts []byte) *PersistentVolume
YAMLNew use yaml data create PersistentVolume(pv)
type PersistentVolumeAccessMode ¶
type PersistentVolumeAccessMode string
PersistentVolumeAccessMode volume access mode read,write
const ( // can be mounted read/write mode to exactly 1 host ReadWriteOnce PersistentVolumeAccessMode = "ReadWriteOnce" // can be mounted in read-only mode to many hosts ReadOnlyMany PersistentVolumeAccessMode = "ReadOnlyMany" // can be mounted in read/write mode to many hosts ReadWriteMany PersistentVolumeAccessMode = "ReadWriteMany" RWO PersistentVolumeAccessMode = "RWO" ROX PersistentVolumeAccessMode = "ROX" RWX PersistentVolumeAccessMode = "RWX" )
VolumeAccessMode params
func (PersistentVolumeAccessMode) ToK8s ¶
func (pvm PersistentVolumeAccessMode) ToK8s() v1.PersistentVolumeAccessMode
ToK8s translate into k8s accessMode
type PersistentVolumeClaim ¶
type PersistentVolumeClaim struct {
// contains filtered or unexported fields
}
PersistentVolumeClaim include kubernetes resource object PersistentVolumeClaim(pvc) and error.
func NewPVC ¶
func NewPVC() *PersistentVolumeClaim
NewPVC create PersistentVolumeClaim(pvc) and chain function call begin with this function.
func (*PersistentVolumeClaim) Apply ¶
func (obj *PersistentVolumeClaim) Apply() (*v1.PersistentVolumeClaim, error)
Apply it will be updated when this resource object exists in K8s, it will be created when it does not exist.
func (*PersistentVolumeClaim) Finish ¶
func (obj *PersistentVolumeClaim) Finish() (*v1.PersistentVolumeClaim, error)
Finish Chain function call end with this function return Kubernetes resource object PersistentVolumeClaim(pvc) and error. In the function, it will check necessary parameters?input the default field?
func (*PersistentVolumeClaim) GetLabels ¶
func (obj *PersistentVolumeClaim) GetLabels() map[string]string
GetLabels get PersistentVolumeClaim(pvc) labels
func (*PersistentVolumeClaim) GetName ¶
func (obj *PersistentVolumeClaim) GetName() string
GetName get PersistentVolumeClaim(pvc) name
func (*PersistentVolumeClaim) GetNamespace ¶
func (obj *PersistentVolumeClaim) GetNamespace() string
GetNamespace get PersistentVolumeClaim(pvc) namespace
func (*PersistentVolumeClaim) GetSelector ¶
func (obj *PersistentVolumeClaim) GetSelector() map[string]string
GetSelector get PersistentVolumeClaim(pvc) selector
func (*PersistentVolumeClaim) JSONNew ¶
func (obj *PersistentVolumeClaim) JSONNew(jsonbyts []byte) *PersistentVolumeClaim
JSONNew use json data create PersistentVolumeClaim(pvc)
func (*PersistentVolumeClaim) Release ¶
func (obj *PersistentVolumeClaim) Release() (*v1.PersistentVolumeClaim, error)
Release release PersistentVolumeClaim on Kubernetes
func (*PersistentVolumeClaim) Replace ¶
func (obj *PersistentVolumeClaim) Replace(pvc *v1.PersistentVolumeClaim) *PersistentVolumeClaim
Replace replace PersistentVolumeClaim by Kubernetes resource object
func (*PersistentVolumeClaim) SetAccessMode ¶
func (obj *PersistentVolumeClaim) SetAccessMode(mode PersistentVolumeAccessMode) *PersistentVolumeClaim
SetAccessMode set PersistentVolumeClaim(pvc) access mode, only one
func (*PersistentVolumeClaim) SetAccessModes ¶
func (obj *PersistentVolumeClaim) SetAccessModes(modes []PersistentVolumeAccessMode) *PersistentVolumeClaim
SetAccessModes set PersistentVolumeClaim(pvc) accessModes, many modes
func (*PersistentVolumeClaim) SetAnnotations ¶
func (obj *PersistentVolumeClaim) SetAnnotations(annotations map[string]string) *PersistentVolumeClaim
SetAnnotations set PersistentVolumeClaim(pvc) annotations
func (*PersistentVolumeClaim) SetLabels ¶
func (obj *PersistentVolumeClaim) SetLabels(labels map[string]string) *PersistentVolumeClaim
SetLabels set PersistentVolumeClaim(pvc) labels
func (*PersistentVolumeClaim) SetMatchExpressions ¶
func (obj *PersistentVolumeClaim) SetMatchExpressions(ents []LabelSelectorRequirement) *PersistentVolumeClaim
SetMatchExpressions set Deployment match expressions the field is used to set complicated Label.
func (*PersistentVolumeClaim) SetName ¶
func (obj *PersistentVolumeClaim) SetName(name string) *PersistentVolumeClaim
SetName set PersistentVolumeClaim(pvc) name
func (*PersistentVolumeClaim) SetNamespace ¶
func (obj *PersistentVolumeClaim) SetNamespace(namespace string) *PersistentVolumeClaim
SetNamespace set PersistentVolumeClaim(pvc) namespace,default namespace is 'default'
func (*PersistentVolumeClaim) SetNamespaceAndName ¶
func (obj *PersistentVolumeClaim) SetNamespaceAndName(namespace, name string) *PersistentVolumeClaim
SetNamespaceAndName set Deployment namespace,set Pod namespace,set Deployment name.
func (*PersistentVolumeClaim) SetResourceLimits ¶
func (obj *PersistentVolumeClaim) SetResourceLimits(limits map[ResourceName]string) *PersistentVolumeClaim
SetResourceLimits set PersistentVolumeClaim(pvc) resource limits
func (*PersistentVolumeClaim) SetResourceRequests ¶
func (obj *PersistentVolumeClaim) SetResourceRequests(requests map[ResourceName]string) *PersistentVolumeClaim
SetResourceRequests set PersistentVolumeClaim(pvc) reource requests
func (*PersistentVolumeClaim) SetSelector ¶
func (obj *PersistentVolumeClaim) SetSelector(labels map[string]string) *PersistentVolumeClaim
SetSelector set PersistentVolumeClaim(pvc) selector
func (*PersistentVolumeClaim) SetStorageClassName ¶
func (obj *PersistentVolumeClaim) SetStorageClassName(classname string) *PersistentVolumeClaim
SetStorageClassName set PersistentVolumeClaim(pvc) storageclasss name
func (*PersistentVolumeClaim) SetVolumeMode ¶
func (obj *PersistentVolumeClaim) SetVolumeMode(volumeMode PersistentVolumeMode) *PersistentVolumeClaim
SetVolumeMode PersistentVolumeClaim(pvc) vloume mode,have Block and Filesystem mode
func (*PersistentVolumeClaim) YAMLNew ¶
func (obj *PersistentVolumeClaim) YAMLNew(yamlbyts []byte) *PersistentVolumeClaim
YAMLNew use yaml data create PersistentVolumeClaim(pvc)
type PersistentVolumeMode ¶
type PersistentVolumeMode string
PersistentVolumeMode describes how a volume is intended to be consumed, either Block or Filesystem.
const ( // PersistentVolumeBlock means the volume will not be formatted with a filesystem and will remain a raw block device. PersistentVolumeBlock PersistentVolumeMode = "Block" // PersistentVolumeFilesystem means the volume will be or is formatted with a filesystem. PersistentVolumeFilesystem PersistentVolumeMode = "Filesystem" )
func (PersistentVolumeMode) ToK8s ¶
func (vMode PersistentVolumeMode) ToK8s() *v1.PersistentVolumeMode
ToK8s PersistentVolumeMode translate into k8s PersistentVolumeMode
type PersistentVolumeReclaimPolicy ¶
type PersistentVolumeReclaimPolicy string
PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes.
const ( // PersistentVolumeReclaimRecycle means the volume will be recycled back into the pool of unbound persistent volumes on release from its claim. // The volume plugin must support Recycling. PersistentVolumeReclaimRecycle PersistentVolumeReclaimPolicy = "Recycle" // PersistentVolumeReclaimDelete means the volume will be deleted from Kubernetes on release from its claim. // The volume plugin must support Deletion. PersistentVolumeReclaimDelete PersistentVolumeReclaimPolicy = "Delete" // PersistentVolumeReclaimRetain means the volume will be left in its current phase (Released) for manual reclamation by the administrator. // The default policy is Retain. PersistentVolumeReclaimRetain PersistentVolumeReclaimPolicy = "Retain" )
func (PersistentVolumeReclaimPolicy) ToK8s ¶
func (pvrp PersistentVolumeReclaimPolicy) ToK8s() v1.PersistentVolumeReclaimPolicy
ToK8s local PersistentVolumeReclaimPolicy to kubernetest PersistentVolumeReclaimPolicy
type Pod ¶
type Pod struct {
// contains filtered or unexported fields
}
Pod include Kubernetes resource bject Pod and error
func (*Pod) Finish ¶
Finish Chain function call end with this function return Kubernetes resource object Pod and error. In the function, it will check necessary parametersainput the default field
func (*Pod) SetContainer ¶
SetContainer set pod container name:name is container name ,default "" image:image is image name ,must input image containerPort: image expose containerPort,must input containerPort
func (*Pod) SetNamespace ¶
SetNamespace set Pod namespace and set Pod namespace.
func (*Pod) SetNamespaceAndName ¶
SetNamespaceAndName set Pod Namespace and Pod name
type PodQOSClass ¶
type PodQOSClass string
PodQOSClass defines the supported qos classes of Pods.
const ( // PodQOSGuaranteed is the Guaranteed qos class. PodQOSGuaranteed PodQOSClass = "Guaranteed" // PodQOSBurstable is the Burstable qos class. PodQOSBurstable PodQOSClass = "Burstable" // PodQOSBestEffort is the BestEffort qos class. PodQOSBestEffort PodQOSClass = "BestEffort" )
type Protocol ¶
type Protocol string
Protocol defines network protocols supported for things like container ports.
type PullPolicy ¶
type PullPolicy string
PullPolicy describes a policy for if/when to pull a container image
const ( // PullAlways means that kubelet always attempts to pull the latest image. Container will fail If the pull fails. PullAlways PullPolicy = "Always" // PullNever means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present PullNever PullPolicy = "Never" // PullIfNotPresent means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails. PullIfNotPresent PullPolicy = "IfNotPresent" // ImagePullPolicyKey anotation ImagePullPolicyKey = "imagePullPolicy" )
type QOSList ¶
type QOSList map[v1.ResourceName]v1.PodQOSClass
QOSList is a set of (resource name, QoS class) pairs.
type RBDPersistentVolumeSource ¶
type RBDPersistentVolumeSource struct { // A collection of Ceph monitors. // More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it CephMonitors []string `json:"monitors" protobuf:"bytes,1,rep,name=monitors"` // The rados image name. // More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it RBDImage string `json:"image" protobuf:"bytes,2,opt,name=image"` // Filesystem type of the volume that you want to mount. // Tip: Ensure that the filesystem type is supported by the host operating system. // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd // TODO: how do we prevent errors in the filesystem from compromising the machine // +optional FSType string `json:"fsType,omitempty" protobuf:"bytes,3,opt,name=fsType"` // The rados pool name. // Default is rbd. // More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it // +optional RBDPool string `json:"pool,omitempty" protobuf:"bytes,4,opt,name=pool"` // The rados user name. // Default is admin. // More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it // +optional RadosUser string `json:"user,omitempty" protobuf:"bytes,5,opt,name=user"` // Keyring is the path to key ring for RBDUser. // Default is /etc/ceph/keyring. // More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it // +optional Keyring string `json:"keyring,omitempty" protobuf:"bytes,6,opt,name=keyring"` // SecretRef is name of the authentication secret for RBDUser. If provided // overrides keyring. // Default is nil. // More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it // +optional SecretRef *SecretReference `json:"secretRef,omitempty" protobuf:"bytes,7,opt,name=secretRef"` // ReadOnly here will force the ReadOnly setting in VolumeMounts. // Defaults to false. // More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,8,opt,name=readOnly"` }
RBDPersistentVolumeSource Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.
type ResourceName ¶
type ResourceName string
ResourceName is the name identifying various resources in a ResourceList.
const ( // CPU, in cores. (500m = .5 cores) ResourceCPU ResourceName = "cpu" // Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) ResourceMemory ResourceName = "memory" // Volume size, in bytes (e,g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024) ResourceStorage ResourceName = "storage" // Local ephemeral storage, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) // The resource name for ResourceEphemeralStorage is alpha and it can change across releases. ResourceEphemeralStorage ResourceName = "ephemeral-storage" // NVIDIA GPU, in devices. Alpha, might change: although fractional and allowing values >1, only one whole device per node is assigned. ResourceNvidiaGPU ResourceName = "alpha.kubernetes.io/nvidia-gpu" )
Resource names must be not more than 63 characters, consisting of upper- or lower-case alphanumeric characters, with the -, _, and . characters allowed anywhere, except the first or last character. The default convention, matching that for annotations, is to use lower-case names, with dashes, rather than camel case, separating compound words. Fully-qualified resource typenames are constructed from a DNS-style subdomain, followed by a slash `/` and a name.
func (ResourceName) ToK8s ¶
func (r ResourceName) ToK8s() v1.ResourceName
ToK8s translate into k8s ResourceName
type Secret ¶
type Secret struct {
// contains filtered or unexported fields
}
Secret include Kuebernetes resource object Secret and error.
func NewSecret ¶
func NewSecret() *Secret
NewSecret create Secret and chain function call begin with this function.
func (*Secret) Apply ¶
Apply it will be updated when this resource object exists in K8s, it will be created when it does not exist.
func (*Secret) Finish ¶
Finish chain function call end with this function. return obj(Kubernetes resource object) and error In the function, it will check necessary parameters、input the default field。
func (*Secret) SetDataBytes ¶
SetDataBytes set Secret data for byte,and Don't need to encode base64,because K8S will automatically encrypt
func (*Secret) SetDataString ¶
SetDataString set Secret data, and Don't need to encode base64,because K8S will automatically encrypt
func (*Secret) SetNamespace ¶
SetNamespace set Secret namespace ,default namespace is 'default'
func (*Secret) SetNamespaceAndName ¶
SetNamespaceAndName set Secret namespace and name
func (*Secret) SetType ¶
func (obj *Secret) SetType(secType SecretType) *Secret
SetType set Secret type,have Opaque and kubernetes.io/service-account-token Opaque user-defined data kubernetes.io/service-account-token is used to kubernetes apiserver,because apiserver need to auth
type SecretReference ¶
type SecretReference struct { // Name is unique within a namespace to reference a secret resource. // +optional Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` // Namespace defines the space within which the secret name must be unique. // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"` }
SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace
type SecretType ¶
type SecretType string
SecretType 'Opaque' or 'kubernetes.io/service-account-token'
const ( // SecretTypeOpaque is the default. Arbitrary user-defined data SecretTypeOpaque SecretType = "Opaque" // SecretTypeServiceAccountToken contains a token that identifies a service account to the API // // Required fields: // - Secret.Annotations["kubernetes.io/service-account.name"] - the name of the ServiceAccount the token identifies // - Secret.Annotations["kubernetes.io/service-account.uid"] - the UID of the ServiceAccount the token identifies // - Secret.Data["token"] - a token that identifies the service account to the API SecretTypeServiceAccountToken SecretType = "kubernetes.io/service-account-token" )
func (SecretType) ToK8s ¶
func (ty SecretType) ToK8s() v1.SecretType
ToK8s translate into Kubernets SecretType
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service include Kubernetes resource object Service and error
func NewSvc ¶
func NewSvc() *Service
NewSvc create service(svc) and chain function call begin with this function.
func (*Service) Apply ¶
Apply it will be updated when this resource object exists in K8s, it will be created when it does not exist.
func (*Service) Finish ¶
Finish Chain function call end with this function return real service(really service is kubernetes resource object Service and error In the function, it will check necessary parametersainput the default field
func (*Service) SetAnnotations ¶
SetAnnotations set service(svc) annotations
func (*Service) SetNamespace ¶
SetNamespace set service(svc) namespace
func (*Service) SetNamespaceAndName ¶
SetNamespaceAndName set service(svc) namespace and name namespace default value is 'default'
func (*Service) SetPort ¶
func (obj *Service) SetPort(sp ServicePort) *Service
SetPort set service(svc) Port. port params required input on ServicePort default TargetPort same as Port NodePort is random number when not input or NodePort <= 0 Protocol default value 'TCP'
func (*Service) SetPorts ¶
func (obj *Service) SetPorts(ports []ServicePort) *Service
SetPorts set service(svc) ports
func (*Service) SetSelector ¶
SetSelector set service(svc) seletor The Pod that matches the selector will be selected the function Required call when you create service(svc)
func (*Service) SetServiceType ¶
func (obj *Service) SetServiceType(sty ServiceType) *Service
SetServiceType set service(svc) type,you can choose NodePort,ClusterIP many info please redirect to ServiceType
func (*Service) SetSessionAffinity ¶
func (obj *Service) SetSessionAffinity(affinity ServiceAffinity) *Service
SetSessionAffinity set service(svc) session affinity
type ServiceAccount ¶
type ServiceAccount struct {
// contains filtered or unexported fields
}
ServiceAccount include kubernetes resource object ServiceAccount(sa) and error
func NewSa ¶
func NewSa() *ServiceAccount
NewSa create ServiceAccount(sa) and chain function call begin with this function.
func (*ServiceAccount) Finish ¶
func (obj *ServiceAccount) Finish() (*corev1.ServiceAccount, error)
Finish Chain function call end with this function return Kubernetes resource object ServiceAccount and error. In the function, it will check necessary parameters、input the default field。
func (*ServiceAccount) SetNamespceAndName ¶
func (obj *ServiceAccount) SetNamespceAndName(namespace, name string) *ServiceAccount
SetNamespceAndName set namespace and name, name is not allowed to be empty, name default is ""
type ServiceAffinity ¶
type ServiceAffinity string
ServiceAffinity Type set affinity
const ( // ServiceAffinityClientIP is the Client IP based. ServiceAffinityClientIP ServiceAffinity = "ClientIP" // ServiceAffinityNone - no session affinity. ServiceAffinityNone ServiceAffinity = "None" )
affinity params
func (ServiceAffinity) ToK8s ¶
func (sa ServiceAffinity) ToK8s() v1.ServiceAffinity
ToK8s translate into k8s aserviceAffinity
type ServicePort ¶
type ServicePort struct { Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,2,opt,name=protocol,casttype=Protocol"` Port int32 `json:"port" protobuf:"varint,3,opt,name=port"` TargetPort int `json:"targetPort,omitempty" protobuf:"bytes,4,opt,name=targetPort"` NodePort int32 `json:"nodePort,omitempty" protobuf:"varint,5,opt,name=nodePort"` }
ServicePort service ports
type ServiceType ¶
type ServiceType string
ServiceType service type
const ( // ServiceTypeClusterIP means a service will only be accessible inside the // cluster, via the cluster IP. ServiceTypeClusterIP ServiceType = "ClusterIP" // ServiceTypeNodePort means a service will be exposed on one port of // every node, in addition to 'ClusterIP' type. ServiceTypeNodePort ServiceType = "NodePort" // ServiceTypeLoadBalancer means a service will be exposed via an // external load balancer (if the cloud provider supports it), in addition // to 'NodePort' type. ServiceTypeLoadBalancer ServiceType = "LoadBalancer" // ServiceTypeExternalName means a service consists of only a reference to // an external name that kubedns or equivalent will return as a CNAME // record, with no exposing or proxying of any pods involved. ServiceTypeExternalName ServiceType = "ExternalName" )
ServiceType
func (ServiceType) ToK8s ¶
func (sty ServiceType) ToK8s() v1.ServiceType
ToK8s translate into Kubernetes ServiceType
type StatefulSet ¶
type StatefulSet struct {
// contains filtered or unexported fields
}
StatefulSet include kubernetes resource object StatefulSet(sts) and error
func NewSts ¶
func NewSts() *StatefulSet
NewSts create StatefulSet(sts) and chain function call begin with this function.
func (*StatefulSet) Apply ¶
func (obj *StatefulSet) Apply() (*v1.StatefulSet, error)
Apply it will be updated when this resource object exists in K8s, it will be created when it does not exist.
func (*StatefulSet) Finish ¶
func (obj *StatefulSet) Finish() (*v1.StatefulSet, error)
Finish Chain function call end with this function return Kubernetes resource object StatefulSet and error. In the function, it will check necessary parameters、input the default field。
func (*StatefulSet) GetPodLabel ¶
func (obj *StatefulSet) GetPodLabel() map[string]string
GetPodLabel get Pod labels
func (*StatefulSet) ImagePullPolicy ¶
func (obj *StatefulSet) ImagePullPolicy(pullPolicy PullPolicy) *StatefulSet
ImagePullPolicy StatefulSet pull image policy:Always,Never,IfNotPresent
func (*StatefulSet) JSONNew ¶
func (obj *StatefulSet) JSONNew(jsonbyts []byte) *StatefulSet
JSONNew use json data create StatelfulSet
func (*StatefulSet) Release ¶
func (obj *StatefulSet) Release() (*v1.StatefulSet, error)
Release release StatefulSet on Kubernetes
func (*StatefulSet) Replace ¶
func (obj *StatefulSet) Replace(sts *v1.StatefulSet) *StatefulSet
Replace replace StatefulSet by Kubernetes resource object
func (*StatefulSet) SetAnnotations ¶
func (obj *StatefulSet) SetAnnotations(annotations map[string]string) *StatefulSet
SetAnnotations set StatefulSet annotations
func (*StatefulSet) SetCMDLiveness ¶
func (obj *StatefulSet) SetCMDLiveness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *StatefulSet
SetCMDLiveness set container liveness of cmd style cmd: execute liveness probe as commond line timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe??defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*StatefulSet) SetCMDReadness ¶
func (obj *StatefulSet) SetCMDReadness(cmd []string, initDelaySec, timeoutSec, periodSec int32) *StatefulSet
SetCMDReadness set container readness of cmd style cmd: execute readness probe as commond line timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe? defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*StatefulSet) SetContainer ¶
func (obj *StatefulSet) SetContainer(name, image string, containerPort int32) *StatefulSet
SetContainer set StatefulSet(sts) container name:name is container name ,default "" image:image is image name ,must input image containerPort: image expose containerPort,must input containerPort
func (*StatefulSet) SetEnvs ¶
func (obj *StatefulSet) SetEnvs(envMap map[string]string) *StatefulSet
SetEnvs set Pod Environmental variable
func (*StatefulSet) SetHTTPLiveness ¶
func (obj *StatefulSet) SetHTTPLiveness(port int, path string, initDelaySec, timeoutSec, periodSec int32, headers ...map[string]string) *StatefulSet
SetHTTPLiveness set container liveness of http style port: required path: http request URL,eg: /api/v1/posts/1 initDelaySec: how long time after the first start of the program the probe is executed for the first time.(sec) timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe??defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*StatefulSet) SetHTTPReadness ¶
func (obj *StatefulSet) SetHTTPReadness(port int, path string, initDelaySec, timeoutSec, periodSec int32, headers ...map[string]string) *StatefulSet
SetHTTPReadness set container readness initDelaySec: how long time after the first start of the program the probe is executed for the first time.(sec) timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe??defaults to 1 second. Minimum value is 1,Except for the first time? on the other hand, only **first container** will be set livenessProbe
func (*StatefulSet) SetImagePullSecrets ¶
func (obj *StatefulSet) SetImagePullSecrets(secretName string) *StatefulSet
SetImagePullSecrets set pod pull secret
func (*StatefulSet) SetLabels ¶
func (obj *StatefulSet) SetLabels(labels map[string]string) *StatefulSet
SetLabels set StatefulSet(sts) Labels
func (*StatefulSet) SetName ¶
func (obj *StatefulSet) SetName(name string) *StatefulSet
SetName set StatefulSet(sts) name
func (*StatefulSet) SetNamespace ¶
func (obj *StatefulSet) SetNamespace(namespace string) *StatefulSet
SetNamespace set StatefulSet(sts) namespace ,default namespace is 'default'
func (*StatefulSet) SetNamespaceAndName ¶
func (obj *StatefulSet) SetNamespaceAndName(namespace, name string) *StatefulSet
SetNamespaceAndName set StatefulSet namespace,set Pod namespace,set Deployment name.
func (*StatefulSet) SetPVCMounts ¶
func (obj *StatefulSet) SetPVCMounts(volumeName, mountPath string) *StatefulSet
SetPVCMounts mount PersistentVolumeClaim on container params: volumeName:the param is SetPVClaim() function volumeName,and when you call SetPVCMounts function you must call SetPVClaim function,and no order. on the other hand SetPVCMounts() function only mount first Container,and On the Container you can volumeMount many PersistentVolumeClaim. mountPath: runtime container dir eg:/var/lib/mysql
func (*StatefulSet) SetPVCTemp ¶
func (obj *StatefulSet) SetPVCTemp(pvcName, mountPath string, mode PersistentVolumeAccessMode, requests map[ResourceName]string) *StatefulSet
SetPVCTemp set StatefulSet PersistentVolumeClaimTemplate can't call SetPVCMounts() function when you call the function, because SetPVCMounts() function has been called automatically, Don't worry
func (*StatefulSet) SetPVClaim ¶
func (obj *StatefulSet) SetPVClaim(volumeName, claimName string) *StatefulSet
SetPVClaim set StatefulSet PersistentVolumeClaimVolumeSource params: volumeName: this is Custom field,you can define VolumeSource name,will be used of the container MountPath, claimName: this is PersistentVolumeClaim(PVC) name,the PVC and StatefulSet must on same namespace and exist.
func (*StatefulSet) SetPodLabels ¶
func (obj *StatefulSet) SetPodLabels(labels map[string]string) *StatefulSet
SetPodLabels set Pod labels and set StatefulSet(sts) selector
func (*StatefulSet) SetPodPriorityClass ¶
func (obj *StatefulSet) SetPodPriorityClass(priorityClassName string) *StatefulSet
SetPodPriorityClass set StatefulSet Pod Priority priorityClassName is Kubernetes resource object PriorityClass name priorityClassName must already exists in kubernetes cluster
func (*StatefulSet) SetPodQos ¶
func (obj *StatefulSet) SetPodQos(qosClass string, autoSet ...bool) *StatefulSet
SetPodQos set pod quality of service qosClass: is quality of service,the value only 'Guaranteed','Burstable' and 'BestEffort' autoSet: If your previous settings do not meet the requirements of PodQoS, we will automatically set
func (*StatefulSet) SetPostStartExec ¶
func (obj *StatefulSet) SetPostStartExec(command []string) *StatefulSet
SetPostStartExec set PostStart shell command style PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*StatefulSet) SetPostStartHTTP ¶
func (obj *StatefulSet) SetPostStartHTTP(scheme URIScheme, host string, port int, path string, headers ...map[string]string) *StatefulSet
SetPostStartHTTP set PostStart http style PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*StatefulSet) SetPreStopExec ¶
func (obj *StatefulSet) SetPreStopExec(command []string) *StatefulSet
SetPreStopExec set StatefulSet PreStop command PreStop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*StatefulSet) SetPreStopHTTP ¶
func (obj *StatefulSet) SetPreStopHTTP(scheme URIScheme, host string, port int, path string, headers ...map[string]string) *StatefulSet
SetPreStopHTTP set preStop http style PreStop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
func (*StatefulSet) SetPreferredNodeAffinity ¶
func (obj *StatefulSet) SetPreferredNodeAffinity(weight int32, key string, value []string, operator NodeSelectorOperator) *StatefulSet
SetPreferredNodeAffinity set node affinity for PreferredDuringSchedulingIgnoredDuringExecution style
func (*StatefulSet) SetReplicas ¶
func (obj *StatefulSet) SetReplicas(replicas int32) *StatefulSet
SetReplicas set StatefulSet(sts) replicas default 1
func (*StatefulSet) SetRequiredAndNodeAffinity ¶
func (obj *StatefulSet) SetRequiredAndNodeAffinity(key string, value []string, operator NodeSelectorOperator) *StatefulSet
SetRequiredAndNodeAffinity set node affinity for RequiredDuringSchedulingIgnoredDuringExecution style A list of keys, many key do AND operation.
func (*StatefulSet) SetRequiredORNodeAffinity ¶
func (obj *StatefulSet) SetRequiredORNodeAffinity(key string, value []string, operator NodeSelectorOperator) *StatefulSet
SetRequiredORNodeAffinity set node affinity for RequiredDuringSchedulingIgnoredDuringExecution style A list of keys, many key do OR operation.
func (*StatefulSet) SetResourceLimit ¶
func (obj *StatefulSet) SetResourceLimit(limits map[ResourceName]string) *StatefulSet
SetResourceLimit set container of StatefulSet resource limit,eg:CPU and MEMORY
func (*StatefulSet) SetResourceRequst ¶
func (obj *StatefulSet) SetResourceRequst(requests map[ResourceName]string) *StatefulSet
SetResourceRequst set container of StatefulSet resource request,only CPU and MEMORY
func (*StatefulSet) SetSelector ¶
func (obj *StatefulSet) SetSelector(labels map[string]string) *StatefulSet
SetSelector set StatefulSet(sts) labels selector and set Pod Labels
func (*StatefulSet) SetTCPLiveness ¶
func (obj *StatefulSet) SetTCPLiveness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *StatefulSet
SetTCPLiveness set container liveness of tcp style host: default is "" port: required timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe??defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*StatefulSet) SetTCPReadness ¶
func (obj *StatefulSet) SetTCPReadness(host string, port int, initDelaySec, timeoutSec, periodSec int32) *StatefulSet
SetTCPReadness set container readness of tcp style host: default is "" port: required timeoutSec: http request timeout seconds,defaults to 1 second. Minimum value is 1. periodSec: how often does the probe? defaults to 1 second. Minimum value is 1,Except for the first time? headers: headers[0] is HTTP Header, do not fill if you do not need to set on the other hand, only **first container** will be set livenessProbe
func (*StatefulSet) YAMLNew ¶
func (obj *StatefulSet) YAMLNew(yamlbyts []byte) *StatefulSet
YAMLNew use yaml data create StatefulSet
type StorageClass ¶
type StorageClass struct {
// contains filtered or unexported fields
}
StorageClass include Kubernetes resource object StorageClass and error.
func NewStorageClass ¶
func NewStorageClass() *StorageClass
NewStorageClass create StorageClass and chain function call begin with this function.
func (*StorageClass) Finish ¶
func (obj *StorageClass) Finish() (*v1.StorageClass, error)
Finish chain function call end with this function return Kubernetes resource object StorageClass and error. In the function, it will check necessary parameters,input the default field.
func (*StorageClass) JSONNew ¶
func (obj *StorageClass) JSONNew(jsonbyte []byte) *StorageClass
JSONNew use json data create StorageClass
func (*StorageClass) SetAnnotations ¶
func (obj *StorageClass) SetAnnotations(annotations map[string]string) *StorageClass
SetAnnotations set storageClass annotations
func (*StorageClass) SetLabels ¶
func (obj *StorageClass) SetLabels(labels map[string]string) *StorageClass
SetLabels set StorageClass labels
func (*StorageClass) SetMountOptions ¶
func (obj *StorageClass) SetMountOptions(opts []string) *StorageClass
SetMountOptions set sorageClass mount Options
func (*StorageClass) SetName ¶
func (obj *StorageClass) SetName() *StorageClass
SetName set storageCLASS name
func (*StorageClass) SetParameters ¶
func (obj *StorageClass) SetParameters(parameters map[string]string) *StorageClass
SetParameters set storageClass parameters
func (*StorageClass) SetProvisioner ¶
func (obj *StorageClass) SetProvisioner(provisioner string) *StorageClass
SetProvisioner set storageClass privisioner
func (*StorageClass) SetReclaimPolicy ¶
func (obj *StorageClass) SetReclaimPolicy(reclaimPolicy PersistentVolumeReclaimPolicy) *StorageClass
SetReclaimPolicy set setReclaim policy
func (*StorageClass) SetVolumeBindingMode ¶
func (obj *StorageClass) SetVolumeBindingMode(bindingMode VolumeBindingMode) *StorageClass
SetVolumeBindingMode set storageClass Volume BindingMode,value only:WaitForFirstConsumer,Immediate
func (*StorageClass) YAMLNew ¶
func (obj *StorageClass) YAMLNew(yamlbyts []byte) *StorageClass
YAMLNew use yaml data create StorageClass
type TaintEffect ¶
type TaintEffect string
TaintEffect taint effect type
const ( // Do not allow new pods to schedule onto the node unless they tolerate the taint, // but allow all pods submitted to Kubelet without going through the scheduler // to start, and allow all already-running pods to continue running. // Enforced by the scheduler. TaintEffectNoSchedule TaintEffect = "NoSchedule" // Like TaintEffectNoSchedule, but the scheduler tries not to schedule // new pods onto the node, rather than prohibiting new pods from scheduling // onto the node entirely. Enforced by the scheduler. TaintEffectPreferNoSchedule TaintEffect = "PreferNoSchedule" // Evict any already-running pods that do not tolerate the taint. // Currently enforced by NodeController. TaintEffectNoExecute TaintEffect = "NoExecute" )
Taint Effects only NoSchedule,PreferNoSchedule,NoExecute
func (TaintEffect) ToK8s ¶
func (te TaintEffect) ToK8s() v1.TaintEffect
ToK8s local TaintEffect to kubernetes TaintEffect
type TolerationOperator ¶
type TolerationOperator string
TolerationOperator A toleration operator is the set of operators that can be used in a toleration.
const ( TolerationOpExists TolerationOperator = "Exists" TolerationOpEqual TolerationOperator = "Equal" )
TolerationOperator operators
func (TolerationOperator) ToK8s ¶
func (to TolerationOperator) ToK8s() v1.TolerationOperator
ToK8s local TolerationOperator to kubernetes TolerationOperator
type URIScheme ¶
type URIScheme string
URIScheme identifies the scheme used for connection to a host for Get actions
type UnionPV ¶
type UnionPV struct {
// contains filtered or unexported fields
}
UnionPV output pvc and pv
func NewUnionPV ¶
func NewUnionPV() *UnionPV
NewUnionPV create PersistentVolume,PersistentVolumeClaim and error and chain function call begin with this function.
func (*UnionPV) Finish ¶
func (un *UnionPV) Finish() (pv *v1.PersistentVolume, pvc *v1.PersistentVolumeClaim, err error)
Finish Chain function call end with this function return Kubernetes resource object(PersistentVolume,PersistentVolumeClaim) and error In the function, it will check necessary parametersainput the default field
func (*UnionPV) Release ¶
func (un *UnionPV) Release() (pv *v1.PersistentVolume, pvc *v1.PersistentVolumeClaim, err error)
Release release UnionPV on Kubernetes
func (*UnionPV) SetAccessMode ¶
func (un *UnionPV) SetAccessMode(mode PersistentVolumeAccessMode) *UnionPV
SetAccessMode set PersistentVolume and PersistentVolumeClaim accessmode
func (*UnionPV) SetAccessModes ¶
func (un *UnionPV) SetAccessModes(modes []PersistentVolumeAccessMode) *UnionPV
SetAccessModes PersistentVolume and PersistentVolumeClaim access modes
func (*UnionPV) SetAnnotations ¶
SetAnnotations get PersistentVolume and PersistentVolumeClaim annotations
func (*UnionPV) SetCapacity ¶
func (un *UnionPV) SetCapacity(capMaps map[ResourceName]string) *UnionPV
SetCapacity set PersistentVolume capacity and set PersistentVolumeClaim resource request
func (*UnionPV) SetLabels ¶
SetLabels set PersistentVolume labels ,set PersistentVolumeClaim labels and set PersistentVolumeClaim selector
func (*UnionPV) SetNFS ¶
func (un *UnionPV) SetNFS(nfs *NFSVolumeSource) *UnionPV
SetNFS set PersistentVolume volume source is NFS
func (*UnionPV) SetNamespace ¶
SetNamespace set PersistentVolumeClaim namespace, and PersistentVolume can't set namespece because of no such attribute
func (*UnionPV) SetNamespaceAndName ¶
SetNamespaceAndName set PersistentVolumeClaim namespace and name, set PersistentVolumeClaim name PersistentVolume can't set namespece because of no such attribute
func (*UnionPV) SetRBD ¶
func (un *UnionPV) SetRBD(rbd *RBDPersistentVolumeSource) *UnionPV
SetRBD set PersistentVolume volume source is RBD
func (*UnionPV) SetVolumeMode ¶
func (un *UnionPV) SetVolumeMode(volumeMode PersistentVolumeMode) *UnionPV
SetVolumeMode set pvc volume mode Filesystem or Block
type VolumeBindingMode ¶
type VolumeBindingMode string
VolumeBindingMode indicates how PersistentVolumeClaims should be bound.
const ( // VolumeBindingImmediate indicates that PersistentVolumeClaims should be // immediately provisioned and bound. This is the default mode. VolumeBindingImmediate VolumeBindingMode = "Immediate" // VolumeBindingWaitForFirstConsumer indicates that PersistentVolumeClaims // should not be provisioned and bound until the first Pod is created that // references the PeristentVolumeClaim. The volume provisioning and // binding will occur during Pod scheduing. VolumeBindingWaitForFirstConsumer VolumeBindingMode = "WaitForFirstConsumer" )
func (VolumeBindingMode) ToK8s ¶
func (bm VolumeBindingMode) ToK8s() *storv1.VolumeBindingMode
ToK8s local bindingMode to kubernetes bindingMode