Documentation ¶
Index ¶
- Constants
- func CreateObjectFromInfoFn(info *kubectlResource.Info) (bool, error)
- func DeployApp(spec *AppDeploymentSpec, client client.Interface) error
- func DeployAppFromFile(spec *AppDeploymentFromFileSpec, createObjectFromInfoFn createObjectFromInfo, ...) (bool, error)
- func GetDeploymentEvents(client client.Interface, dsQuery *dataselect.DataSelectQuery, namespace string, ...) (*common.EventList, error)
- func GetDeploymentOldReplicaSets(client client.Interface, dsQuery *dataselect.DataSelectQuery, namespace string, ...) (*replicasetlist.ReplicaSetList, error)
- func GetDeploymentPods(client client.Interface, heapsterClient heapster.HeapsterClient, ...) (*pod.PodList, error)
- type AppDeploymentFromFileResponse
- type AppDeploymentFromFileSpec
- type AppDeploymentSpec
- type Deployment
- type DeploymentCell
- type DeploymentDetail
- type DeploymentList
- func CreateDeploymentList(deployments []extensions.Deployment, pods []api.Pod, events []api.Event, ...) *DeploymentList
- func GetDeploymentList(client client.Interface, nsQuery *common.NamespaceQuery, ...) (*DeploymentList, error)
- func GetDeploymentListFromChannels(channels *common.ResourceChannels, dsQuery *dataselect.DataSelectQuery, ...) (*DeploymentList, error)
- type EnvironmentVariable
- type Label
- type PortMapping
- type Protocols
- type RollingUpdateStrategy
- type StatusInfo
Constants ¶
const (
// DescriptionAnnotationKey is annotation key for a description.
DescriptionAnnotationKey = "description"
)
Variables ¶
This section is empty.
Functions ¶
func CreateObjectFromInfoFn ¶ added in v1.4.2
func CreateObjectFromInfoFn(info *kubectlResource.Info) (bool, error)
CreateObjectFromInfoFn is a implementation of createObjectFromInfo
func DeployApp ¶ added in v1.4.2
func DeployApp(spec *AppDeploymentSpec, client client.Interface) error
DeployApp deploys an app based on the given configuration. The app is deployed using the given client. App deployment consists of a deployment and an optional service. Both of them share common labels.
func DeployAppFromFile ¶ added in v1.4.2
func DeployAppFromFile(spec *AppDeploymentFromFileSpec, createObjectFromInfoFn createObjectFromInfo, clientConfig clientcmd.ClientConfig) (bool, error)
DeployAppFromFile deploys an app based on the given yaml or json file.
func GetDeploymentEvents ¶
func GetDeploymentEvents(client client.Interface, dsQuery *dataselect.DataSelectQuery, namespace string, deploymentName string) ( *common.EventList, error)
GetDeploymentEvents returns model events for a deployment with the given name in the given namespace
func GetDeploymentOldReplicaSets ¶ added in v1.4.0
func GetDeploymentOldReplicaSets(client client.Interface, dsQuery *dataselect.DataSelectQuery, namespace string, deploymentName string) (*replicasetlist.ReplicaSetList, error)
GetDeploymentEvents returns model events for a deployment with the given name in the given namespace
func GetDeploymentPods ¶ added in v1.4.0
func GetDeploymentPods(client client.Interface, heapsterClient heapster.HeapsterClient, dsQuery *dataselect.DataSelectQuery, namespace string, deploymentName string) (*pod.PodList, error)
getJobPods returns list of pods targeting deployment.
Types ¶
type AppDeploymentFromFileResponse ¶ added in v1.4.2
type AppDeploymentFromFileResponse struct { // Name of the file Name string `json:"name"` // File content Content string `json:"content"` // Error after create resource Error string `json:"error"` }
AppDeploymentFromFileResponse is a specification for deployment from file
type AppDeploymentFromFileSpec ¶ added in v1.4.2
type AppDeploymentFromFileSpec struct { // Name of the file Name string `json:"name"` // File content Content string `json:"content"` // Whether validate content before creation or not Validate bool `json:"validate"` }
AppDeploymentFromFileSpec is a specification for deployment from file
type AppDeploymentSpec ¶ added in v1.4.2
type AppDeploymentSpec struct { // Name of the application. Name string `json:"name"` // Docker image path for the application. ContainerImage string `json:"containerImage"` // The name of an image pull secret in case of a private docker repository. ImagePullSecret *string `json:"imagePullSecret"` // Command that is executed instead of container entrypoint, if specified. ContainerCommand *string `json:"containerCommand"` // Arguments for the specified container command or container entrypoint (if command is not // specified here). ContainerCommandArgs *string `json:"containerCommandArgs"` // Number of replicas of the image to maintain. Replicas int32 `json:"replicas"` // Port mappings for the service that is created. The service is created if there is at least // one port mapping. PortMappings []PortMapping `json:"portMappings"` // List of user-defined environment variables. Variables []EnvironmentVariable `json:"variables"` // Whether the created service is external. IsExternal bool `json:"isExternal"` // Description of the deployment. Description *string `json:"description"` // Target namespace of the application. Namespace string `json:"namespace"` // Optional memory requirement for the container. MemoryRequirement *resource.Quantity `json:"memoryRequirement"` // Optional CPU requirement for the container. CpuRequirement *resource.Quantity `json:"cpuRequirement"` // Labels that will be defined on Pods/RCs/Services Labels []Label `json:"labels"` // Whether to run the container as privileged user (essentially equivalent to root on the host). RunAsPrivileged bool `json:"runAsPrivileged"` }
AppDeploymentSpec is a specification for an app deployment.
type Deployment ¶
type Deployment struct { ObjectMeta common.ObjectMeta `json:"objectMeta"` TypeMeta common.TypeMeta `json:"typeMeta"` // Aggregate information about pods belonging to this Deployment. Pods common.PodInfo `json:"pods"` // Container images of the Deployment. ContainerImages []string `json:"containerImages"` }
Deployment is a presentation layer view of Kubernetes Deployment resource. This means it is Deployment plus additional augumented data we can get from other sources (like services that target the same pods).
type DeploymentCell ¶ added in v1.4.0
type DeploymentCell extensions.Deployment
func (DeploymentCell) GetProperty ¶ added in v1.4.0
func (self DeploymentCell) GetProperty(name dataselect.PropertyName) dataselect.ComparableValue
func (DeploymentCell) GetResourceSelector ¶ added in v1.4.0
func (self DeploymentCell) GetResourceSelector() *metric.ResourceSelector
type DeploymentDetail ¶
type DeploymentDetail struct { ObjectMeta common.ObjectMeta `json:"objectMeta"` TypeMeta common.TypeMeta `json:"typeMeta"` // Detailed information about Pods belonging to this Deployment. PodList pod.PodList `json:"podList"` // Label selector of the service. Selector map[string]string `json:"selector"` // Status information on the deployment StatusInfo `json:"statusInfo"` // The deployment strategy to use to replace existing pods with new ones. // Valid options: Recreate, RollingUpdate Strategy extensions.DeploymentStrategyType `json:"strategy"` // Min ready seconds MinReadySeconds int32 `json:"minReadySeconds"` // Rolling update strategy containing maxSurge and maxUnavailable RollingUpdateStrategy *RollingUpdateStrategy `json:"rollingUpdateStrategy,omitempty"` // RepliaSetList containing old replica sets from the deployment OldReplicaSetList replicasetlist.ReplicaSetList `json:"oldReplicaSetList"` // New replica set used by this deployment NewReplicaSet replicaset.ReplicaSet `json:"newReplicaSet"` // Optional field that specifies the number of old Replica Sets to retain to allow rollback. RevisionHistoryLimit *int32 `json:"revisionHistoryLimit"` // List of events related to this Deployment EventList common.EventList `json:"eventList"` // List of Horizontal Pod AutoScalers targeting this Deployment HorizontalPodAutoscalerList horizontalpodautoscalerlist.HorizontalPodAutoscalerList `json:"horizontalPodAutoscalerList"` }
DeploymentDetail is a presentation layer view of Kubernetes Deployment resource.
func GetDeploymentDetail ¶
func GetDeploymentDetail(client client.Interface, heapsterClient heapster.HeapsterClient, namespace string, deploymentName string) (*DeploymentDetail, error)
GetDeploymentDetail returns model object of deployment and error, if any.
type DeploymentList ¶
type DeploymentList struct { ListMeta common.ListMeta `json:"listMeta"` // Unordered list of Deployments. Deployments []Deployment `json:"deployments"` CumulativeMetrics []metric.Metric `json:"cumulativeMetrics"` }
ReplicationSetList contains a list of Deployments in the cluster.
func CreateDeploymentList ¶
func CreateDeploymentList(deployments []extensions.Deployment, pods []api.Pod, events []api.Event, dsQuery *dataselect.DataSelectQuery, heapsterClient *heapster.HeapsterClient) *DeploymentList
CreateDeploymentList returns a list of all Deployment model objects in the cluster, based on all Kubernetes Deployment API objects.
func GetDeploymentList ¶
func GetDeploymentList(client client.Interface, nsQuery *common.NamespaceQuery, dsQuery *dataselect.DataSelectQuery, heapsterClient *heapster.HeapsterClient) (*DeploymentList, error)
GetDeploymentList returns a list of all Deployments in the cluster.
func GetDeploymentListFromChannels ¶
func GetDeploymentListFromChannels(channels *common.ResourceChannels, dsQuery *dataselect.DataSelectQuery, heapsterClient *heapster.HeapsterClient) (*DeploymentList, error)
GetDeploymentList returns a list of all Deployments in the cluster reading required resource list once from the channels.
type EnvironmentVariable ¶ added in v1.4.2
type EnvironmentVariable struct { // Name of the variable. Must be a C_IDENTIFIER. Name string `json:"name"` // Value of the variable, as defined in Kubernetes core API. Value string `json:"value"` }
EnvironmentVariable represents a named variable accessible for containers.
type Label ¶ added in v1.4.2
type Label struct { // Label key Key string `json:"key"` // Label value Value string `json:"value"` }
Label is a structure representing label assignable to Pod/RC/Service
type PortMapping ¶ added in v1.4.2
type PortMapping struct { // Port that will be exposed on the service. Port int32 `json:"port"` // Docker image path for the application. TargetPort int32 `json:"targetPort"` // IP protocol for the mapping, e.g., "TCP" or "UDP". Protocol api.Protocol `json:"protocol"` }
PortMapping is a specification of port mapping for an application deployment.
type Protocols ¶ added in v1.4.2
type Protocols struct { // Array containing supported protocol types e.g., ["TCP", "UDP"] Protocols []api.Protocol `json:"protocols"` }
Protocols is a structure representing supported protocol types for a service
func GetAvailableProtocols ¶ added in v1.4.2
func GetAvailableProtocols() *Protocols
GetAvailableProtocols returns list of available protocols. Currently it is TCP and UDP.
type RollingUpdateStrategy ¶
type RollingUpdateStrategy struct { MaxSurge int `json:"maxSurge"` }
RollingUpdateStrategy is behavior of a rolling update. See RollingUpdateDeployment K8s object.
type StatusInfo ¶
type StatusInfo struct { // Total number of desired replicas on the deployment Replicas int32 `json:"replicas"` // Number of non-terminated pods that have the desired template spec Updated int32 `json:"updated"` // Number of available pods (ready for at least minReadySeconds) // targeted by this deployment Available int32 `json:"available"` Unavailable int32 `json:"unavailable"` }
func GetStatusInfo ¶
func GetStatusInfo(deploymentStatus *extensions.DeploymentStatus) StatusInfo