Documentation ¶
Index ¶
- Variables
- func GetKubeConfigPath() (string, error)
- type Client
- func (k *Client) AddDataToConfigMap(ctx context.Context, namespace, mapName, key, value string) error
- func (k *Client) ConnectToStoreExternal(creds *config.EtcdCredentials, endpoints []string) error
- func (k *Client) ConnectToStoreInternal() error
- func (k *Client) CreateClusterRoleBinding(ctx context.Context, namespace, name string) error
- func (k *Client) CreateConfigMap(ctx context.Context, namespace, name string) error
- func (k *Client) CreateExecInPod(ctx context.Context, namespace, podName, command string, stdin io.Reader, ...) error
- func (k *Client) CreateGraderDeployment(ctx context.Context, namespace, deploymentName string, replicas int32) error
- func (k *Client) CreateHeadlessService(ctx context.Context, identifier *config.KubeRessourceIdentifier) error
- func (k *Client) CreateIngress(ctx context.Context, namespace string) error
- func (k *Client) CreateNamespace(ctx context.Context, namespace string) error
- func (k *Client) CreatePersistentVolume(ctx context.Context, identifier *config.KubeRessourceIdentifier) error
- func (k *Client) CreatePersistentVolumeClaim(ctx context.Context, identifier *config.KubeRessourceIdentifier) error
- func (k *Client) CreatePodPortForward(ctx context.Context, namespace, podName, podPort string, channel ssh.Channel) error
- func (k *Client) CreateSSHDeployment(ctx context.Context, namespace, deploymentName string, replicas int32) error
- func (k *Client) CreateSecret(ctx context.Context, name string) error
- func (k *Client) CreateServiceAccount(ctx context.Context, namespace, serviceAccountName string) error
- func (k *Client) CreateServiceClusterIP(ctx context.Context, namespace, serviceName string, portNum int) error
- func (k *Client) CreateServiceLoadBalancer(ctx context.Context, namespace, serviceName string, portNum int) error
- func (k *Client) CreateStorageClass(ctx context.Context, name string, ...) error
- func (k *Client) CreateUserRessources(ctx context.Context, identifier *config.KubeRessourceIdentifier) error
- func (k *Client) CreateUserStatefulSet(ctx context.Context, identifier *config.KubeRessourceIdentifier) error
- func (k *Client) DownloadSSHServerPrivKey(privKey []byte) (err error)
- func (k *Client) GetConfigMapData(ctx context.Context, namespace, mapName string) (map[string]string, error)
- func (k *Client) GetPod(ctx context.Context, namespace, podName string) (*v1.Pod, error)
- func (k *Client) GetService(ctx context.Context, namespace, serviceName string) (*coreAPI.Service, error)
- func (k *Client) GetStore() (store.Store, error)
- func (k *Client) GetStoreUserData() (data *config.UserConfiguration, err error)
- func (k *Client) ListPods(ctx context.Context, namespace string) error
- func (k *Client) NamespaceExists(ctx context.Context, namespace string) (bool, error)
- func (k *Client) UploadSSHServerPrivKey(privKey []byte) (err error)
- func (k *Client) UserRessourcesExist(ctx context.Context, namespace, statefulSetName string) (bool, error)
- func (k *Client) WaitForPodRunning(ctx context.Context, namespace, podName string, timeout time.Duration) error
- func (k *Client) WaitForStatefulSet(ctx context.Context, namespace, statefulSetName string, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
var ErrNotConnected = errors.New("client is not connected to etcd")
ErrNotConnected is returned when the client is not connected to etcd.
Functions ¶
func GetKubeConfigPath ¶
GetKubeConfigPath returns the path to the kubeconfig file.
Types ¶
type Client ¶
type Client struct { Client kubernetes.Interface RestConfig *rest.Config // contains filtered or unexported fields }
Client is the struct used to access kubernetes helpers.
func NewClient ¶
NewClient returns a new kuberenetes client-go wrapper. if no kubeconfig path is given we use the service account token.
func (*Client) AddDataToConfigMap ¶
func (k *Client) AddDataToConfigMap(ctx context.Context, namespace, mapName, key, value string) error
AddDataToConfigMap adds data do a given configmap.
func (*Client) ConnectToStoreExternal ¶
func (k *Client) ConnectToStoreExternal(creds *config.EtcdCredentials, endpoints []string) error
ConnectToStoreExternal connects to the etcd store.
func (*Client) ConnectToStoreInternal ¶
GetStore returns a store backed by kube etcd. Its only supposed to used within a kubernetes pod. Before calling this the installer needs to populate a config map with the respective credentials. Furthermore a serviceaccount must be set up for the namespace and it needs to be attached to the running pod.
func (*Client) CreateClusterRoleBinding ¶
CreateClusterRoleBinding creates a clusterRoleBinding.
func (*Client) CreateConfigMap ¶
CreateConfigMap creates a configmap.
func (*Client) CreateExecInPod ¶
func (k *Client) CreateExecInPod(ctx context.Context, namespace, podName, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer, resizeQueue remotecommand.TerminalSizeQueue, tty bool) error
CreateExecInPod creates a shell on the specified pod.
func (*Client) CreateGraderDeployment ¶
func (k *Client) CreateGraderDeployment(ctx context.Context, namespace, deploymentName string, replicas int32) error
CreateGraderDeployment creates a Grade Server deployment.
func (*Client) CreateHeadlessService ¶
func (k *Client) CreateHeadlessService(ctx context.Context, identifier *config.KubeRessourceIdentifier) error
CreateHeadlessService creates a service.
func (*Client) CreateIngress ¶
CreateIngress creates an ingress.
func (*Client) CreateNamespace ¶
CreateNamespace creates a namespace.
func (*Client) CreatePersistentVolume ¶
func (k *Client) CreatePersistentVolume(ctx context.Context, identifier *config.KubeRessourceIdentifier) error
CreatePersistentVolume creates a persistent volume.
func (*Client) CreatePersistentVolumeClaim ¶
func (k *Client) CreatePersistentVolumeClaim(ctx context.Context, identifier *config.KubeRessourceIdentifier) error
CreatePersistentVolumeClaim creates a persistent volume claim.
func (*Client) CreatePodPortForward ¶
func (k *Client) CreatePodPortForward(ctx context.Context, namespace, podName, podPort string, channel ssh.Channel) error
CreatePodPortForward creates a port forward to a pod.
func (*Client) CreateSSHDeployment ¶
func (k *Client) CreateSSHDeployment(ctx context.Context, namespace, deploymentName string, replicas int32) error
CreateSSHDeployment creates a SSH Server deployment.
func (*Client) CreateSecret ¶
CreateSecret creates a secret.
func (*Client) CreateServiceAccount ¶
func (k *Client) CreateServiceAccount(ctx context.Context, namespace, serviceAccountName string) error
CreateServiceAccount creates a serviceAccount.
func (*Client) CreateServiceClusterIP ¶
func (k *Client) CreateServiceClusterIP(ctx context.Context, namespace, serviceName string, portNum int) error
CreateServiceClusterIP creates a ClusterIP service.
func (*Client) CreateServiceLoadBalancer ¶
func (k *Client) CreateServiceLoadBalancer(ctx context.Context, namespace, serviceName string, portNum int) error
CreateServiceLoadBalancer creates a LoadBalancer service.
func (*Client) CreateStorageClass ¶
func (k *Client) CreateStorageClass(ctx context.Context, name string, reclaimPolicy coreAPI.PersistentVolumeReclaimPolicy) error
CreateStorageClass creates a persistent volume claim.
func (*Client) CreateUserRessources ¶
func (k *Client) CreateUserRessources(ctx context.Context, identifier *config.KubeRessourceIdentifier) error
CreateUserRessources creates want waits for the statefulSet.
func (*Client) CreateUserStatefulSet ¶
func (k *Client) CreateUserStatefulSet(ctx context.Context, identifier *config.KubeRessourceIdentifier) error
CreateUserStatefulSet creates a statefulset.
func (*Client) DownloadSSHServerPrivKey ¶
DownloadSSHServerPrivKey downloads the ssh server private key from the store.
func (*Client) GetConfigMapData ¶
func (k *Client) GetConfigMapData(ctx context.Context, namespace, mapName string) (map[string]string, error)
GetConfigMapData gets data from a given configmap.
func (*Client) GetService ¶
func (k *Client) GetService(ctx context.Context, namespace, serviceName string) (*coreAPI.Service, error)
GetService gets a service.
func (*Client) GetStoreUserData ¶
func (k *Client) GetStoreUserData() (data *config.UserConfiguration, err error)
GetStoreUserData saves the relevant store data to a config file.
func (*Client) NamespaceExists ¶
NamespaceExists creates a namespace.
func (*Client) UploadSSHServerPrivKey ¶
UploadSSHServerPrivKey uploads the ssh server private key to the store.
func (*Client) UserRessourcesExist ¶
func (k *Client) UserRessourcesExist(ctx context.Context, namespace, statefulSetName string) (bool, error)
UserRessourcesExist checks if the statefulset exists.