Documentation ¶
Overview ¶
Package kubectl is a set of libraries that are used by the kubectl command line tool. They are separated out into a library to support unit testing. Most functionality should be included in this package, and the main kubectl should really just be an entry point.
A set of common functions needed by cmd/kubectl and pkg/kubectl packages.
Index ¶
- Constants
- Variables
- func AbortRollingUpdate(c *RollingUpdaterConfig) error
- func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, ...) (*api.ReplicationController, error)
- func AddJsonFilenameFlag(cmd *cobra.Command, value *[]string, usage string)
- func AnnotateFlags(cmd *cobra.Command, generators map[string]Generator)
- func AppendAllLabels(showLabels bool, itemLabels map[string]string) string
- func AppendLabelTabs(columnLabels []string) string
- func AppendLabels(itemLabels map[string]string, columnLabels []string) string
- func CreateApplyAnnotation(info *resource.Info, codec runtime.Encoder) error
- func CreateNewControllerFromCurrentController(rcClient coreclient.ReplicationControllersGetter, codec runtime.Codec, ...) (*api.ReplicationController, error)
- func CreateOrUpdateAnnotation(createAnnotation bool, info *resource.Info, codec runtime.Encoder) error
- func DecodeUnknownObject(obj runtime.Object) (runtime.Object, error)
- func DescribableResources() []string
- func DescribeEvents(el *api.EventList, w *PrefixWriter)
- func DescribeLimitRanges(limitRanges *api.LimitRangeList, w *PrefixWriter)
- func DescribePodTemplate(template *api.PodTemplateSpec, out io.Writer)
- func DescribeProbe(probe *api.Probe) string
- func DescribeResourceQuotas(quotas *api.ResourceQuotaList, w *PrefixWriter)
- func EnsureFlagsValid(cmd *cobra.Command, generators map[string]Generator, generatorInUse string) error
- func FindSourceController(r coreclient.ReplicationControllersGetter, namespace, name string) (*api.ReplicationController, error)
- func GetBool(params map[string]string, key string, defValue bool) (bool, error)
- func GetModifiedConfiguration(info *resource.Info, annotate bool, codec runtime.Encoder) ([]byte, error)
- func GetNewTabWriter(output io.Writer) *tabwriter.Writer
- func GetNextControllerAnnotation(rc *api.ReplicationController) (string, bool)
- func GetOriginalConfiguration(mapping *meta.RESTMapping, obj runtime.Object) ([]byte, error)
- func HandleResourceRequirements(params map[string]string) (api.ResourceRequirements, error)
- func IsNoSuchReaperError(err error) bool
- func IsZero(i interface{}) bool
- func LoadExistingNextReplicationController(c coreclient.ReplicationControllersGetter, namespace, newName string) (*api.ReplicationController, error)
- func MakeLabels(labels map[string]string) string
- func MakeParams(cmd *cobra.Command, params []GeneratorParam) map[string]interface{}
- func MakeProtocols(protocols map[string]string) string
- func MakeRegexpArray(str string) ([]*regexp.Regexp, error)
- func MakeRegexpArrayOrDie(str string) []*regexp.Regexp
- func ParseLabels(labelSpec interface{}) (map[string]string, error)
- func ParseProtocols(protocols interface{}) (map[string]string, error)
- func PrintModelDescription(inModel string, fieldsPath []string, w io.Writer, ...) error
- func Rename(c coreclient.ReplicationControllersGetter, rc *api.ReplicationController, ...) error
- func ResourceAliases(rs []string) []string
- func ResourceShortFormFor(resource string) (string, bool)
- func ScaleCondition(r Scaler, precondition *ScalePrecondition, namespace, name string, count uint, ...) wait.ConditionFunc
- func SetNextControllerAnnotation(rc *api.ReplicationController, name string)
- func SetOriginalConfiguration(info *resource.Info, original []byte) error
- func ShortHumanDuration(d time.Duration) string
- func SortedQoSResourceNames(list qos.QOSList) []api.ResourceName
- func SortedResourceNames(list api.ResourceList) []api.ResourceName
- func SplitAndParseResourceRequest(inResource string, mapper meta.RESTMapper) (string, []string, error)
- func UpdateApplyAnnotation(info *resource.Info, codec runtime.Encoder) error
- func UpdateExistingReplicationController(rcClient coreclient.ReplicationControllersGetter, ...) (*api.ReplicationController, error)
- func ValidateParams(paramSpec []GeneratorParam, params map[string]interface{}) error
- type BasicPod
- type BasicReplicationController
- type CertificateSigningRequestDescriber
- type ClusterDescriber
- type ClusterGeneratorV1Beta1
- type ClusterRoleBindingGeneratorV1
- type Column
- type ConfigMapDescriber
- type ConfigMapGeneratorV1
- type CronJobDescriber
- type CronJobV2Alpha1
- type CustomColumnsPrinter
- type DaemonSetDescriber
- type DaemonSetReaper
- type DeploymentBasicGeneratorV1
- type DeploymentDescriber
- type DeploymentHistoryViewer
- type DeploymentReaper
- type DeploymentRollbacker
- type DeploymentScaler
- type DeploymentStatusViewer
- type DeploymentV1Beta1
- type Describer
- type DescriberSettings
- type Describers
- type EndpointsDescriber
- type EnvVarResolverFunc
- type ErrNoDescriber
- type FilterFunc
- type FilterServer
- type Filters
- type Generator
- type GeneratorParam
- type HistoryViewer
- type HorizontalPodAutoscalerDescriber
- type HorizontalPodAutoscalerV1
- type HorizontalPodAutoscalerV1Beta1
- type HumanReadablePrinter
- func (h *HumanReadablePrinter) AfterPrint(output io.Writer, res string) error
- func (h *HumanReadablePrinter) EnsurePrintWithKind(kind string)
- func (h *HumanReadablePrinter) GetResourceKind() string
- func (h *HumanReadablePrinter) HandledResources() []string
- func (h *HumanReadablePrinter) Handler(columns, columnsWithWide []string, printFunc interface{}) error
- func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) error
- type IngressDescriber
- type JSONPathPrinter
- type JSONPrinter
- type JobDescriber
- type JobReaper
- type JobScaler
- type JobV1
- type LimitRangeDescriber
- type NamePrinter
- type NamespaceDescriber
- type NamespaceGeneratorV1
- type NamespaceInfo
- type NetworkPolicyDescriber
- type NewControllerConfig
- type NoSuchReaperError
- type NodeDescriber
- type ObjectDescriber
- type OutputVersionMapper
- type PersistentVolumeClaimDescriber
- type PersistentVolumeDescriber
- type PodDescriber
- type PodDisruptionBudgetDescriber
- type PodDisruptionBudgetV1Generator
- type PodReaper
- type PreconditionError
- type PrefixWriter
- type PrintOptions
- type ProxyServer
- type RESTClient
- type Reaper
- type ReplicaSetDescriber
- type ReplicaSetReaper
- type ReplicaSetScaler
- type ReplicationControllerDescriber
- type ReplicationControllerReaper
- type ReplicationControllerScaler
- type ResourcePrinter
- type ResourcePrinterFunc
- type ResourceQuotaDescriber
- type ResourceQuotaGeneratorV1
- type ResourceShortcuts
- type RetryParams
- type RoleBindingGeneratorV1
- type Rollbacker
- type RollingUpdater
- type RollingUpdaterCleanupPolicy
- type RollingUpdaterConfig
- type RuntimeSort
- type ScaleError
- type ScaleErrorType
- type ScalePrecondition
- func (precondition *ScalePrecondition) ValidateDeployment(deployment *extensions.Deployment) error
- func (precondition *ScalePrecondition) ValidateJob(job *batch.Job) error
- func (precondition *ScalePrecondition) ValidateReplicaSet(replicaSet *extensions.ReplicaSet) error
- func (precondition *ScalePrecondition) ValidateReplicationController(controller *api.ReplicationController) error
- func (precondition *ScalePrecondition) ValidateStatefulSet(ps *apps.StatefulSet) error
- type Scaler
- type SecretDescriber
- type SecretForDockerRegistryGeneratorV1
- type SecretForTLSGeneratorV1
- type SecretGeneratorV1
- type ServiceAccountDescriber
- type ServiceAccountGeneratorV1
- type ServiceClusterIPGeneratorV1
- type ServiceCommonGeneratorV1
- type ServiceDescriber
- type ServiceExternalNameGeneratorV1
- type ServiceGeneratorV1
- type ServiceGeneratorV2
- type ServiceLoadBalancerGeneratorV1
- type ServiceNodePortGeneratorV1
- type ServiceReaper
- type SortableResourceNames
- type SortableResourceQuotas
- type SortableVolumeMounts
- type SortingPrinter
- type StatefulSetDescriber
- type StatefulSetReaper
- type StatefulSetScaler
- type StatusViewer
- type StorageClassDescriber
- type StructuredGenerator
- type TemplatePrinter
- type VersionedPrinter
- type YAMLPrinter
Constants ¶
const ( LEVEL_0 = iota LEVEL_1 LEVEL_2 LEVEL_3 )
Each level has 2 spaces for PrefixWriter
const ( DefaultHostAcceptRE = "^localhost$,^127\\.0\\.0\\.1$,^\\[::1\\]$" DefaultPathAcceptRE = "^.*" DefaultPathRejectRE = "^/api/.*/pods/.*/exec,^/api/.*/pods/.*/attach" DefaultMethodRejectRE = "POST,PUT,PATCH" )
const ( Interval = time.Second * 1 Timeout = time.Minute * 5 )
const (
ChangeCauseAnnotation = "kubernetes.io/change-cause"
)
Variables ¶
var ResourcesShortcutStatic = []ResourceShortcuts{ { ShortForm: schema.GroupResource{Resource: "cm"}, LongForm: schema.GroupResource{Resource: "configmaps"}, }, { ShortForm: schema.GroupResource{Resource: "cs"}, LongForm: schema.GroupResource{Resource: "componentstatuses"}, }, { ShortForm: schema.GroupResource{Resource: "ep"}, LongForm: schema.GroupResource{Resource: "endpoints"}, }, { ShortForm: schema.GroupResource{Resource: "ev"}, LongForm: schema.GroupResource{Resource: "events"}, }, { ShortForm: schema.GroupResource{Resource: "limits"}, LongForm: schema.GroupResource{Resource: "limitranges"}, }, { ShortForm: schema.GroupResource{Resource: "no"}, LongForm: schema.GroupResource{Resource: "nodes"}, }, { ShortForm: schema.GroupResource{Resource: "ns"}, LongForm: schema.GroupResource{Resource: "namespaces"}, }, { ShortForm: schema.GroupResource{Resource: "po"}, LongForm: schema.GroupResource{Resource: "pods"}, }, { ShortForm: schema.GroupResource{Resource: "pvc"}, LongForm: schema.GroupResource{Resource: "persistentvolumeclaims"}, }, { ShortForm: schema.GroupResource{Resource: "pv"}, LongForm: schema.GroupResource{Resource: "persistentvolumes"}, }, { ShortForm: schema.GroupResource{Resource: "quota"}, LongForm: schema.GroupResource{Resource: "resourcequotas"}, }, { ShortForm: schema.GroupResource{Resource: "rc"}, LongForm: schema.GroupResource{Resource: "replicationcontrollers"}, }, { ShortForm: schema.GroupResource{Resource: "rs"}, LongForm: schema.GroupResource{Resource: "replicasets"}, }, { ShortForm: schema.GroupResource{Resource: "sa"}, LongForm: schema.GroupResource{Resource: "serviceaccounts"}, }, { ShortForm: schema.GroupResource{Resource: "svc"}, LongForm: schema.GroupResource{Resource: "services"}, }, { ShortForm: schema.GroupResource{Group: "autoscaling", Resource: "hpa"}, LongForm: schema.GroupResource{Group: "autoscaling", Resource: "horizontalpodautoscalers"}, }, { ShortForm: schema.GroupResource{Group: "certificates.k8s.io", Resource: "csr"}, LongForm: schema.GroupResource{Group: "certificates.k8s.io", Resource: "certificatesigningrequests"}, }, { ShortForm: schema.GroupResource{Group: "policy", Resource: "pdb"}, LongForm: schema.GroupResource{Group: "policy", Resource: "poddisruptionbudgets"}, }, { ShortForm: schema.GroupResource{Group: "extensions", Resource: "deploy"}, LongForm: schema.GroupResource{Group: "extensions", Resource: "deployments"}, }, { ShortForm: schema.GroupResource{Group: "extensions", Resource: "ds"}, LongForm: schema.GroupResource{Group: "extensions", Resource: "daemonsets"}, }, { ShortForm: schema.GroupResource{Group: "extensions", Resource: "hpa"}, LongForm: schema.GroupResource{Group: "extensions", Resource: "horizontalpodautoscalers"}, }, { ShortForm: schema.GroupResource{Group: "extensions", Resource: "ing"}, LongForm: schema.GroupResource{Group: "extensions", Resource: "ingresses"}, }, { ShortForm: schema.GroupResource{Group: "extensions", Resource: "psp"}, LongForm: schema.GroupResource{Group: "extensions", Resource: "podSecurityPolicies"}, }, }
ResourcesShortcutStatic is the list of short names to their expanded names. Note that the list is ordered by group.
var ( // The reverse proxy will periodically flush the io writer at this frequency. // Only matters for long poll connections like the one used to watch. With an // interval of 0 the reverse proxy will buffer content sent on any connection // with transfer-encoding=chunked. // TODO: Flush after each chunk so the client doesn't suffer a 100ms latency per // watch event. ReverseProxyFlushInterval = 100 * time.Millisecond )
Functions ¶
func AbortRollingUpdate ¶ added in v0.17.0
func AbortRollingUpdate(c *RollingUpdaterConfig) error
func AddDeploymentKeyToReplicationController ¶ added in v0.17.0
func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, rcClient coreclient.ReplicationControllersGetter, podClient coreclient.PodsGetter, deploymentKey, deploymentValue, namespace string, out io.Writer) (*api.ReplicationController, error)
func AddJsonFilenameFlag ¶ added in v0.16.0
func AnnotateFlags ¶ added in v1.2.0
AnnotateFlags annotates all flags that are used by generators.
func AppendAllLabels ¶ added in v1.3.0
Append all labels to a single column. We need this even when show-labels flag* is false, since this adds newline delimiter to the end of each row.
func AppendLabelTabs ¶ added in v1.3.0
Append a set of tabs for each label column. We need this in the case where we have extra lines so that the tabwriter will still line things up.
func AppendLabels ¶ added in v1.3.0
func CreateApplyAnnotation ¶ added in v1.2.0
CreateApplyAnnotation gets the modified configuration of the object, without embedding it again, and then sets it on the object as the annotation.
func CreateNewControllerFromCurrentController ¶ added in v0.17.0
func CreateNewControllerFromCurrentController(rcClient coreclient.ReplicationControllersGetter, codec runtime.Codec, cfg *NewControllerConfig) (*api.ReplicationController, error)
func CreateOrUpdateAnnotation ¶ added in v1.2.0
func CreateOrUpdateAnnotation(createAnnotation bool, info *resource.Info, codec runtime.Encoder) error
Create the annotation used by kubectl apply only when createAnnotation is true Otherwise, only update the annotation when it already exists
func DecodeUnknownObject ¶ added in v1.6.0
check if the object is unstructured. If so, let's attempt to convert it to a type we can understand.
func DescribableResources ¶ added in v0.16.0
func DescribableResources() []string
List of all resource types we can describe
func DescribeEvents ¶ added in v0.16.0
func DescribeEvents(el *api.EventList, w *PrefixWriter)
func DescribeLimitRanges ¶ added in v0.20.0
func DescribeLimitRanges(limitRanges *api.LimitRangeList, w *PrefixWriter)
DescribeLimitRanges merges a set of limit range items into a single tabular description
func DescribePodTemplate ¶ added in v1.2.0
func DescribePodTemplate(template *api.PodTemplateSpec, out io.Writer)
func DescribeProbe ¶ added in v1.2.0
DescribeProbe is exported for consumers in other API groups that have probes
func DescribeResourceQuotas ¶ added in v0.20.0
func DescribeResourceQuotas(quotas *api.ResourceQuotaList, w *PrefixWriter)
DescribeResourceQuotas merges a set of quota items into a single tabular description of all quotas
func EnsureFlagsValid ¶ added in v1.2.0
func EnsureFlagsValid(cmd *cobra.Command, generators map[string]Generator, generatorInUse string) error
EnsureFlagsValid ensures that no invalid flags are being used against a generator.
func FindSourceController ¶ added in v0.17.0
func FindSourceController(r coreclient.ReplicationControllersGetter, namespace, name string) (*api.ReplicationController, error)
func GetModifiedConfiguration ¶ added in v1.1.1
func GetModifiedConfiguration(info *resource.Info, annotate bool, codec runtime.Encoder) ([]byte, error)
GetModifiedConfiguration retrieves the modified configuration of the object. If annotate is true, it embeds the result as an annotation in the modified configuration. If an object was read from the command input, it will use that version of the object. Otherwise, it will use the version from the server.
func GetNewTabWriter ¶ added in v1.2.0
GetNewTabWriter returns a tabwriter that translates tabbed columns in input into properly aligned text.
func GetNextControllerAnnotation ¶ added in v0.17.0
func GetNextControllerAnnotation(rc *api.ReplicationController) (string, bool)
func GetOriginalConfiguration ¶ added in v1.1.1
GetOriginalConfiguration retrieves the original configuration of the object from the annotation, or nil if no annotation was found.
func HandleResourceRequirements ¶ added in v1.1.0
func HandleResourceRequirements(params map[string]string) (api.ResourceRequirements, error)
HandleResourceRequirements parses the limits and requests parameters if specified
func IsNoSuchReaperError ¶ added in v0.16.0
func LoadExistingNextReplicationController ¶ added in v0.17.0
func LoadExistingNextReplicationController(c coreclient.ReplicationControllersGetter, namespace, newName string) (*api.ReplicationController, error)
func MakeLabels ¶ added in v0.11.0
func MakeParams ¶ added in v0.9.0
func MakeParams(cmd *cobra.Command, params []GeneratorParam) map[string]interface{}
MakeParams is a utility that creates generator parameters from a command line
func MakeProtocols ¶ added in v1.3.0
func MakeRegexpArray ¶ added in v0.20.0
Splits a comma separated list of regexps into an array of Regexp objects.
func MakeRegexpArrayOrDie ¶ added in v0.20.0
func ParseLabels ¶ added in v0.9.0
ParseLabels turns a string representation of a label set into a map[string]string
func ParseProtocols ¶ added in v1.3.0
func PrintModelDescription ¶ added in v1.2.0
func PrintModelDescription(inModel string, fieldsPath []string, w io.Writer, swaggerSchema *swagger.ApiDeclaration, r bool) error
PrintModelDescription prints the description of a specific model or dot path
func Rename ¶ added in v0.17.0
func Rename(c coreclient.ReplicationControllersGetter, rc *api.ReplicationController, newName string) error
func ResourceAliases ¶ added in v1.3.0
ResourceAliases returns the resource shortcuts and plural forms for the given resources.
func ResourceShortFormFor ¶ added in v1.4.0
ResourceShortFormFor looks up for a short form of resource names. TODO: Change the signature of this function so that it can make use of ResourceShortcuts.
func ScaleCondition ¶ added in v0.18.0
func ScaleCondition(r Scaler, precondition *ScalePrecondition, namespace, name string, count uint, updatedResourceVersion *string) wait.ConditionFunc
ScaleCondition is a closure around Scale that facilitates retries via util.wait
func SetNextControllerAnnotation ¶ added in v0.17.0
func SetNextControllerAnnotation(rc *api.ReplicationController, name string)
func SetOriginalConfiguration ¶ added in v1.1.1
SetOriginalConfiguration sets the original configuration of the object as the annotation on the object for later use in computing a three way patch.
func ShortHumanDuration ¶
func SortedQoSResourceNames ¶ added in v1.3.0
func SortedQoSResourceNames(list qos.QOSList) []api.ResourceName
SortedQoSResourceNames returns the sorted resource names of a QoS list.
func SortedResourceNames ¶ added in v1.3.0
func SortedResourceNames(list api.ResourceList) []api.ResourceName
SortedResourceNames returns the sorted resource names of a resource list.
func SplitAndParseResourceRequest ¶ added in v1.2.0
func SplitAndParseResourceRequest(inResource string, mapper meta.RESTMapper) (string, []string, error)
SplitAndParseResourceRequest separates the users input into a model and fields
func UpdateApplyAnnotation ¶ added in v1.1.1
UpdateApplyAnnotation calls CreateApplyAnnotation if the last applied configuration annotation is already present. Otherwise, it does nothing.
func UpdateExistingReplicationController ¶ added in v0.17.0
func UpdateExistingReplicationController(rcClient coreclient.ReplicationControllersGetter, podClient coreclient.PodsGetter, oldRc *api.ReplicationController, namespace, newName, deploymentKey, deploymentValue string, out io.Writer) (*api.ReplicationController, error)
func ValidateParams ¶ added in v0.9.0
func ValidateParams(paramSpec []GeneratorParam, params map[string]interface{}) error
ValidateParams ensures that all required params are present in the params map
Types ¶
type BasicPod ¶ added in v1.1.0
type BasicPod struct{}
func (BasicPod) ParamNames ¶ added in v1.1.0
func (BasicPod) ParamNames() []GeneratorParam
type BasicReplicationController ¶ added in v0.9.0
type BasicReplicationController struct{}
func (BasicReplicationController) Generate ¶ added in v0.9.0
func (BasicReplicationController) Generate(genericParams map[string]interface{}) (runtime.Object, error)
func (BasicReplicationController) ParamNames ¶ added in v0.9.0
func (BasicReplicationController) ParamNames() []GeneratorParam
type CertificateSigningRequestDescriber ¶ added in v1.4.0
type CertificateSigningRequestDescriber struct {
// contains filtered or unexported fields
}
func (*CertificateSigningRequestDescriber) Describe ¶ added in v1.4.0
func (p *CertificateSigningRequestDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ClusterDescriber ¶ added in v1.3.0
type ClusterDescriber struct {
fedclientset.Interface
}
func (*ClusterDescriber) Describe ¶ added in v1.3.0
func (d *ClusterDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ClusterGeneratorV1Beta1 ¶ added in v1.5.0
type ClusterGeneratorV1Beta1 struct { // Name of the cluster context (required) Name string // ClientCIDR is the CIDR range in which the Kubernetes APIServer // is available for the client (optional) ClientCIDR string // ServerAddress is the APIServer address of the Kubernetes cluster // that is being registered (required) ServerAddress string // SecretName is the name of the secret that stores the credentials // for the Kubernetes cluster that is being registered (optional) SecretName string }
ClusterGeneratorV1Beta1 supports stable generation of a federation/cluster resource.
func (ClusterGeneratorV1Beta1) Generate ¶ added in v1.5.0
func (s ClusterGeneratorV1Beta1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
Generate returns a cluster resource using the specified parameters.
func (ClusterGeneratorV1Beta1) ParamNames ¶ added in v1.5.0
func (s ClusterGeneratorV1Beta1) ParamNames() []GeneratorParam
ParamNames returns the set of supported input parameters when using the parameter injection generator pattern.
func (ClusterGeneratorV1Beta1) StructuredGenerate ¶ added in v1.5.0
func (s ClusterGeneratorV1Beta1) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a federation cluster resource object using the configured fields.
type ClusterRoleBindingGeneratorV1 ¶ added in v1.6.0
type ClusterRoleBindingGeneratorV1 struct { // Name of clusterRoleBinding (required) Name string // ClusterRole for the clusterRoleBinding (required) ClusterRole string // Users to derive the clusterRoleBinding from (optional) Users []string // Groups to derive the clusterRoleBinding from (optional) Groups []string // ServiceAccounts to derive the clusterRoleBinding from in namespace:name format(optional) ServiceAccounts []string }
ClusterRoleBindingGeneratorV1 supports stable generation of a clusterRoleBinding.
func (ClusterRoleBindingGeneratorV1) Generate ¶ added in v1.6.0
func (s ClusterRoleBindingGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
Generate returns a clusterRoleBinding using the specified parameters.
func (ClusterRoleBindingGeneratorV1) ParamNames ¶ added in v1.6.0
func (s ClusterRoleBindingGeneratorV1) ParamNames() []GeneratorParam
ParamNames returns the set of supported input parameters when using the parameter injection generator pattern.
func (ClusterRoleBindingGeneratorV1) StructuredGenerate ¶ added in v1.6.0
func (s ClusterRoleBindingGeneratorV1) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a clusterRoleBinding object using the configured fields.
type Column ¶ added in v1.1.0
type Column struct { // The header to print above the column, general style is ALL_CAPS Header string // The pointer to the field in the object to print in JSONPath form // e.g. {.ObjectMeta.Name}, see pkg/util/jsonpath for more details. FieldSpec string }
Column represents a user specified column
type ConfigMapDescriber ¶ added in v1.2.0
ConfigMapDescriber generates information about a ConfigMap
func (*ConfigMapDescriber) Describe ¶ added in v1.2.0
func (d *ConfigMapDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ConfigMapGeneratorV1 ¶ added in v1.2.0
type ConfigMapGeneratorV1 struct { // Name of configMap (required) Name string // Type of configMap (optional) Type string // FileSources to derive the configMap from (optional) FileSources []string // LiteralSources to derive the configMap from (optional) LiteralSources []string }
ConfigMapGeneratorV1 supports stable generation of a configMap.
func (ConfigMapGeneratorV1) Generate ¶ added in v1.2.0
func (s ConfigMapGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
Generate returns a configMap using the specified parameters.
func (ConfigMapGeneratorV1) ParamNames ¶ added in v1.2.0
func (s ConfigMapGeneratorV1) ParamNames() []GeneratorParam
ParamNames returns the set of supported input parameters when using the parameter injection generator pattern.
func (ConfigMapGeneratorV1) StructuredGenerate ¶ added in v1.2.0
func (s ConfigMapGeneratorV1) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a configMap object using the configured fields.
type CronJobDescriber ¶ added in v1.5.0
CronJobDescriber generates information about a scheduled job and the jobs it has created.
func (*CronJobDescriber) Describe ¶ added in v1.5.0
func (d *CronJobDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type CronJobV2Alpha1 ¶ added in v1.5.0
type CronJobV2Alpha1 struct{}
func (CronJobV2Alpha1) Generate ¶ added in v1.5.0
func (CronJobV2Alpha1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
func (CronJobV2Alpha1) ParamNames ¶ added in v1.5.0
func (CronJobV2Alpha1) ParamNames() []GeneratorParam
type CustomColumnsPrinter ¶ added in v1.1.0
CustomColumnPrinter is a printer that knows how to print arbitrary columns of data from templates specified in the `Columns` array
func NewCustomColumnsPrinterFromSpec ¶ added in v1.1.0
func NewCustomColumnsPrinterFromSpec(spec string, decoder runtime.Decoder, noHeaders bool) (*CustomColumnsPrinter, error)
NewCustomColumnsPrinterFromSpec creates a custom columns printer from a comma separated list of <header>:<jsonpath-field-spec> pairs. e.g. NAME:metadata.name,API_VERSION:apiVersion creates a printer that prints:
NAME API_VERSION foo bar
func NewCustomColumnsPrinterFromTemplate ¶ added in v1.1.0
func NewCustomColumnsPrinterFromTemplate(templateReader io.Reader, decoder runtime.Decoder) (*CustomColumnsPrinter, error)
NewCustomColumnsPrinterFromTemplate creates a custom columns printer from a template stream. The template is expected to consist of two lines, whitespace separated. The first line is the header line, the second line is the jsonpath field spec For example, the template below: NAME API_VERSION {metadata.name} {apiVersion}
func (*CustomColumnsPrinter) AfterPrint ¶ added in v1.5.0
func (s *CustomColumnsPrinter) AfterPrint(w io.Writer, res string) error
func (*CustomColumnsPrinter) HandledResources ¶ added in v1.1.0
func (s *CustomColumnsPrinter) HandledResources() []string
type DaemonSetDescriber ¶ added in v1.1.0
DaemonSetDescriber generates information about a daemon set and the pods it has created.
func (*DaemonSetDescriber) Describe ¶ added in v1.1.0
func (d *DaemonSetDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type DaemonSetReaper ¶ added in v1.1.0
type DaemonSetReaper struct {
// contains filtered or unexported fields
}
func (*DaemonSetReaper) Stop ¶ added in v1.1.0
func (reaper *DaemonSetReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *metav1.DeleteOptions) error
type DeploymentBasicGeneratorV1 ¶ added in v1.4.0
DeploymentGeneratorV1 supports stable generation of a deployment
func (DeploymentBasicGeneratorV1) Generate ¶ added in v1.4.0
func (s DeploymentBasicGeneratorV1) Generate(params map[string]interface{}) (runtime.Object, error)
func (DeploymentBasicGeneratorV1) ParamNames ¶ added in v1.4.0
func (DeploymentBasicGeneratorV1) ParamNames() []GeneratorParam
func (*DeploymentBasicGeneratorV1) StructuredGenerate ¶ added in v1.4.0
func (s *DeploymentBasicGeneratorV1) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a deployment object using the configured fields
type DeploymentDescriber ¶ added in v1.1.1
DeploymentDescriber generates information about a deployment.
func (*DeploymentDescriber) Describe ¶ added in v1.1.1
func (dd *DeploymentDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type DeploymentHistoryViewer ¶ added in v1.2.0
type DeploymentHistoryViewer struct {
// contains filtered or unexported fields
}
func (*DeploymentHistoryViewer) ViewHistory ¶ added in v1.4.0
func (h *DeploymentHistoryViewer) ViewHistory(namespace, name string, revision int64) (string, error)
ViewHistory returns a revision-to-replicaset map as the revision history of a deployment
type DeploymentReaper ¶ added in v1.2.0
type DeploymentReaper struct {
// contains filtered or unexported fields
}
func (*DeploymentReaper) Stop ¶ added in v1.2.0
func (reaper *DeploymentReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *metav1.DeleteOptions) error
type DeploymentRollbacker ¶ added in v1.2.0
type DeploymentRollbacker struct {
// contains filtered or unexported fields
}
type DeploymentScaler ¶ added in v1.2.0
type DeploymentScaler struct {
// contains filtered or unexported fields
}
func (*DeploymentScaler) Scale ¶ added in v1.2.0
func (scaler *DeploymentScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error
Scale updates a deployment to a new size, with optional precondition check (if preconditions is not nil), optional retries (if retry is not nil), and then optionally waits for the status to reach desired count.
func (*DeploymentScaler) ScaleSimple ¶ added in v1.2.0
func (scaler *DeploymentScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) (string, error)
ScaleSimple is responsible for updating a deployment's desired replicas count. It returns the resourceVersion of the deployment if the update is successful.
type DeploymentStatusViewer ¶ added in v1.3.0
type DeploymentStatusViewer struct {
// contains filtered or unexported fields
}
type DeploymentV1Beta1 ¶ added in v1.2.0
type DeploymentV1Beta1 struct{}
func (DeploymentV1Beta1) Generate ¶ added in v1.2.0
func (DeploymentV1Beta1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
func (DeploymentV1Beta1) ParamNames ¶ added in v1.2.0
func (DeploymentV1Beta1) ParamNames() []GeneratorParam
type Describer ¶
type Describer interface {
Describe(namespace, name string, describerSettings DescriberSettings) (output string, err error)
}
Describer generates output for the named resource or an error if the output could not be generated. Implementers typically abstract the retrieval of the named object from a remote server.
func DescriberFor ¶
Describer returns the default describe functions for each of the standard Kubernetes types.
func GenericDescriberFor ¶
func GenericDescriberFor(mapping *meta.RESTMapping, dynamic *dynamic.Client, events coreclient.EventsGetter) Describer
GenericDescriberFor returns a generic describer for the specified mapping that uses only information available from runtime.Unstructured
type DescriberSettings ¶ added in v1.3.0
type DescriberSettings struct {
ShowEvents bool
}
DescriberSettings holds display configuration for each object describer to control what is printed.
type Describers ¶ added in v0.13.1
type Describers struct {
// contains filtered or unexported fields
}
Describers implements ObjectDescriber against functions registered via Add. Those functions can be strongly typed. Types are exactly matched (no conversion or assignable checks).
func (*Describers) Add ¶ added in v0.13.1
func (d *Describers) Add(fns ...interface{}) error
Add adds one or more describer functions to the Describer. The passed function must match the signature:
func(...) (string, error)
Any number of arguments may be provided.
func (*Describers) DescribeObject ¶ added in v0.13.1
func (d *Describers) DescribeObject(exact interface{}, extra ...interface{}) (string, error)
DescribeObject implements ObjectDescriber and will attempt to print the provided object to a string, if at least one describer function has been registered with the exact types passed, or if any describer can print the exact object in its first argument (the remainder will be provided empty values). If no function registered with Add can satisfy the passed objects, an ErrNoDescriber will be returned TODO: reorder and partial match extra.
type EndpointsDescriber ¶ added in v1.2.0
EndpointsDescriber generates information about an Endpoint.
func (*EndpointsDescriber) Describe ¶ added in v1.2.0
func (d *EndpointsDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type EnvVarResolverFunc ¶ added in v1.2.0
func EnvValueRetriever ¶ added in v1.2.0
func EnvValueRetriever(pod *api.Pod) EnvVarResolverFunc
EnvValueFrom is exported for use by describers in other packages
type ErrNoDescriber ¶ added in v0.13.1
type ErrNoDescriber struct {
Types []string
}
ErrNoDescriber is a structured error indicating the provided object or objects cannot be described.
func (ErrNoDescriber) Error ¶ added in v0.13.1
func (e ErrNoDescriber) Error() string
Error implements the error interface.
type FilterFunc ¶ added in v1.5.0
type FilterFunc func(runtime.Object, PrintOptions) bool
FilterFunc is a function that knows how to filter a specific resource kind. It receives a generic runtime.Object which must be type-checked by the function. Returns a boolean value true if a resource is filtered, or false otherwise.
type FilterServer ¶ added in v0.20.0
type FilterServer struct { // Only paths that match this regexp will be accepted AcceptPaths []*regexp.Regexp // Paths that match this regexp will be rejected, even if they match the above RejectPaths []*regexp.Regexp // Hosts are required to match this list of regexp AcceptHosts []*regexp.Regexp // Methods that match this regexp are rejected RejectMethods []*regexp.Regexp // contains filtered or unexported fields }
FilterServer rejects requests which don't match one of the specified regular expressions
func (*FilterServer) HandlerFor ¶ added in v0.20.0
func (f *FilterServer) HandlerFor(delegate http.Handler) *FilterServer
Make a copy of f which passes requests along to the new delegate.
func (*FilterServer) ServeHTTP ¶ added in v0.20.0
func (f *FilterServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type Filters ¶ added in v1.5.0
type Filters []FilterFunc
Filters is a collection of filter funcs
func NewResourceFilter ¶ added in v1.5.0
func NewResourceFilter() Filters
type Generator ¶ added in v0.9.0
type Generator interface { // Generate creates an API object given a set of parameters Generate(params map[string]interface{}) (runtime.Object, error) // ParamNames returns the list of parameters that this generator uses ParamNames() []GeneratorParam }
Generator is an interface for things that can generate API objects from input parameters.
type GeneratorParam ¶ added in v0.9.0
GeneratorParam is a parameter for a generator TODO: facilitate structured json generator input schemes
type HistoryViewer ¶ added in v1.2.0
type HistoryViewer interface {
ViewHistory(namespace, name string, revision int64) (string, error)
}
HistoryViewer provides an interface for resources have historical information.
func HistoryViewerFor ¶ added in v1.2.0
type HorizontalPodAutoscalerDescriber ¶ added in v1.1.0
type HorizontalPodAutoscalerDescriber struct {
// contains filtered or unexported fields
}
HorizontalPodAutoscalerDescriber generates information about a horizontal pod autoscaler.
func (*HorizontalPodAutoscalerDescriber) Describe ¶ added in v1.1.0
func (d *HorizontalPodAutoscalerDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type HorizontalPodAutoscalerV1 ¶ added in v1.3.0
type HorizontalPodAutoscalerV1 struct{}
func (HorizontalPodAutoscalerV1) Generate ¶ added in v1.3.0
func (HorizontalPodAutoscalerV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
func (HorizontalPodAutoscalerV1) ParamNames ¶ added in v1.3.0
func (HorizontalPodAutoscalerV1) ParamNames() []GeneratorParam
type HorizontalPodAutoscalerV1Beta1 ¶ added in v1.1.1
type HorizontalPodAutoscalerV1Beta1 struct{}
func (HorizontalPodAutoscalerV1Beta1) Generate ¶ added in v1.1.1
func (HorizontalPodAutoscalerV1Beta1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
func (HorizontalPodAutoscalerV1Beta1) ParamNames ¶ added in v1.1.1
func (HorizontalPodAutoscalerV1Beta1) ParamNames() []GeneratorParam
type HumanReadablePrinter ¶
type HumanReadablePrinter struct {
// contains filtered or unexported fields
}
HumanReadablePrinter is an implementation of ResourcePrinter which attempts to provide more elegant output. It is not threadsafe, but you may call PrintObj repeatedly; headers will only be printed if the object type changes. This makes it useful for printing items received from watches.
func NewHumanReadablePrinter ¶
func NewHumanReadablePrinter(options PrintOptions) *HumanReadablePrinter
NewHumanReadablePrinter creates a HumanReadablePrinter.
func (*HumanReadablePrinter) AfterPrint ¶ added in v1.5.0
func (h *HumanReadablePrinter) AfterPrint(output io.Writer, res string) error
func (*HumanReadablePrinter) EnsurePrintWithKind ¶ added in v1.4.0
func (h *HumanReadablePrinter) EnsurePrintWithKind(kind string)
EnsurePrintWithKind sets HumanReadablePrinter options "WithKind" to true and "Kind" to the string arg it receives, pre-pending this string to the "NAME" column in an output of resources.
func (*HumanReadablePrinter) GetResourceKind ¶ added in v1.4.0
func (h *HumanReadablePrinter) GetResourceKind() string
GetResourceKind returns the type currently set for a resource
func (*HumanReadablePrinter) HandledResources ¶ added in v0.16.0
func (h *HumanReadablePrinter) HandledResources() []string
func (*HumanReadablePrinter) Handler ¶
func (h *HumanReadablePrinter) Handler(columns, columnsWithWide []string, printFunc interface{}) error
Handler adds a print handler with a given set of columns to HumanReadablePrinter instance. See validatePrintHandlerFunc for required method signature.
type IngressDescriber ¶ added in v1.1.1
func (*IngressDescriber) Describe ¶ added in v1.1.1
func (i *IngressDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type JSONPathPrinter ¶ added in v1.1.0
JSONPathPrinter is an implementation of ResourcePrinter which formats data with jsonpath expression.
func NewJSONPathPrinter ¶ added in v1.1.0
func NewJSONPathPrinter(tmpl string) (*JSONPathPrinter, error)
func (*JSONPathPrinter) AfterPrint ¶ added in v1.5.0
func (j *JSONPathPrinter) AfterPrint(w io.Writer, res string) error
func (*JSONPathPrinter) HandledResources ¶ added in v1.1.0
func (p *JSONPathPrinter) HandledResources() []string
TODO: implement HandledResources()
type JSONPrinter ¶
type JSONPrinter struct { }
JSONPrinter is an implementation of ResourcePrinter which outputs an object as JSON.
func (*JSONPrinter) AfterPrint ¶ added in v1.5.0
func (p *JSONPrinter) AfterPrint(w io.Writer, res string) error
func (*JSONPrinter) HandledResources ¶ added in v1.1.0
func (p *JSONPrinter) HandledResources() []string
TODO: implement HandledResources()
type JobDescriber ¶ added in v1.1.0
JobDescriber generates information about a job and the pods it has created.
func (*JobDescriber) Describe ¶ added in v1.1.0
func (d *JobDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type JobReaper ¶ added in v1.1.0
type JobReaper struct {
// contains filtered or unexported fields
}
type JobScaler ¶ added in v1.1.0
type JobScaler struct {
// contains filtered or unexported fields
}
func (*JobScaler) Scale ¶ added in v1.1.0
func (scaler *JobScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error
Scale updates a Job to a new size, with optional precondition check (if preconditions is not nil), optional retries (if retry is not nil), and then optionally waits for parallelism to reach desired number, which can be less than requested based on job's current progress.
func (*JobScaler) ScaleSimple ¶ added in v1.1.0
func (scaler *JobScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) (string, error)
ScaleSimple is responsible for updating job's parallelism. It returns the resourceVersion of the job if the update is successful.
type JobV1 ¶ added in v1.2.0
type JobV1 struct{}
func (JobV1) ParamNames ¶ added in v1.2.0
func (JobV1) ParamNames() []GeneratorParam
type LimitRangeDescriber ¶ added in v0.10.0
LimitRangeDescriber generates information about a limit range
func (*LimitRangeDescriber) Describe ¶ added in v0.10.0
func (d *LimitRangeDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type NamePrinter ¶ added in v1.1.0
type NamePrinter struct { Decoder runtime.Decoder Typer runtime.ObjectTyper }
NamePrinter is an implementation of ResourcePrinter which outputs "resource/name" pair of an object.
func (*NamePrinter) AfterPrint ¶ added in v1.5.0
func (p *NamePrinter) AfterPrint(w io.Writer, res string) error
func (*NamePrinter) HandledResources ¶ added in v1.1.0
func (p *NamePrinter) HandledResources() []string
TODO: implement HandledResources()
type NamespaceDescriber ¶ added in v0.20.0
NamespaceDescriber generates information about a namespace
func (*NamespaceDescriber) Describe ¶ added in v0.20.0
func (d *NamespaceDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type NamespaceGeneratorV1 ¶ added in v1.2.0
type NamespaceGeneratorV1 struct { // Name of namespace Name string }
NamespaceGeneratorV1 supports stable generation of a namespace
func (NamespaceGeneratorV1) Generate ¶ added in v1.2.0
func (g NamespaceGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
Generate returns a namespace using the specified parameters
func (NamespaceGeneratorV1) ParamNames ¶ added in v1.2.0
func (g NamespaceGeneratorV1) ParamNames() []GeneratorParam
ParamNames returns the set of supported input parameters when using the parameter injection generator pattern
func (*NamespaceGeneratorV1) StructuredGenerate ¶ added in v1.2.0
func (g *NamespaceGeneratorV1) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a namespace object using the configured fields
type NamespaceInfo ¶
type NamespaceInfo struct {
Namespace string
}
type NetworkPolicyDescriber ¶ added in v1.3.0
NetworkPolicyDescriber generates information about a NetworkPolicy
func (*NetworkPolicyDescriber) Describe ¶ added in v1.3.0
func (d *NetworkPolicyDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type NewControllerConfig ¶ added in v1.2.5
type NoSuchReaperError ¶ added in v0.16.0
type NoSuchReaperError struct {
// contains filtered or unexported fields
}
func (*NoSuchReaperError) Error ¶ added in v0.16.0
func (n *NoSuchReaperError) Error() string
type NodeDescriber ¶ added in v0.13.0
NodeDescriber generates information about a node.
func (*NodeDescriber) Describe ¶ added in v0.13.0
func (d *NodeDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ObjectDescriber ¶ added in v0.13.1
type ObjectDescriber interface {
DescribeObject(object interface{}, extra ...interface{}) (output string, err error)
}
ObjectDescriber is an interface for displaying arbitrary objects with extra information. Use when an object is in hand (on disk, or already retrieved). Implementers may ignore the additional information passed on extra, or use it by default. ObjectDescribers may return ErrNoDescriber if no suitable describer is found.
var DefaultObjectDescriber ObjectDescriber
DefaultObjectDescriber can describe the default Kubernetes objects.
type OutputVersionMapper ¶ added in v0.9.0
type OutputVersionMapper struct { meta.RESTMapper // output versions takes a list of preferred GroupVersions. Only the first // hit for a given group will have effect. This allows different output versions // depending upon the group of the kind being requested OutputVersions []schema.GroupVersion }
OutputVersionMapper is a RESTMapper that will prefer mappings that correspond to a preferred output version (if feasible)
func (OutputVersionMapper) RESTMapping ¶ added in v0.9.0
func (m OutputVersionMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
RESTMapping implements meta.RESTMapper by prepending the output version to the preferred version list.
type PersistentVolumeClaimDescriber ¶ added in v0.15.0
func (*PersistentVolumeClaimDescriber) Describe ¶ added in v0.15.0
func (d *PersistentVolumeClaimDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type PersistentVolumeDescriber ¶ added in v0.15.0
func (*PersistentVolumeDescriber) Describe ¶ added in v0.15.0
func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type PodDescriber ¶
PodDescriber generates information about a pod and the replication controllers that create it.
func (*PodDescriber) Describe ¶
func (d *PodDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type PodDisruptionBudgetDescriber ¶ added in v1.5.0
func (*PodDisruptionBudgetDescriber) Describe ¶ added in v1.5.0
func (p *PodDisruptionBudgetDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type PodDisruptionBudgetV1Generator ¶ added in v1.6.0
PodDisruptionBudgetV1Generator supports stable generation of a pod disruption budget.
func (PodDisruptionBudgetV1Generator) Generate ¶ added in v1.6.0
func (s PodDisruptionBudgetV1Generator) Generate(params map[string]interface{}) (runtime.Object, error)
func (PodDisruptionBudgetV1Generator) ParamNames ¶ added in v1.6.0
func (PodDisruptionBudgetV1Generator) ParamNames() []GeneratorParam
func (*PodDisruptionBudgetV1Generator) StructuredGenerate ¶ added in v1.6.0
func (s *PodDisruptionBudgetV1Generator) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a pod disruption budget object using the configured fields.
type PodReaper ¶ added in v0.9.1
type PodReaper struct {
// contains filtered or unexported fields
}
type PreconditionError ¶ added in v0.9.0
A PreconditionError is returned when a resource fails to match the scale preconditions passed to kubectl.
func (PreconditionError) Error ¶ added in v0.9.0
func (pe PreconditionError) Error() string
type PrefixWriter ¶
type PrefixWriter struct {
// contains filtered or unexported fields
}
func (*PrefixWriter) Write ¶
func (pw *PrefixWriter) Write(level int, format string, a ...interface{})
func (*PrefixWriter) WriteLine ¶
func (pw *PrefixWriter) WriteLine(a ...interface{})
type PrintOptions ¶ added in v1.2.0
type ProxyServer ¶
type ProxyServer struct {
// contains filtered or unexported fields
}
ProxyServer is a http.Handler which proxies Kubernetes APIs to remote API server.
func NewProxyServer ¶
func NewProxyServer(filebase string, apiProxyPrefix string, staticPrefix string, filter *FilterServer, cfg *restclient.Config) (*ProxyServer, error)
NewProxyServer creates and installs a new ProxyServer. It automatically registers the created ProxyServer to http.DefaultServeMux. 'filter', if non-nil, protects requests to the api only.
func (*ProxyServer) ListenUnix ¶ added in v1.1.0
func (s *ProxyServer) ListenUnix(path string) (net.Listener, error)
ListenUnix does net.Listen for a unix socket
func (*ProxyServer) ServeOnListener ¶ added in v1.1.0
func (s *ProxyServer) ServeOnListener(l net.Listener) error
Serve starts the server using given listener, loops forever.
type RESTClient ¶
type RESTClient interface { Get() *client.Request Post() *client.Request Patch(types.PatchType) *client.Request Delete() *client.Request Put() *client.Request }
RESTClient is a client helper for dealing with RESTful resources in a generic way.
type Reaper ¶ added in v0.9.1
type Reaper interface {
Stop(namespace, name string, timeout time.Duration, gracePeriod *metav1.DeleteOptions) error
}
A Reaper handles terminating an object as gracefully as possible. timeout is how long we'll wait for the termination to be successful gracePeriod is time given to an API object for it to delete itself cleanly, e.g., pod shutdown. It may or may not be supported by the API object.
func ReaperForReplicationController ¶ added in v0.18.0
func ReaperForReplicationController(rcClient coreclient.ReplicationControllersGetter, timeout time.Duration) (Reaper, error)
type ReplicaSetDescriber ¶ added in v1.2.0
ReplicaSetDescriber generates information about a ReplicaSet and the pods it has created.
func (*ReplicaSetDescriber) Describe ¶ added in v1.2.0
func (d *ReplicaSetDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ReplicaSetReaper ¶ added in v1.2.0
type ReplicaSetReaper struct {
// contains filtered or unexported fields
}
func (*ReplicaSetReaper) Stop ¶ added in v1.2.0
func (reaper *ReplicaSetReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *metav1.DeleteOptions) error
type ReplicaSetScaler ¶ added in v1.2.0
type ReplicaSetScaler struct {
// contains filtered or unexported fields
}
func (*ReplicaSetScaler) Scale ¶ added in v1.2.0
func (scaler *ReplicaSetScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error
Scale updates a ReplicaSet to a new size, with optional precondition check (if preconditions is not nil), optional retries (if retry is not nil), and then optionally waits for it's replica count to reach the new value (if wait is not nil).
func (*ReplicaSetScaler) ScaleSimple ¶ added in v1.2.0
func (scaler *ReplicaSetScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) (string, error)
ScaleSimple does a simple one-shot attempt at scaling. It returns the resourceVersion of the replicaset if the update is successful.
type ReplicationControllerDescriber ¶
ReplicationControllerDescriber generates information about a replication controller and the pods it has created.
func (*ReplicationControllerDescriber) Describe ¶
func (d *ReplicationControllerDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ReplicationControllerReaper ¶ added in v0.9.1
type ReplicationControllerReaper struct {
// contains filtered or unexported fields
}
func (*ReplicationControllerReaper) Stop ¶ added in v0.9.1
func (reaper *ReplicationControllerReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *metav1.DeleteOptions) error
type ReplicationControllerScaler ¶ added in v0.18.0
type ReplicationControllerScaler struct {
// contains filtered or unexported fields
}
func (*ReplicationControllerScaler) Scale ¶ added in v0.18.0
func (scaler *ReplicationControllerScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error
Scale updates a ReplicationController to a new size, with optional precondition check (if preconditions is not nil), optional retries (if retry is not nil), and then optionally waits for it's replica count to reach the new value (if wait is not nil).
func (*ReplicationControllerScaler) ScaleSimple ¶ added in v0.18.0
func (scaler *ReplicationControllerScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) (string, error)
ScaleSimple does a simple one-shot attempt at scaling. It returns the resourceVersion of the replication controller if the update is successful.
type ResourcePrinter ¶
type ResourcePrinter interface { // Print receives a runtime object, formats it and prints it to a writer. PrintObj(runtime.Object, io.Writer) error HandledResources() []string //Can be used to print out warning/clarifications if needed //after all objects were printed AfterPrint(io.Writer, string) error }
ResourcePrinter is an interface that knows how to print runtime objects.
func GetPrinter ¶
func GetPrinter(format, formatArgument string, noHeaders, allowMissingTemplateKeys bool) (ResourcePrinter, bool, error)
GetPrinter takes a format type, an optional format argument. It will return true if the format is generic (untyped), otherwise it will return false. The printer is agnostic to schema versions, so you must send arguments to PrintObj in the version you wish them to be shown using a VersionedPrinter (typically when generic is true).
func NewVersionedPrinter ¶ added in v0.9.0
func NewVersionedPrinter(printer ResourcePrinter, converter runtime.ObjectConvertor, versions ...schema.GroupVersion) ResourcePrinter
NewVersionedPrinter wraps a printer to convert objects to a known API version prior to printing.
type ResourcePrinterFunc ¶ added in v0.9.0
ResourcePrinterFunc is a function that can print objects
func (ResourcePrinterFunc) AfterPrint ¶ added in v1.5.0
func (fn ResourcePrinterFunc) AfterPrint(io.Writer, string) error
func (ResourcePrinterFunc) HandledResources ¶ added in v1.1.0
func (fn ResourcePrinterFunc) HandledResources() []string
TODO: implement HandledResources()
type ResourceQuotaDescriber ¶ added in v0.10.0
ResourceQuotaDescriber generates information about a resource quota
func (*ResourceQuotaDescriber) Describe ¶ added in v0.10.0
func (d *ResourceQuotaDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ResourceQuotaGeneratorV1 ¶ added in v1.4.0
type ResourceQuotaGeneratorV1 struct { // The name of a quota object. Name string // The hard resource limit string before parsing. Hard string // The scopes of a quota object before parsing. Scopes string }
ResourceQuotaGeneratorV1 supports stable generation of a resource quota
func (ResourceQuotaGeneratorV1) Generate ¶ added in v1.4.0
func (g ResourceQuotaGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
func (ResourceQuotaGeneratorV1) ParamNames ¶ added in v1.4.0
func (g ResourceQuotaGeneratorV1) ParamNames() []GeneratorParam
ParamNames returns the set of supported input parameters when using the parameter injection generator pattern
func (*ResourceQuotaGeneratorV1) StructuredGenerate ¶ added in v1.4.0
func (g *ResourceQuotaGeneratorV1) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a ResourceQuota object using the configured fields
type ResourceShortcuts ¶ added in v1.6.0
type ResourceShortcuts struct { ShortForm schema.GroupResource LongForm schema.GroupResource }
ResourceShortcuts represents a structure that holds the information how to transition from resource's shortcut to its full name.
type RetryParams ¶ added in v0.15.0
RetryParams encapsulates the retry parameters used by kubectl's scaler.
func NewRetryParams ¶ added in v0.18.0
func NewRetryParams(interval, timeout time.Duration) *RetryParams
type RoleBindingGeneratorV1 ¶ added in v1.6.0
type RoleBindingGeneratorV1 struct { // Name of roleBinding (required) Name string // ClusterRole for the roleBinding ClusterRole string // Role for the roleBinding Role string // Users to derive the roleBinding from (optional) Users []string // Groups to derive the roleBinding from (optional) Groups []string // ServiceAccounts to derive the roleBinding from in namespace:name format(optional) ServiceAccounts []string }
RoleBindingGeneratorV1 supports stable generation of a roleBinding.
func (RoleBindingGeneratorV1) Generate ¶ added in v1.6.0
func (s RoleBindingGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
Generate returns a roleBinding using the specified parameters.
func (RoleBindingGeneratorV1) ParamNames ¶ added in v1.6.0
func (s RoleBindingGeneratorV1) ParamNames() []GeneratorParam
ParamNames returns the set of supported input parameters when using the parameter injection generator pattern.
func (RoleBindingGeneratorV1) StructuredGenerate ¶ added in v1.6.0
func (s RoleBindingGeneratorV1) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a roleBinding object using the configured fields.
type Rollbacker ¶ added in v1.2.0
type Rollbacker interface {
Rollback(obj runtime.Object, updatedAnnotations map[string]string, toRevision int64, dryRun bool) (string, error)
}
Rollbacker provides an interface for resources that can be rolled back.
func RollbackerFor ¶ added in v1.2.0
type RollingUpdater ¶ added in v0.9.0
type RollingUpdater struct {
// contains filtered or unexported fields
}
RollingUpdater provides methods for updating replicated pods in a predictable, fault-tolerant way.
func NewRollingUpdater ¶ added in v0.9.0
func NewRollingUpdater(namespace string, rcClient coreclient.ReplicationControllersGetter, podClient coreclient.PodsGetter) *RollingUpdater
NewRollingUpdater creates a RollingUpdater from a client.
func (*RollingUpdater) Update ¶ added in v0.9.0
func (r *RollingUpdater) Update(config *RollingUpdaterConfig) error
Update all pods for a ReplicationController (oldRc) by creating a new controller (newRc) with 0 replicas, and synchronously scaling oldRc and newRc until oldRc has 0 replicas and newRc has the original # of desired replicas. Cleanup occurs based on a RollingUpdaterCleanupPolicy.
Each interval, the updater will attempt to make progress however it can without violating any availability constraints defined by the config. This means the amount scaled up or down each interval will vary based on the timeliness of readiness and the updater will always try to make progress, even slowly.
If an update from newRc to oldRc is already in progress, we attempt to drive it to completion. If an error occurs at any step of the update, the error will be returned.
A scaling event (either up or down) is considered progress; if no progress is made within the config.Timeout, an error is returned.
TODO: make this handle performing a rollback of a partially completed rollout.
type RollingUpdaterCleanupPolicy ¶ added in v0.16.0
type RollingUpdaterCleanupPolicy string
RollingUpdaterCleanupPolicy is a cleanup action to take after the deployment is complete.
const ( // DeleteRollingUpdateCleanupPolicy means delete the old controller. DeleteRollingUpdateCleanupPolicy RollingUpdaterCleanupPolicy = "Delete" // PreserveRollingUpdateCleanupPolicy means keep the old controller. PreserveRollingUpdateCleanupPolicy RollingUpdaterCleanupPolicy = "Preserve" // RenameRollingUpdateCleanupPolicy means delete the old controller, and rename // the new controller to the name of the old controller. RenameRollingUpdateCleanupPolicy RollingUpdaterCleanupPolicy = "Rename" )
type RollingUpdaterConfig ¶ added in v0.16.0
type RollingUpdaterConfig struct { // Out is a writer for progress output. Out io.Writer // OldRC is an existing controller to be replaced. OldRc *api.ReplicationController // NewRc is a controller that will take ownership of updated pods (will be // created if needed). NewRc *api.ReplicationController // UpdatePeriod is the time to wait between individual pod updates. UpdatePeriod time.Duration // Interval is the time to wait between polling controller status after // update. Interval time.Duration // Timeout is the time to wait for controller updates before giving up. Timeout time.Duration // MinReadySeconds is the number of seconds to wait after the pods are ready MinReadySeconds int32 // CleanupPolicy defines the cleanup action to take after the deployment is // complete. CleanupPolicy RollingUpdaterCleanupPolicy // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). // Absolute number is calculated from percentage by rounding up. // This can not be 0 if MaxSurge is 0. // By default, a fixed value of 1 is used. // Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods // immediately when the rolling update starts. Once new pods are ready, old RC // can be scaled down further, followed by scaling up the new RC, ensuring // that the total number of pods available at all times during the update is at // least 70% of desired pods. MaxUnavailable intstr.IntOrString // MaxSurge is the maximum number of pods that can be scheduled above the desired number of pods. // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). // This can not be 0 if MaxUnavailable is 0. // Absolute number is calculated from percentage by rounding up. // By default, a value of 1 is used. // Example: when this is set to 30%, the new RC can be scaled up immediately // when the rolling update starts, such that the total number of old and new pods do not exceed // 130% of desired pods. Once old pods have been killed, new RC can be scaled up // further, ensuring that total number of pods running at any time during // the update is atmost 130% of desired pods. MaxSurge intstr.IntOrString // OnProgress is invoked if set during each scale cycle, to allow the caller to perform additional logic or // abort the scale. If an error is returned the cleanup method will not be invoked. The percentage value // is a synthetic "progress" calculation that represents the approximate percentage completion. OnProgress func(oldRc, newRc *api.ReplicationController, percentage int) error }
RollingUpdaterConfig is the configuration for a rolling deployment process.
type RuntimeSort ¶ added in v1.1.0
type RuntimeSort struct {
// contains filtered or unexported fields
}
RuntimeSort is an implementation of the golang sort interface that knows how to sort lists of runtime.Object
func NewRuntimeSort ¶ added in v1.2.0
func NewRuntimeSort(field string, objs []runtime.Object) *RuntimeSort
func SortObjects ¶ added in v1.2.0
func (*RuntimeSort) Len ¶ added in v1.1.0
func (r *RuntimeSort) Len() int
func (*RuntimeSort) Less ¶ added in v1.1.0
func (r *RuntimeSort) Less(i, j int) bool
func (*RuntimeSort) OriginalPosition ¶ added in v1.2.0
func (r *RuntimeSort) OriginalPosition(ix int) int
Returns the starting (original) position of a particular index. e.g. If OriginalPosition(0) returns 5 than the the item currently at position 0 was at position 5 in the original unsorted array.
func (*RuntimeSort) Swap ¶ added in v1.1.0
func (r *RuntimeSort) Swap(i, j int)
type ScaleError ¶ added in v1.2.0
type ScaleError struct { FailureType ScaleErrorType ResourceVersion string ActualError error }
A ScaleError is returned when a scale request passes preconditions but fails to actually scale the controller.
func (ScaleError) Error ¶ added in v1.2.0
func (c ScaleError) Error() string
type ScaleErrorType ¶ added in v1.2.0
type ScaleErrorType int
const ( ScaleGetFailure ScaleErrorType = iota ScaleUpdateFailure ScaleUpdateConflictFailure )
type ScalePrecondition ¶ added in v0.18.0
ScalePrecondition describes a condition that must be true for the scale to take place If CurrentSize == -1, it is ignored. If CurrentResourceVersion is the empty string, it is ignored. Otherwise they must equal the values in the resource for it to be valid.
func (*ScalePrecondition) ValidateDeployment ¶ added in v1.2.0
func (precondition *ScalePrecondition) ValidateDeployment(deployment *extensions.Deployment) error
ValidateDeployment ensures that the preconditions match. Returns nil if they are valid, an error otherwise.
func (*ScalePrecondition) ValidateJob ¶ added in v1.1.0
func (precondition *ScalePrecondition) ValidateJob(job *batch.Job) error
ValidateJob ensures that the preconditions match. Returns nil if they are valid, an error otherwise.
func (*ScalePrecondition) ValidateReplicaSet ¶ added in v1.2.0
func (precondition *ScalePrecondition) ValidateReplicaSet(replicaSet *extensions.ReplicaSet) error
ValidateReplicaSet ensures that the preconditions match. Returns nil if they are valid, an error otherwise
func (*ScalePrecondition) ValidateReplicationController ¶ added in v1.1.0
func (precondition *ScalePrecondition) ValidateReplicationController(controller *api.ReplicationController) error
ValidateReplicationController ensures that the preconditions match. Returns nil if they are valid, an error otherwise
func (*ScalePrecondition) ValidateStatefulSet ¶ added in v1.5.0
func (precondition *ScalePrecondition) ValidateStatefulSet(ps *apps.StatefulSet) error
ValidateStatefulSet ensures that the preconditions match. Returns nil if they are valid, an error otherwise.
type Scaler ¶ added in v0.18.0
type Scaler interface { // Scale scales the named resource after checking preconditions. It optionally // retries in the event of resource version mismatch (if retry is not nil), // and optionally waits until the status of the resource matches newSize (if wait is not nil) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, wait *RetryParams) error // ScaleSimple does a simple one-shot attempt at scaling - not useful on its own, but // a necessary building block for Scale ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) (updatedResourceVersion string, err error) }
Scaler provides an interface for resources that can be scaled.
type SecretDescriber ¶ added in v0.18.0
SecretDescriber generates information about a secret
func (*SecretDescriber) Describe ¶ added in v0.18.0
func (d *SecretDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type SecretForDockerRegistryGeneratorV1 ¶ added in v1.2.0
type SecretForDockerRegistryGeneratorV1 struct { // Name of secret (required) Name string // Username for registry (required) Username string // Email for registry (required) Email string // Password for registry (required) Password string // Server for registry (required) Server string }
SecretForDockerRegistryGeneratorV1 supports stable generation of a docker registry secret
func (SecretForDockerRegistryGeneratorV1) Generate ¶ added in v1.2.0
func (s SecretForDockerRegistryGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
Generate returns a secret using the specified parameters
func (SecretForDockerRegistryGeneratorV1) ParamNames ¶ added in v1.2.0
func (s SecretForDockerRegistryGeneratorV1) ParamNames() []GeneratorParam
ParamNames returns the set of supported input parameters when using the parameter injection generator pattern
func (SecretForDockerRegistryGeneratorV1) StructuredGenerate ¶ added in v1.2.0
func (s SecretForDockerRegistryGeneratorV1) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a secret object using the configured fields
type SecretForTLSGeneratorV1 ¶ added in v1.3.0
type SecretForTLSGeneratorV1 struct { // Name is the name of this TLS secret. Name string // Key is the path to the user's private key. Key string // Cert is the path to the user's public key certificate. Cert string }
SecretForTLSGeneratorV1 supports stable generation of a TLS secret.
func (SecretForTLSGeneratorV1) Generate ¶ added in v1.3.0
func (s SecretForTLSGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
Generate returns a secret using the specified parameters
func (SecretForTLSGeneratorV1) ParamNames ¶ added in v1.3.0
func (s SecretForTLSGeneratorV1) ParamNames() []GeneratorParam
ParamNames returns the set of supported input parameters when using the parameter injection generator pattern
func (SecretForTLSGeneratorV1) StructuredGenerate ¶ added in v1.3.0
func (s SecretForTLSGeneratorV1) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a secret object using the configured fields
type SecretGeneratorV1 ¶ added in v1.2.0
type SecretGeneratorV1 struct { // Name of secret (required) Name string // Type of secret (optional) Type string // FileSources to derive the secret from (optional) FileSources []string // LiteralSources to derive the secret from (optional) LiteralSources []string }
SecretGeneratorV1 supports stable generation of an opaque secret
func (SecretGeneratorV1) Generate ¶ added in v1.2.0
func (s SecretGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error)
Generate returns a secret using the specified parameters
func (SecretGeneratorV1) ParamNames ¶ added in v1.2.0
func (s SecretGeneratorV1) ParamNames() []GeneratorParam
ParamNames returns the set of supported input parameters when using the parameter injection generator pattern
func (SecretGeneratorV1) StructuredGenerate ¶ added in v1.2.0
func (s SecretGeneratorV1) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a secret object using the configured fields
type ServiceAccountDescriber ¶ added in v0.18.0
ServiceAccountDescriber generates information about a service.
func (*ServiceAccountDescriber) Describe ¶ added in v0.18.0
func (d *ServiceAccountDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ServiceAccountGeneratorV1 ¶ added in v1.2.0
type ServiceAccountGeneratorV1 struct { // Name of service account Name string }
ServiceAccountGeneratorV1 supports stable generation of a service account
func (*ServiceAccountGeneratorV1) StructuredGenerate ¶ added in v1.2.0
func (g *ServiceAccountGeneratorV1) StructuredGenerate() (runtime.Object, error)
StructuredGenerate outputs a service account object using the configured fields
type ServiceClusterIPGeneratorV1 ¶ added in v1.4.0
type ServiceClusterIPGeneratorV1 struct {
ServiceCommonGeneratorV1
}
func (ServiceClusterIPGeneratorV1) Generate ¶ added in v1.4.0
func (s ServiceClusterIPGeneratorV1) Generate(params map[string]interface{}) (runtime.Object, error)
func (ServiceClusterIPGeneratorV1) ParamNames ¶ added in v1.4.0
func (ServiceClusterIPGeneratorV1) ParamNames() []GeneratorParam
type ServiceCommonGeneratorV1 ¶ added in v1.4.0
type ServiceCommonGeneratorV1 struct { Name string TCP []string Type api.ServiceType ClusterIP string NodePort int ExternalName string }
func (ServiceCommonGeneratorV1) GenerateCommon ¶ added in v1.4.0
func (s ServiceCommonGeneratorV1) GenerateCommon(params map[string]interface{}) error
func (ServiceCommonGeneratorV1) StructuredGenerate ¶ added in v1.4.0
func (s ServiceCommonGeneratorV1) StructuredGenerate() (runtime.Object, error)
type ServiceDescriber ¶
ServiceDescriber generates information about a service.
func (*ServiceDescriber) Describe ¶
func (d *ServiceDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ServiceExternalNameGeneratorV1 ¶ added in v1.6.0
type ServiceExternalNameGeneratorV1 struct {
ServiceCommonGeneratorV1
}
TODO: is this really necessary?
func (ServiceExternalNameGeneratorV1) Generate ¶ added in v1.6.0
func (s ServiceExternalNameGeneratorV1) Generate(params map[string]interface{}) (runtime.Object, error)
func (ServiceExternalNameGeneratorV1) ParamNames ¶ added in v1.6.0
func (ServiceExternalNameGeneratorV1) ParamNames() []GeneratorParam
type ServiceGeneratorV1 ¶ added in v1.0.1
type ServiceGeneratorV1 struct{}
The only difference between ServiceGeneratorV1 and V2 is that the service port is named "default" in V1, while it is left unnamed in V2.
func (ServiceGeneratorV1) Generate ¶ added in v1.0.1
func (ServiceGeneratorV1) Generate(params map[string]interface{}) (runtime.Object, error)
func (ServiceGeneratorV1) ParamNames ¶ added in v1.0.1
func (ServiceGeneratorV1) ParamNames() []GeneratorParam
type ServiceGeneratorV2 ¶ added in v1.0.1
type ServiceGeneratorV2 struct{}
func (ServiceGeneratorV2) Generate ¶ added in v1.0.1
func (ServiceGeneratorV2) Generate(params map[string]interface{}) (runtime.Object, error)
func (ServiceGeneratorV2) ParamNames ¶ added in v1.0.1
func (ServiceGeneratorV2) ParamNames() []GeneratorParam
type ServiceLoadBalancerGeneratorV1 ¶ added in v1.4.0
type ServiceLoadBalancerGeneratorV1 struct {
ServiceCommonGeneratorV1
}
func (ServiceLoadBalancerGeneratorV1) Generate ¶ added in v1.4.0
func (s ServiceLoadBalancerGeneratorV1) Generate(params map[string]interface{}) (runtime.Object, error)
func (ServiceLoadBalancerGeneratorV1) ParamNames ¶ added in v1.4.0
func (ServiceLoadBalancerGeneratorV1) ParamNames() []GeneratorParam
type ServiceNodePortGeneratorV1 ¶ added in v1.4.0
type ServiceNodePortGeneratorV1 struct {
ServiceCommonGeneratorV1
}
func (ServiceNodePortGeneratorV1) Generate ¶ added in v1.4.0
func (s ServiceNodePortGeneratorV1) Generate(params map[string]interface{}) (runtime.Object, error)
func (ServiceNodePortGeneratorV1) ParamNames ¶ added in v1.4.0
func (ServiceNodePortGeneratorV1) ParamNames() []GeneratorParam
type ServiceReaper ¶ added in v0.9.1
type ServiceReaper struct {
// contains filtered or unexported fields
}
func (*ServiceReaper) Stop ¶ added in v0.9.1
func (reaper *ServiceReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *metav1.DeleteOptions) error
type SortableResourceNames ¶ added in v0.10.0
type SortableResourceNames []api.ResourceName
func (SortableResourceNames) Len ¶ added in v0.10.0
func (list SortableResourceNames) Len() int
func (SortableResourceNames) Less ¶ added in v0.10.0
func (list SortableResourceNames) Less(i, j int) bool
func (SortableResourceNames) Swap ¶ added in v0.10.0
func (list SortableResourceNames) Swap(i, j int)
type SortableResourceQuotas ¶ added in v1.2.0
type SortableResourceQuotas []api.ResourceQuota
func (SortableResourceQuotas) Len ¶ added in v1.2.0
func (list SortableResourceQuotas) Len() int
func (SortableResourceQuotas) Less ¶ added in v1.2.0
func (list SortableResourceQuotas) Less(i, j int) bool
func (SortableResourceQuotas) Swap ¶ added in v1.2.0
func (list SortableResourceQuotas) Swap(i, j int)
type SortableVolumeMounts ¶ added in v1.4.0
type SortableVolumeMounts []api.VolumeMount
func (SortableVolumeMounts) Len ¶ added in v1.4.0
func (list SortableVolumeMounts) Len() int
func (SortableVolumeMounts) Less ¶ added in v1.4.0
func (list SortableVolumeMounts) Less(i, j int) bool
func (SortableVolumeMounts) Swap ¶ added in v1.4.0
func (list SortableVolumeMounts) Swap(i, j int)
type SortingPrinter ¶ added in v1.1.0
type SortingPrinter struct { SortField string Delegate ResourcePrinter Decoder runtime.Decoder }
Sorting printer sorts list types before delegating to another printer. Non-list types are simply passed through
func (*SortingPrinter) AfterPrint ¶ added in v1.5.0
func (s *SortingPrinter) AfterPrint(w io.Writer, res string) error
func (*SortingPrinter) HandledResources ¶ added in v1.1.0
func (p *SortingPrinter) HandledResources() []string
TODO: implement HandledResources()
type StatefulSetDescriber ¶ added in v1.5.0
type StatefulSetDescriber struct {
// contains filtered or unexported fields
}
func (*StatefulSetDescriber) Describe ¶ added in v1.5.0
func (p *StatefulSetDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type StatefulSetReaper ¶ added in v1.5.0
type StatefulSetReaper struct {
// contains filtered or unexported fields
}
func (*StatefulSetReaper) Stop ¶ added in v1.5.0
func (reaper *StatefulSetReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *metav1.DeleteOptions) error
type StatefulSetScaler ¶ added in v1.5.0
type StatefulSetScaler struct {
// contains filtered or unexported fields
}
func (*StatefulSetScaler) Scale ¶ added in v1.5.0
func (scaler *StatefulSetScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error
func (*StatefulSetScaler) ScaleSimple ¶ added in v1.5.0
func (scaler *StatefulSetScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) (string, error)
ScaleSimple does a simple one-shot attempt at scaling. It returns the resourceVersion of the statefulset if the update is successful.
type StatusViewer ¶ added in v1.3.0
type StatusViewer interface {
Status(namespace, name string, revision int64) (string, bool, error)
}
StatusViewer provides an interface for resources that have rollout status.
func StatusViewerFor ¶ added in v1.3.0
func StatusViewerFor(kind schema.GroupKind, c internalclientset.Interface) (StatusViewer, error)
type StorageClassDescriber ¶ added in v1.5.0
func (*StorageClassDescriber) Describe ¶ added in v1.5.0
func (s *StorageClassDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type StructuredGenerator ¶ added in v1.2.0
type StructuredGenerator interface { // StructuredGenerator creates an API object using pre-configured parameters StructuredGenerate() (runtime.Object, error) }
StructuredGenerator is an interface for things that can generate API objects not using parameter injection
type TemplatePrinter ¶
type TemplatePrinter struct {
// contains filtered or unexported fields
}
TemplatePrinter is an implementation of ResourcePrinter which formats data with a Go Template.
func NewTemplatePrinter ¶
func NewTemplatePrinter(tmpl []byte) (*TemplatePrinter, error)
func (*TemplatePrinter) AfterPrint ¶ added in v1.5.0
func (p *TemplatePrinter) AfterPrint(w io.Writer, res string) error
func (*TemplatePrinter) AllowMissingKeys ¶ added in v1.5.3
func (p *TemplatePrinter) AllowMissingKeys(allow bool)
AllowMissingKeys tells the template engine if missing keys are allowed.
func (*TemplatePrinter) HandledResources ¶ added in v1.1.0
func (p *TemplatePrinter) HandledResources() []string
TODO: implement HandledResources()
type VersionedPrinter ¶ added in v0.9.0
type VersionedPrinter struct {
// contains filtered or unexported fields
}
VersionedPrinter takes runtime objects and ensures they are converted to a given API version prior to being passed to a nested printer.
func (*VersionedPrinter) AfterPrint ¶ added in v1.5.0
func (p *VersionedPrinter) AfterPrint(w io.Writer, res string) error
func (*VersionedPrinter) HandledResources ¶ added in v1.1.0
func (p *VersionedPrinter) HandledResources() []string
TODO: implement HandledResources()
type YAMLPrinter ¶
type YAMLPrinter struct {
// contains filtered or unexported fields
}
YAMLPrinter is an implementation of ResourcePrinter which outputs an object as YAML. The input object is assumed to be in the internal version of an API and is converted to the given version first.
func (*YAMLPrinter) AfterPrint ¶ added in v1.5.0
func (p *YAMLPrinter) AfterPrint(w io.Writer, res string) error
func (*YAMLPrinter) HandledResources ¶ added in v1.1.0
func (p *YAMLPrinter) HandledResources() []string
TODO: implement HandledResources()
Source Files ¶
- apply.go
- autoscale.go
- bash_comp_utils.go
- cluster.go
- clusterrolebinding.go
- configmap.go
- custom_column_printer.go
- deployment.go
- describe.go
- doc.go
- explain.go
- generate.go
- history.go
- interfaces.go
- kubectl.go
- namespace.go
- pdb.go
- proxy_server.go
- quota.go
- resource_filter.go
- resource_printer.go
- rolebinding.go
- rollback.go
- rolling_updater.go
- rollout_status.go
- run.go
- scale.go
- secret.go
- secret_for_docker_registry.go
- secret_for_tls.go
- service.go
- service_basic.go
- serviceaccount.go
- sorted_resource_name_list.go
- sorting_printer.go
- stop.go
- versioned_client.go
Directories ¶
Path | Synopsis |
---|---|
Package resource assists clients in dealing with RESTful objects that match the Kubernetes API conventions.
|
Package resource assists clients in dealing with RESTful objects that match the Kubernetes API conventions. |