Documentation ¶
Index ¶
- Constants
- func CreateAnnotatedDeploymentObject(name, ns string, annotations map[string]string) *appsv1.Deployment
- func CreateDeploymentForTest(name, ns string, client KubeClient) error
- func CreateDeploymentObject(name, ns string) *appsv1.Deployment
- func CreateJobObject(name, ns string, completed bool) *batchv1.Job
- func CreatePodForTest(name, ns, access, role string, client KubeClient) error
- func CreatePodObject(name, ns, access, role string) *corev1.Pod
- func CreatePodObjectWithExit(name, ns string) *corev1.Pod
- func CreatePodSpecVolume(name, secretName string) []corev1.Volume
- type Access
- type AccessImpl
- type Certificate
- type CertificateImpl
- type Cluster
- type ClusterImpl
- type Configuration
- type ConfigurationImpl
- func (c *ConfigurationImpl) CreateDockerSecret(namespace, secretName string, data map[string]string) error
- func (c *ConfigurationImpl) CreateSecret(namespace, secretName string, data map[string][]byte) error
- func (c *ConfigurationImpl) CreateTlSSecret(namespace, secretName string, data map[string][]byte, immutable bool) error
- func (c *ConfigurationImpl) DeleteSecret(namespace, secretName string) error
- func (c *ConfigurationImpl) GetSecret(namespace, secretName string) (*corev1.Secret, error)
- func (c *ConfigurationImpl) ListSecrets(namespace string) (*corev1.SecretList, error)
- func (c *ConfigurationImpl) UpdateSecret(namespace, secretName string, data map[string][]byte) error
- func (c *ConfigurationImpl) UpdateTLSSecret(namespace, secretName string, data map[string][]byte, ...) error
- type Kube
- func (k *Kube) Access() Access
- func (k *Kube) Certificate() Certificate
- func (k *Kube) Cluster() Cluster
- func (k *Kube) Configuration() Configuration
- func (k *Kube) Namespaces() Namespace
- func (k *Kube) Nodes() Nodes
- func (k *Kube) Storage() Storage
- func (k *Kube) Util() Util
- func (k *Kube) V1Alpha1() V1Alpha1
- func (k *Kube) Workload() Workload
- type KubeClient
- type Namespace
- type NamespaceImpl
- type Nodes
- type NodesImpl
- type ServiceMapping
- type ServiceMappingsImpl
- func (s *ServiceMappingsImpl) Create(mapping *v1alpha.Mapping) (*v1alpha.Mapping, error)
- func (s *ServiceMappingsImpl) CreateInCluster() (bool, error)
- func (s *ServiceMappingsImpl) Get(name string) (*v1alpha.Mapping, error)
- func (s *ServiceMappingsImpl) GetDefinition(name string) (*apiextensionv1.CustomResourceDefinition, error)
- func (s *ServiceMappingsImpl) List() (*v1alpha.MappingList, error)
- func (s *ServiceMappingsImpl) Parse(services []v1alpha.Service, name, ns string) (*v1alpha.Mapping, error)
- func (s *ServiceMappingsImpl) Update(mapping *v1alpha.Mapping) (*v1alpha.Mapping, error)
- type Storage
- type StorageImpl
- type Util
- type UtilImpl
- type V1Alpha1
- type V1Alpha1Impl
- type Workload
- type WorkloadImpl
- func (w *WorkloadImpl) CreateDeployment(namespace string, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
- func (w *WorkloadImpl) CreateJob(namespace string, spec *batchv1.Job) (*batchv1.Job, error)
- func (w *WorkloadImpl) CreatePod(namespace string, pod *corev1.Pod) (*corev1.Pod, error)
- func (w *WorkloadImpl) CreatePodSpec(namespace, name, podImage string, command []string) *corev1.Pod
- func (w *WorkloadImpl) DeletePod(namespace, podName string) error
- func (w *WorkloadImpl) ExecNamedPod(namespace, podName string, command []string) (string, error)
- func (w *WorkloadImpl) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
- func (w *WorkloadImpl) GetDeploymentStatus(namespace string) (bool, error)
- func (w *WorkloadImpl) GetJob(namespace, name string) (*batchv1.Job, error)
- func (w *WorkloadImpl) GetNewLock(lockName, podName, namespace string) *resourcelock.LeaseLock
- func (w *WorkloadImpl) GetPodByName(namespace, name string) (*corev1.Pod, error)
- func (w *WorkloadImpl) GetPodsBySelector(namespace, selector string) (*corev1.PodList, error)
- func (w *WorkloadImpl) GetStatefulSets(namespace string) (*appsv1.StatefulSetList, error)
- func (w *WorkloadImpl) List(namespace string) (*corev1.PodList, error)
- func (w *WorkloadImpl) ListDeployments(namespace string) (*appsv1.DeploymentList, error)
- func (w *WorkloadImpl) ListJobs(namespace string) (*batchv1.JobList, error)
- func (w *WorkloadImpl) UpdateDeploymentViaAnnotation(namespace, name string, annotation map[string]string) (*appsv1.Deployment, error)
Constants ¶
View Source
const ( EnvNamespace = "NAMESPACE" EnvKubePath = "KUBE_PATH" )
Variables ¶
This section is empty.
Functions ¶
func CreateAnnotatedDeploymentObject ¶
func CreateAnnotatedDeploymentObject(name, ns string, annotations map[string]string) *appsv1.Deployment
func CreateDeploymentForTest ¶
func CreateDeploymentForTest(name, ns string, client KubeClient) error
func CreateDeploymentObject ¶
func CreateDeploymentObject(name, ns string) *appsv1.Deployment
func CreatePodForTest ¶
func CreatePodForTest(name, ns, access, role string, client KubeClient) error
func CreatePodObject ¶
func CreatePodObjectWithExit ¶
func CreatePodSpecVolume ¶
Types ¶
type Access ¶
type Access interface {
GetServiceAccounts() (*corev1.ServiceAccountList, error)
}
type AccessImpl ¶
type AccessImpl struct {
// contains filtered or unexported fields
}
func NewAccessClient ¶
func NewAccessClient(kube kubernetes.Interface, namespace string) (*AccessImpl, error)
func (*AccessImpl) GetServiceAccounts ¶
func (a *AccessImpl) GetServiceAccounts() (*corev1.ServiceAccountList, error)
type Certificate ¶
type Certificate interface { ListCsr() (*v1cert.CertificateSigningRequestList, error) DeleteCsr(name string) error }
type CertificateImpl ¶
type CertificateImpl struct {
// contains filtered or unexported fields
}
func NewCertificateClient ¶
func NewCertificateClient(kube kubernetes.Interface) (*CertificateImpl, error)
func (*CertificateImpl) DeleteCsr ¶
func (c *CertificateImpl) DeleteCsr(name string) error
func (*CertificateImpl) ListCsr ¶
func (c *CertificateImpl) ListCsr() (*v1cert.CertificateSigningRequestList, error)
type ClusterImpl ¶
type ClusterImpl struct {
// contains filtered or unexported fields
}
func NewClusterClient ¶
func NewClusterClient(config []byte) (*ClusterImpl, error)
func (*ClusterImpl) GetCurrentContext ¶
func (c *ClusterImpl) GetCurrentContext() (string, error)
func (*ClusterImpl) GetHostCaCert ¶
func (c *ClusterImpl) GetHostCaCert() ([]byte, error)
func (*ClusterImpl) GetHostServer ¶
func (c *ClusterImpl) GetHostServer() (string, error)
type Configuration ¶
type Configuration interface { GetSecret(namespace, secretName string) (*corev1.Secret, error) ListSecrets(namespace string) (*corev1.SecretList, error) CreateSecret(namespace, secretName string, data map[string][]byte) error UpdateSecret(namespace, secretName string, data map[string][]byte) error DeleteSecret(namespace, secretName string) error CreateDockerSecret(namespace, secretName string, data map[string]string) error CreateTlSSecret(namespace, secretName string, data map[string][]byte, immutable bool) error UpdateTLSSecret(namespace, secretName string, data map[string][]byte, annotation map[string]string) error }
type ConfigurationImpl ¶
type ConfigurationImpl struct {
// contains filtered or unexported fields
}
func NewConfigurationClient ¶
func NewConfigurationClient(kube kubernetes.Interface) (*ConfigurationImpl, error)
func (*ConfigurationImpl) CreateDockerSecret ¶
func (c *ConfigurationImpl) CreateDockerSecret(namespace, secretName string, data map[string]string) error
func (*ConfigurationImpl) CreateSecret ¶
func (c *ConfigurationImpl) CreateSecret(namespace, secretName string, data map[string][]byte) error
func (*ConfigurationImpl) CreateTlSSecret ¶
func (*ConfigurationImpl) DeleteSecret ¶
func (c *ConfigurationImpl) DeleteSecret(namespace, secretName string) error
func (*ConfigurationImpl) GetSecret ¶
func (c *ConfigurationImpl) GetSecret(namespace, secretName string) (*corev1.Secret, error)
GetSecret a secrets in a namespace in your kube cluster
func (*ConfigurationImpl) ListSecrets ¶
func (c *ConfigurationImpl) ListSecrets(namespace string) (*corev1.SecretList, error)
func (*ConfigurationImpl) UpdateSecret ¶
func (c *ConfigurationImpl) UpdateSecret(namespace, secretName string, data map[string][]byte) error
func (*ConfigurationImpl) UpdateTLSSecret ¶
type Kube ¶
type Kube struct {
// contains filtered or unexported fields
}
func NewInClusterKube ¶
func (*Kube) Certificate ¶
func (k *Kube) Certificate() Certificate
func (*Kube) Configuration ¶
func (k *Kube) Configuration() Configuration
func (*Kube) Namespaces ¶
type KubeClient ¶
type KubeClient interface { Access() Access Configuration() Configuration Cluster() Cluster Util() Util Workload() Workload Nodes() Nodes Namespaces() Namespace Storage() Storage Certificate() Certificate V1Alpha1() V1Alpha1 }
func CreateKubeClient ¶ added in v0.1.1
func CreateKubeClient(OutOfClusterKube bool) (KubeClient, error)
func FakeKubeClient ¶
func FakeKubeClient(ns string) (KubeClient, error)
func NewKubeClient ¶
func NewKubeClient(cfg []byte, ns string) (KubeClient, error)
type NamespaceImpl ¶
type NamespaceImpl struct {
// contains filtered or unexported fields
}
func NewNamespaceClient ¶
func NewNamespaceClient(kube kubernetes.Interface) (*NamespaceImpl, error)
NewNamespaceClient to interact with Namespace interface
func (*NamespaceImpl) Create ¶
func (n *NamespaceImpl) Create(namespace string) error
Create checks if a namespace exists and creates one if it does not exist yet
func (*NamespaceImpl) Delete ¶
func (n *NamespaceImpl) Delete(namespace string) error
Delete removes a named namespace from your kube cluster
func (*NamespaceImpl) List ¶
func (n *NamespaceImpl) List() (*corev1.NamespaceList, error)
List lists all namespaces within your cluster
type NodesImpl ¶
type NodesImpl struct {
// contains filtered or unexported fields
}
func NewNodesClient ¶
func NewNodesClient(kube kubernetes.Interface) (*NodesImpl, error)
type ServiceMapping ¶
type ServiceMapping interface { Parse(services []v1alpha.Service, name, ns string) (*v1alpha.Mapping, error) List() (*v1alpha.MappingList, error) Get(name string) (*v1alpha.Mapping, error) Create(mapping *v1alpha.Mapping) (*v1alpha.Mapping, error) Update(mapping *v1alpha.Mapping) (*v1alpha.Mapping, error) CreateInCluster() (bool, error) GetDefinition(name string) (*apiextensionv1.CustomResourceDefinition, error) }
type ServiceMappingsImpl ¶
func NewFakeServiceMappingImpl ¶
func NewFakeServiceMappingImpl() (*ServiceMappingsImpl, error)
func NewServiceMappingImpl ¶
func NewServiceMappingImpl(restConfig *rest.Config) (*ServiceMappingsImpl, error)
func (*ServiceMappingsImpl) CreateInCluster ¶
func (s *ServiceMappingsImpl) CreateInCluster() (bool, error)
CreateInCluster retrieves the CRD and will deploy it to the cluster when it's not installed yet.
func (*ServiceMappingsImpl) Get ¶
func (s *ServiceMappingsImpl) Get(name string) (*v1alpha.Mapping, error)
func (*ServiceMappingsImpl) GetDefinition ¶
func (s *ServiceMappingsImpl) GetDefinition(name string) (*apiextensionv1.CustomResourceDefinition, error)
func (*ServiceMappingsImpl) List ¶
func (s *ServiceMappingsImpl) List() (*v1alpha.MappingList, error)
type StorageImpl ¶
type StorageImpl struct {
// contains filtered or unexported fields
}
func NewStorageClient ¶
func NewStorageClient(kube kubernetes.Interface) (*StorageImpl, error)
func (*StorageImpl) DeletePv ¶
func (s *StorageImpl) DeletePv(name string) error
func (*StorageImpl) DeletePvc ¶
func (s *StorageImpl) DeletePvc(namespace, name string) error
func (*StorageImpl) ListPv ¶
func (s *StorageImpl) ListPv() (*corev1.PersistentVolumeList, error)
func (*StorageImpl) ListPvc ¶
func (s *StorageImpl) ListPvc(namespace string) (*corev1.PersistentVolumeClaimList, error)
type UtilImpl ¶
type UtilImpl struct {
// contains filtered or unexported fields
}
func NewUtilClient ¶
func NewUtilClient(kube kubernetes.Interface, namespace string) (*UtilImpl, error)
func (*UtilImpl) CopyFileFromPod ¶
type V1Alpha1 ¶
type V1Alpha1 interface {
ServiceMapping() ServiceMapping
}
type V1Alpha1Impl ¶
type V1Alpha1Impl struct {
// contains filtered or unexported fields
}
func NewV1AlphaClient ¶
func NewV1AlphaClient(restConfig *rest.Config) (*V1Alpha1Impl, error)
func NewV1FakeAlphaClient ¶
func NewV1FakeAlphaClient() (*V1Alpha1Impl, error)
func (*V1Alpha1Impl) ServiceMapping ¶
func (v *V1Alpha1Impl) ServiceMapping() ServiceMapping
type Workload ¶
type Workload interface { List(namespace string) (*corev1.PodList, error) CreatePodSpec(namespace, name, podImage string, command []string) *corev1.Pod DeletePod(namespace, podName string) error CreatePod(namespace string, pod *corev1.Pod) (*corev1.Pod, error) ExecNamedPod(namespace, podName string, command []string) (string, error) GetStatefulSets(namespace string) (*appsv1.StatefulSetList, error) GetPodsBySelector(namespace, selector string) (*corev1.PodList, error) GetPodByName(namespace, name string) (*corev1.Pod, error) CreateDeployment(namespace string, deployment *appsv1.Deployment) (*appsv1.Deployment, error) ListDeployments(namespace string) (*appsv1.DeploymentList, error) UpdateDeploymentViaAnnotation(namespace, name string, annotation map[string]string) (*appsv1.Deployment, error) GetDeployment(namespace, name string) (*appsv1.Deployment, error) GetDeploymentStatus(namespace string) (bool, error) CreateJob(namespace string, spec *batchv1.Job) (*batchv1.Job, error) GetJob(namespace, name string) (*batchv1.Job, error) ListJobs(namespace string) (*batchv1.JobList, error) GetNewLock(lockName, podName, namespace string) *resourcelock.LeaseLock }
type WorkloadImpl ¶
type WorkloadImpl struct {
// contains filtered or unexported fields
}
func NewWorkloadClient ¶
func NewWorkloadClient(kube kubernetes.Interface) (*WorkloadImpl, error)
func (*WorkloadImpl) CreateDeployment ¶
func (w *WorkloadImpl) CreateDeployment(namespace string, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
func (*WorkloadImpl) CreatePodSpec ¶
func (w *WorkloadImpl) CreatePodSpec(namespace, name, podImage string, command []string) *corev1.Pod
func (*WorkloadImpl) DeletePod ¶
func (w *WorkloadImpl) DeletePod(namespace, podName string) error
func (*WorkloadImpl) ExecNamedPod ¶
func (w *WorkloadImpl) ExecNamedPod(namespace, podName string, command []string) (string, error)
func (*WorkloadImpl) GetDeployment ¶
func (w *WorkloadImpl) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
func (*WorkloadImpl) GetDeploymentStatus ¶
func (w *WorkloadImpl) GetDeploymentStatus(namespace string) (bool, error)
func (*WorkloadImpl) GetJob ¶
func (w *WorkloadImpl) GetJob(namespace, name string) (*batchv1.Job, error)
func (*WorkloadImpl) GetNewLock ¶
func (w *WorkloadImpl) GetNewLock(lockName, podName, namespace string) *resourcelock.LeaseLock
func (*WorkloadImpl) GetPodByName ¶
func (w *WorkloadImpl) GetPodByName(namespace, name string) (*corev1.Pod, error)
func (*WorkloadImpl) GetPodsBySelector ¶
func (w *WorkloadImpl) GetPodsBySelector(namespace, selector string) (*corev1.PodList, error)
func (*WorkloadImpl) GetStatefulSets ¶
func (w *WorkloadImpl) GetStatefulSets(namespace string) (*appsv1.StatefulSetList, error)
func (*WorkloadImpl) List ¶
func (w *WorkloadImpl) List(namespace string) (*corev1.PodList, error)
List lists all pods within your cluster
func (*WorkloadImpl) ListDeployments ¶
func (w *WorkloadImpl) ListDeployments(namespace string) (*appsv1.DeploymentList, error)
func (*WorkloadImpl) ListJobs ¶
func (w *WorkloadImpl) ListJobs(namespace string) (*batchv1.JobList, error)
func (*WorkloadImpl) UpdateDeploymentViaAnnotation ¶
func (w *WorkloadImpl) UpdateDeploymentViaAnnotation(namespace, name string, annotation map[string]string) (*appsv1.Deployment, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.