k8s

package
v0.2.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceAccountName = "kibosh-tiller"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	ClusterDelegate

	CreateNamespaceIfNotExists(*api_v1.Namespace) error
	NamespaceExists(namespaceName string) (bool, error)
	GetSecretsAndServices(namespace string) (map[string][]map[string]interface{}, error)
	SecretExists(namespaceName string, secretName string) (bool, error)
	CreateOrUpdateSecret(namespaceName string, secret *api_v1.Secret) (*api_v1.Secret, error)
}

func GetClusterFromK8sConfig

func GetClusterFromK8sConfig(k8sConfig *k8sAPI.Config) (Cluster, error)

func NewCluster

func NewCluster(kuboConfig *config.ClusterCredentials) (Cluster, error)

func NewClusterFromDefaultConfig

func NewClusterFromDefaultConfig() (Cluster, error)

func NewUnitTestCluster

func NewUnitTestCluster(cd ClusterDelegate) (Cluster, error)

type ClusterDelegate

type ClusterDelegate interface {
	GetClient() kubernetes.Interface
	GetClientConfig() *rest.Config

	GetDeployment(string, string, meta_v1.GetOptions) (*v1_beta1.Deployment, error)
	ListPods(nameSpace string, listOptions meta_v1.ListOptions) (*api_v1.PodList, error)
	CreateNamespace(*api_v1.Namespace) (*api_v1.Namespace, error)
	DeleteNamespace(name string, options *meta_v1.DeleteOptions) error
	GetNamespace(name string, options *meta_v1.GetOptions) (*api_v1.Namespace, error)
	GetNamespaces() (*api_v1.NamespaceList, error)
	ListServiceAccounts(string, meta_v1.ListOptions) (*api_v1.ServiceAccountList, error)
	CreateServiceAccount(string, *api_v1.ServiceAccount) (*api_v1.ServiceAccount, error)
	ListClusterRoleBindings(meta_v1.ListOptions) (*rbacv1beta1.ClusterRoleBindingList, error)
	CreateClusterRoleBinding(*rbacv1beta1.ClusterRoleBinding) (*rbacv1beta1.ClusterRoleBinding, error)
	CreateSecret(nameSpace string, secret *api_v1.Secret) (*api_v1.Secret, error)
	UpdateSecret(nameSpace string, secret *api_v1.Secret) (*api_v1.Secret, error)
	GetSecret(nameSpace string, name string, getOptions meta_v1.GetOptions) (*api_v1.Secret, error)
	ListNodes(listOptions meta_v1.ListOptions) (*api_v1.NodeList, error)
	ListSecrets(nameSpace string, listOptions meta_v1.ListOptions) (*api_v1.SecretList, error)
	ListServices(nameSpace string, listOptions meta_v1.ListOptions) (*api_v1.ServiceList, error)
	Patch(nameSpace string, name string, pt types.PatchType, data []byte, subresources ...string) (result *api_v1.ServiceAccount, err error)
	ListPersistentVolumes(nameSpace string, listOptions meta_v1.ListOptions) (*api_v1.PersistentVolumeClaimList, error)
	ListDeployments(nameSpace string, listOptions meta_v1.ListOptions) (*DeploymentList, error)
}

type ClusterFactory

type ClusterFactory interface {
	DefaultCluster() (Cluster, error)
	GetCluster(creds *config.ClusterCredentials) (Cluster, error)
	GetClusterFromK8sConfig(k8sConfig *k8sAPI.Config) (Cluster, error)
}

func NewClusterFactory

func NewClusterFactory(clusterCredentials config.ClusterCredentials) ClusterFactory

type Deployment

type Deployment struct {
	ReplicaSets *appsv1.ReplicaSet
	Deployment  *appsv1.Deployment
}

type DeploymentList

type DeploymentList struct {
	Items []Deployment
}

type PrivateRegistrySetup

type PrivateRegistrySetup interface {
	Setup() error
}

func NewPrivateRegistrySetup

func NewPrivateRegistrySetup(namespace string, serviceAccount string, cluster Cluster, registryConfig *config.RegistryConfig) PrivateRegistrySetup

type ServiceAccountInstaller

type ServiceAccountInstaller interface {
	Install() error
}

func NewServiceAccountInstaller

func NewServiceAccountInstaller(cluster Cluster, namespace string, logger *logrus.Logger) ServiceAccountInstaller

type ServiceAccountInstallerFactory

type ServiceAccountInstallerFactory interface {
	ServiceAccountInstaller(cluster Cluster) ServiceAccountInstaller
}

func NewServiceAccountInstallerFactory

func NewServiceAccountInstallerFactory(namespace string, logger *logrus.Logger) ServiceAccountInstallerFactory

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL