Documentation ¶
Index ¶
- Constants
- func BuildJob(opts *JobOpts) *batchv1.Job
- func BuildLabels(name, instance, version string, extra map[string]string) map[string]string
- func BuildResources(opts *ResourcesOpts) (*appsv1.Deployment, *corev1.Service, error)
- func NewInClusterKubeConfig() (*rest.Config, *kubernetes.Clientset, error)
- func NewOutOfClusterKubeConfig(configPath string) (*rest.Config, *kubernetes.Clientset, error)
- func NormalizeKubeConfig(configPath string) string
- func ObjectToYaml(object runtime.Object) string
- func YamlToDeployment(data string) *appsv1.Deployment
- type CopyPodOpts
- type DeploymentCreateOpts
- type DeploymentDetails
- type DeploymentInfo
- type JobCreateOpts
- type JobOpts
- type KubeClient
- func (client *KubeClient) AppApi() app.AppsV1Interface
- func (client *KubeClient) BatchApi() batch.BatchV1Interface
- func (client *KubeClient) Close() error
- func (client *KubeClient) CopyToPod(opts *CopyPodOpts) error
- func (client *KubeClient) CoreApi() core.CoreV1Interface
- func (client *KubeClient) DeploymentCreate(opts *DeploymentCreateOpts) error
- func (client *KubeClient) DeploymentDelete(namespace string, name string) error
- func (client *KubeClient) DeploymentDescribe(namespace string, name string) (*DeploymentDetails, error)
- func (client *KubeClient) DeploymentList(namespace string, namePrefix string, labelSelector string) ([]DeploymentInfo, error)
- func (client *KubeClient) JobCreate(opts *JobCreateOpts) error
- func (client *KubeClient) JobDelete(namespace string, name string) error
- func (client *KubeClient) JobDescribe(namespace string, name string) (*PodInfo, error)
- func (client *KubeClient) NamespaceApply(name string) error
- func (client *KubeClient) NamespaceDelete(name string) error
- func (client *KubeClient) PodDescribeFromDeployment(deployment *appsv1.Deployment) (*PodInfo, error)
- func (client *KubeClient) PodExecCommand(opts *PodExecOpts) error
- func (client *KubeClient) PodExecShell(opts *PodExecOpts) error
- func (client *KubeClient) PodLogs(opts *PodLogsOpts) error
- func (client *KubeClient) PodLogsTee(opts *PodLogsOpts, logFileName string) error
- func (client *KubeClient) PodPortForward(opts *PodPortForwardOpts) error
- func (client *KubeClient) RestApi() *rest.Config
- func (client *KubeClient) SecretCreate(namespace string, spec *corev1.Secret) error
- func (client *KubeClient) SecretDelete(namespace string, name string) (bool, error)
- func (client *KubeClient) ServiceCreate(namespace string, spec *corev1.Service) error
- func (client *KubeClient) ServiceDelete(namespace string, name string) error
- func (client *KubeClient) ServiceDescribe(namespace string, name string) (*ServiceInfo, error)
- type KubeEnv
- type KubePort
- type KubeResource
- type PodExecOpts
- type PodInfo
- type PodLogsOpts
- type PodPortForwardOpts
- type ResourcesOpts
- type ServiceInfo
Constants ¶
View Source
const ( SingleReplica = 1 SidecarPrefix = "sidecar-" LabelKubeName = "app.kubernetes.io/name" LabelKubeInstance = "app.kubernetes.io/instance" LabelKubeVersion = "app.kubernetes.io/version" LabelKubeManagedBy = "app.kubernetes.io/managed-by" )
Variables ¶
This section is empty.
Functions ¶
func BuildLabels ¶ added in v0.8.1
func BuildResources ¶ added in v0.8.1
func BuildResources(opts *ResourcesOpts) (*appsv1.Deployment, *corev1.Service, error)
func NewInClusterKubeConfig ¶ added in v0.8.1
func NewInClusterKubeConfig() (*rest.Config, *kubernetes.Clientset, error)
func NewOutOfClusterKubeConfig ¶ added in v0.8.1
func NormalizeKubeConfig ¶ added in v0.8.1
func ObjectToYaml ¶ added in v0.12.0
func YamlToDeployment ¶ added in v0.12.0
func YamlToDeployment(data string) *appsv1.Deployment
https://github.com/kubernetes/client-go/issues/193 https://medium.com/@harshjniitr/reading-and-writing-k8s-resource-as-yaml-in-golang-81dc8c7ea800
Types ¶
type CopyPodOpts ¶ added in v0.12.0
type DeploymentCreateOpts ¶
type DeploymentCreateOpts struct { Namespace string Spec *appsv1.Deployment OnStatusEventCallback func(event string) }
type DeploymentDetails ¶ added in v0.8.0
type DeploymentDetails struct { Info *DeploymentInfo Created time.Time Annotations map[string]string }
type DeploymentInfo ¶
type JobCreateOpts ¶ added in v0.12.0
type KubeClient ¶
type KubeClient struct {
// contains filtered or unexported fields
}
func NewKubeClient ¶ added in v0.8.0
func NewKubeClient(inCluster bool, configPath string) (*KubeClient, error)
func (*KubeClient) AppApi ¶ added in v0.8.0
func (client *KubeClient) AppApi() app.AppsV1Interface
func (*KubeClient) BatchApi ¶ added in v0.12.0
func (client *KubeClient) BatchApi() batch.BatchV1Interface
func (*KubeClient) Close ¶
func (client *KubeClient) Close() error
func (*KubeClient) CopyToPod ¶ added in v0.12.0
func (client *KubeClient) CopyToPod(opts *CopyPodOpts) error
func (*KubeClient) CoreApi ¶ added in v0.8.0
func (client *KubeClient) CoreApi() core.CoreV1Interface
func (*KubeClient) DeploymentCreate ¶
func (client *KubeClient) DeploymentCreate(opts *DeploymentCreateOpts) error
func (*KubeClient) DeploymentDelete ¶
func (client *KubeClient) DeploymentDelete(namespace string, name string) error
func (*KubeClient) DeploymentDescribe ¶ added in v0.8.0
func (client *KubeClient) DeploymentDescribe(namespace string, name string) (*DeploymentDetails, error)
func (*KubeClient) DeploymentList ¶
func (client *KubeClient) DeploymentList(namespace string, namePrefix string, labelSelector string) ([]DeploymentInfo, error)
func (*KubeClient) JobCreate ¶ added in v0.12.0
func (client *KubeClient) JobCreate(opts *JobCreateOpts) error
func (*KubeClient) JobDelete ¶ added in v0.12.0
func (client *KubeClient) JobDelete(namespace string, name string) error
func (*KubeClient) JobDescribe ¶ added in v0.12.0
func (client *KubeClient) JobDescribe(namespace string, name string) (*PodInfo, error)
func (*KubeClient) NamespaceApply ¶
func (client *KubeClient) NamespaceApply(name string) error
func (*KubeClient) NamespaceDelete ¶
func (client *KubeClient) NamespaceDelete(name string) error
func (*KubeClient) PodDescribeFromDeployment ¶ added in v0.12.0
func (client *KubeClient) PodDescribeFromDeployment(deployment *appsv1.Deployment) (*PodInfo, error)
func (*KubeClient) PodExecCommand ¶ added in v0.12.0
func (client *KubeClient) PodExecCommand(opts *PodExecOpts) error
func (*KubeClient) PodExecShell ¶ added in v0.12.0
func (client *KubeClient) PodExecShell(opts *PodExecOpts) error
func (*KubeClient) PodLogs ¶ added in v0.12.2
func (client *KubeClient) PodLogs(opts *PodLogsOpts) error
func (*KubeClient) PodLogsTee ¶ added in v0.12.0
func (client *KubeClient) PodLogsTee(opts *PodLogsOpts, logFileName string) error
func (*KubeClient) PodPortForward ¶
func (client *KubeClient) PodPortForward(opts *PodPortForwardOpts) error
func (*KubeClient) RestApi ¶ added in v0.8.0
func (client *KubeClient) RestApi() *rest.Config
func (*KubeClient) SecretCreate ¶ added in v0.12.0
func (client *KubeClient) SecretCreate(namespace string, spec *corev1.Secret) error
func (*KubeClient) SecretDelete ¶ added in v0.12.0
func (client *KubeClient) SecretDelete(namespace string, name string) (bool, error)
func (*KubeClient) ServiceCreate ¶
func (client *KubeClient) ServiceCreate(namespace string, spec *corev1.Service) error
func (*KubeClient) ServiceDelete ¶
func (client *KubeClient) ServiceDelete(namespace string, name string) error
func (*KubeClient) ServiceDescribe ¶ added in v0.8.0
func (client *KubeClient) ServiceDescribe(namespace string, name string) (*ServiceInfo, error)
type KubeResource ¶
type PodExecOpts ¶
type PodLogsOpts ¶ added in v0.12.0
type PodPortForwardOpts ¶
type ResourcesOpts ¶ added in v0.8.1
type ServiceInfo ¶ added in v0.8.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.