Documentation
¶
Index ¶
- type BearerTokenRetriever
- type Deployer
- type KubernetesClusterNamespace
- type KubernetesDeployer
- type KubernetesPodListRetriever
- type PodContainerStatuses
- type PodContainerStatusesState
- type PodContainerStatusesStateRunning
- type PodContainerStatusesStateWaiting
- type PodDeployResponse
- type PodDeployStatus
- type PodItem
- type PodList
- type PodListRetriever
- type PodMetadataContainer
- type PodMetadataDetail
- type PodStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BearerTokenRetriever ¶
type BearerTokenRetriever interface {
RetrieveToken() string
}
BearerTokenRetriever represents any struct that can return a Bearer token. This supports both long-lived tokens (say from an environment variable) or short-lived tokens that need to be refreshed regularly.
type KubernetesClusterNamespace ¶
type KubernetesClusterNamespace struct { Description string PodRetriever PodListRetriever DeployMaker Deployer }
KubernetesClusterNamespace is a struct used to connect to a Kubernetes cluster.
func (*KubernetesClusterNamespace) Deploy ¶
func (n *KubernetesClusterNamespace) Deploy(containerTag string) error
Deploy changes the image for an existing deployment and Kubernetes rebuilds the pods
func (*KubernetesClusterNamespace) GetPodList ¶
func (n *KubernetesClusterNamespace) GetPodList() (*PodList, error)
GetPodList retrieves all the pods running in a deployment
type KubernetesDeployer ¶
type KubernetesDeployer struct { Client *http.Client Endpoint string Namespace string DeploymentName string ContainerName string ContainerImage string BearerTokenService BearerTokenRetriever }
KubernetesDeployer updates a deployment via Kubernetes API
func (*KubernetesDeployer) Deploy ¶
func (d *KubernetesDeployer) Deploy(containerTag string) error
Deploy a container via Kubernetes API
type KubernetesPodListRetriever ¶
type KubernetesPodListRetriever struct { Client *http.Client Endpoint string Namespace string BearerTokenService BearerTokenRetriever }
KubernetesPodListRetriever retrieves pods via Kubernetes API
func (*KubernetesPodListRetriever) PodInformation ¶
func (p *KubernetesPodListRetriever) PodInformation() (*PodList, error)
PodInformation retrieved from Kubernetes API
type PodContainerStatuses ¶
type PodContainerStatuses struct { State PodContainerStatusesState `json:"state"` Image string `json:"image,omitempty"` }
PodContainerStatuses used for determining what state the container is in.
type PodContainerStatusesState ¶
type PodContainerStatusesState struct { Running *PodContainerStatusesStateRunning `json:"running,omitempty"` Waiting *PodContainerStatusesStateWaiting `json:"waiting,omitempty"` }
PodContainerStatusesState is part of PodList response coming back from Kubernetes
type PodContainerStatusesStateRunning ¶
PodContainerStatusesStateRunning is part of PodList response coming back from Kubernetes
type PodContainerStatusesStateWaiting ¶
type PodContainerStatusesStateWaiting struct {
Reason string `json:"reason"`
}
PodContainerStatusesStateWaiting is part of PodList response coming back from Kubernetes
type PodDeployResponse ¶
type PodDeployResponse struct {
Status PodDeployStatus `json:"status"`
}
PodDeployResponse is part of the deployment response coming back from Kubernetes
type PodDeployStatus ¶
type PodDeployStatus struct {
AvailableReplicas int `json:"availableReplicas"`
}
PodDeployStatus has details about what state the Pod is in.
type PodList ¶
type PodList struct {
Items []PodMetadataContainer `json:"items"`
}
PodList holds a Kubernetes PodList.
func (*PodList) FilterByDeployment ¶
FilterByDeployment returns a new PodList with only deployment names that match prefix. Handy for only retrieving specific deployment when running multiple deployments in same namespace.
type PodListRetriever ¶
PodListRetriever represents any struct that returns a PodList
type PodMetadataContainer ¶
type PodMetadataContainer struct { Metadata PodMetadataDetail `json:"metadata"` Status PodStatus `json:"status"` }
PodMetadataContainer houses PodMetadataDetail values.
type PodMetadataDetail ¶
type PodMetadataDetail struct { Name string `json:"name"` CreationTimestamp time.Time `json:"creationTimestamp"` }
PodMetadataDetail has details about an individual Kubernetes Pod.
type PodStatus ¶
type PodStatus struct { Phase string `json:"phase"` ContainerStatuses []PodContainerStatuses `json:"containerStatuses"` }
PodStatus has details about what state the Pod is in.