Documentation
¶
Overview ¶
Package api contains the latest (or "internal") version of the Kubernetes API objects. This is the API objects as represented in memory. The contract presented to clients is located in the versioned packages, which are sub-directories. The first one is "v1beta1". Those packages describe how a particular version is serialized to storage/network.
Index ¶
- Constants
- Variables
- func AddToNodeAddresses(addresses *[]NodeAddress, addAddresses ...NodeAddress)
- func FieldSelectorQueryParam(version string) string
- func FillObjectMetaSystemFields(ctx Context, meta *ObjectMeta)
- func GenerateName(u NameGenerator, meta *ObjectMeta)
- func HasObjectMetaSystemFieldValues(meta *ObjectMeta) bool
- func HashObject(obj runtime.Object, codec runtime.Codec) (string, error)
- func IsEmpty(requestsToContexts RequestContextMapper) (bool, error)
- func IsPodReady(pod *Pod) bool
- func IsServiceIPRequested(service *Service) bool
- func IsServiceIPSet(service *Service) bool
- func IsStandardFinalizerName(str string) bool
- func IsStandardResourceName(str string) bool
- func LabelSelectorQueryParam(version string) string
- func LoadBalancerStatusEqual(l, r *LoadBalancerStatus) bool
- func NamespaceFrom(ctx Context) (string, bool)
- func NamespaceValue(ctx Context) string
- func NewRequestContextFilter(mapper RequestContextMapper, handler http.Handler) (http.Handler, error)
- func PreV1Beta3(version string) bool
- func UserFrom(ctx Context) (user.Info, bool)
- func ValidNamespace(ctx Context, resource *ObjectMeta) bool
- type APIVersions
- type AWSElasticBlockStoreVolumeSource
- type Binding
- type Capabilities
- type Capability
- type CauseType
- type ComponentCondition
- type ComponentConditionType
- type ComponentStatus
- type ComponentStatusList
- type ConditionStatus
- type Container
- type ContainerPort
- type ContainerState
- type ContainerStateRunning
- type ContainerStateTerminated
- type ContainerStateWaiting
- type ContainerStatus
- type Context
- func NewContext() Context
- func NewDefaultContext() Context
- func WithNamespace(parent Context, namespace string) Context
- func WithNamespaceDefaultIfNone(parent Context) Context
- func WithUser(parent Context, user user.Info) Context
- func WithValue(parent Context, key interface{}, val interface{}) Context
- type ConversionError
- type DNSPolicy
- type DeleteOptions
- type EmptyDirVolumeSource
- type EndpointAddress
- type EndpointPort
- type EndpointSubset
- type Endpoints
- type EndpointsList
- type EnvVar
- type EnvVarSource
- type Event
- type EventList
- type EventSource
- type ExecAction
- type FinalizerName
- type GCEPersistentDiskVolumeSource
- type GitRepoVolumeSource
- type GlusterfsVolumeSource
- type HTTPGetAction
- type Handler
- type HostPathVolumeSource
- type ISCSIVolumeSource
- type Lifecycle
- type LimitRange
- type LimitRangeItem
- type LimitRangeList
- type LimitRangeSpec
- type LimitType
- type List
- type ListMeta
- type ListOptions
- type LoadBalancerIngress
- type LoadBalancerStatus
- type LocalObjectReference
- type NFSVolumeSource
- type NameGenerator
- type Namespace
- type NamespaceList
- type NamespacePhase
- type NamespaceSpec
- type NamespaceStatus
- type Node
- type NodeAddress
- type NodeAddressType
- type NodeCondition
- type NodeConditionType
- type NodeList
- type NodePhase
- type NodeResources
- type NodeSpec
- type NodeStatus
- type NodeSystemInfo
- type ObjectFieldSelector
- type ObjectMeta
- type ObjectReference
- type Patch
- type PatchType
- type PersistentVolume
- type PersistentVolumeAccessMode
- type PersistentVolumeClaim
- type PersistentVolumeClaimList
- type PersistentVolumeClaimPhase
- type PersistentVolumeClaimSpec
- type PersistentVolumeClaimStatus
- type PersistentVolumeClaimVolumeSource
- type PersistentVolumeList
- type PersistentVolumePhase
- type PersistentVolumeReclaimPolicy
- type PersistentVolumeSource
- type PersistentVolumeSpec
- type PersistentVolumeStatus
- type Pod
- type PodCondition
- type PodConditionType
- type PodExecOptions
- type PodList
- type PodLogOptions
- type PodPhase
- type PodProxyOptions
- type PodSpec
- type PodStatus
- type PodStatusResult
- type PodTemplate
- type PodTemplateList
- type PodTemplateSpec
- type Probe
- type Protocol
- type PullPolicy
- type RBDVolumeSource
- type RangeAllocation
- type ReplicationController
- type ReplicationControllerList
- type ReplicationControllerSpec
- type ReplicationControllerStatus
- type RequestContextMapper
- type ResourceList
- type ResourceName
- type ResourceQuota
- type ResourceQuotaList
- type ResourceQuotaSpec
- type ResourceQuotaStatus
- type ResourceRequirements
- type RestartPolicy
- type RootPaths
- type SELinuxOptions
- type Secret
- type SecretList
- type SecretType
- type SecretVolumeSource
- type SecurityContext
- type SerializedReference
- type Service
- type ServiceAccount
- type ServiceAccountList
- type ServiceAffinity
- type ServiceList
- type ServicePort
- type ServiceSpec
- type ServiceStatus
- type ServiceType
- type Status
- type StatusCause
- type StatusDetails
- type StatusReason
- type StorageMedium
- type TCPSocketAction
- type TypeMeta
- type URIScheme
- type Volume
- type VolumeMount
- type VolumeSource
Constants ¶
const ( // NamespaceDefault means the object is in the default namespace which is applied when not specified by clients NamespaceDefault string = "default" // NamespaceAll is the default argument to specify on a context when you want to list or filter resources across all namespaces NamespaceAll string = "" // NamespaceNone is the argument for a context when there is no namespace. NamespaceNone string = "" // NamespaceSystem is the system namespace where we place system components. NamespaceSystem string = "kube-system" // TerminationMessagePathDefault means the default path to capture the application termination message running in a container TerminationMessagePathDefault string = "/dev/termination-log" )
const ( StatusSuccess = "Success" StatusFailure = "Failure" )
Values of Status.Status
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" // ServiceAccountNameKey is the key of the required annotation for SecretTypeServiceAccountToken secrets ServiceAccountNameKey = "kubernetes.io/service-account.name" // ServiceAccountUIDKey is the key of the required annotation for SecretTypeServiceAccountToken secrets ServiceAccountUIDKey = "kubernetes.io/service-account.uid" // ServiceAccountTokenKey is the key of the required data for SecretTypeServiceAccountToken secrets ServiceAccountTokenKey = "token" // ServiceAccountKubeconfigKey is the key of the optional kubeconfig data for SecretTypeServiceAccountToken secrets ServiceAccountKubeconfigKey = "kubernetes.kubeconfig" // ServiceAccountRootCAKey is the key of the optional root certificate authority for SecretTypeServiceAccountToken secrets ServiceAccountRootCAKey = "ca.crt" // SecretTypeDockercfg contains a dockercfg file that follows the same format rules as ~/.dockercfg // // Required fields: // - Secret.Data[".dockercfg"] - a serialized ~/.dockercfg file SecretTypeDockercfg SecretType = "kubernetes.io/dockercfg" // DockerConfigKey is the key of the required data for SecretTypeDockercfg secrets DockerConfigKey = ".dockercfg" )
const ( // Enable stdin for remote command execution ExecStdinParam = "input" // Enable stdout for remote command execution ExecStdoutParam = "output" // Enable stderr for remote command execution ExecStderrParam = "error" // Enable TTY for remote command execution ExecTTYParam = "tty" // Command to run for remote command execution ExecCommandParamm = "command" StreamType = "streamType" StreamTypeStdin = "stdin" StreamTypeStdout = "stdout" StreamTypeStderr = "stderr" StreamTypeData = "data" StreamTypeError = "error" PortHeader = "port" )
These constants are for remote command execution and port forwarding and are used by both the client side and server side components.
This is probably not the ideal place for them, but it didn't seem worth it to create pkg/exec and pkg/portforward just to contain a single file with constants in it. Suggestions for more appropriate alternatives are definitely welcome!
const ( // ClusterIPNone - do not assign a cluster IP // no proxying required and no environment variables should be created for pods ClusterIPNone = "None" )
const MaxSecretSize = 1 * 1024 * 1024
Variables ¶
var ( // Errors that could be returned by GetReference. ErrNilObject = errors.New("can't reference a nil object") ErrNoSelfLink = errors.New("selfLink was empty, can't make reference") )
var Codec = runtime.CodecFor(Scheme, "")
Codec is the identity codec for this package - it can only convert itself to itself.
var ForTesting_ReferencesAllowBlankSelfLinks = false
ForTesting_ReferencesAllowBlankSelfLinks can be set to true in tests to avoid "ErrNoSelfLink" errors.
var Scheme = runtime.NewScheme()
Scheme is the default instance of runtime.Scheme to which types in the Kubernetes API are already registered.
var Semantic = conversion.EqualitiesOrDie( func(a, b resource.Quantity) bool { if a.Amount == nil && b.MilliValue() == 0 { return true } if b.Amount == nil && a.MilliValue() == 0 { return true } if a.Amount == nil || b.Amount == nil { return false } return a.Amount.Cmp(b.Amount) == 0 }, func(a, b util.Time) bool { return a.UTC() == b.UTC() }, func(a, b labels.Selector) bool { return a.String() == b.String() }, func(a, b fields.Selector) bool { return a.String() == b.String() }, )
Semantic can do semantic deep equality checks for api objects. Example: api.Semantic.DeepEqual(aPod, aPodWithNonNilButEmptyMaps) == true
Functions ¶
func AddToNodeAddresses ¶ added in v0.13.0
func AddToNodeAddresses(addresses *[]NodeAddress, addAddresses ...NodeAddress)
AddToNodeAddresses appends the NodeAddresses to the passed-by-pointer slice, only if they do not already exist
func FieldSelectorQueryParam ¶ added in v0.13.1
TODO: remove me when watch is refactored
func FillObjectMetaSystemFields ¶ added in v0.5.1
func FillObjectMetaSystemFields(ctx Context, meta *