k8s

package
v0.0.0-...-e218867 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidServiceType = errors.New("Invalid service type")
	ErrNotFound           = status.Errorf(codes.NotFound, "Resource not found")
	ErrPodRunFailed       = status.Errorf(codes.Aborted, "Pod went into failed status")
	ErrPodStillRunning    = status.Errorf(codes.Unknown, "Pod still running")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(conf *Config) (*Client, error)

func (*Client) AddressList

func (k *Client) AddressList(namespace string) ([]*app.Address, error)

func (*Client) Autoscale

func (k *Client) Autoscale(namespace string) (*app.Autoscale, error)

func (*Client) CloudProviderName

func (c *Client) CloudProviderName() (string, error)

func (*Client) ContainerExplicitEnvVars

func (c *Client) ContainerExplicitEnvVars(namespace, deployName, containerName string) ([]*app.EnvVar, error)

func (*Client) CreateNamespace

func (k *Client) CreateNamespace(a *app.App, user string) error

func (*Client) CreateOrUpdateAutoscale

func (k *Client) CreateOrUpdateAutoscale(a *app.App) error

func (*Client) CreateOrUpdateConfigMap

func (k *Client) CreateOrUpdateConfigMap(namespace, name string, data map[string]string) error

func (*Client) CreateOrUpdateCronJob

func (c *Client) CreateOrUpdateCronJob(cronJobSpec *spec.CronJob) error

func (*Client) CreateOrUpdateCronJobEnvVars

func (c *Client) CreateOrUpdateCronJobEnvVars(namespace, name string, evs []*app.EnvVar) error

func (*Client) CreateOrUpdateCronJobSecretEnvVars

func (c *Client) CreateOrUpdateCronJobSecretEnvVars(namespace, name, secretName string, secrets []string) error

func (*Client) CreateOrUpdateCronJobSecretFile

func (c *Client) CreateOrUpdateCronJobSecretFile(namespace, cronjob, fileName string) error

func (*Client) CreateOrUpdateDeploy

func (k *Client) CreateOrUpdateDeploy(deploySpec *spec.Deploy) error

func (*Client) CreateOrUpdateDeployEnvVars

func (c *Client) CreateOrUpdateDeployEnvVars(namespace, name string, evs []*app.EnvVar) error

func (*Client) CreateOrUpdateDeploySecretEnvVars

func (c *Client) CreateOrUpdateDeploySecretEnvVars(namespace, name, secretName string, secrets []string) error

func (*Client) CreateOrUpdateDeploySecretFile

func (c *Client) CreateOrUpdateDeploySecretFile(namespace, deploy, filename string) error

func (*Client) CreateOrUpdateSecret

func (c *Client) CreateOrUpdateSecret(namespace, secretName string, data map[string][]byte) error

func (*Client) CreateQuota

func (k *Client) CreateQuota(a *app.App) error

func (*Client) CreateService

func (k *Client) CreateService(svcSpec *spec.Service) error

func (*Client) DeleteConfigMap

func (k *Client) DeleteConfigMap(namespace, name string) error

func (*Client) DeleteCronJobEnvVars

func (k *Client) DeleteCronJobEnvVars(namespace, name string, evNames []string) error

func (*Client) DeleteCronJobSecrets

func (c *Client) DeleteCronJobSecrets(namespace, cronjob string, envVars, volKeys []string) error

func (*Client) DeleteDeployEnvVars

func (k *Client) DeleteDeployEnvVars(namespace, name string, evNames []string) error

func (*Client) DeleteDeploySecrets

func (c *Client) DeleteDeploySecrets(namespace, deploy string, envVars, volKeys []string) error

func (*Client) DeleteNamespace

func (k *Client) DeleteNamespace(namespace string) error

func (*Client) DeletePod

func (k *Client) DeletePod(namespace, podName string) error

func (*Client) DeleteService

func (k *Client) DeleteService(namespace, name string) error

func (*Client) DeployAnnotation

func (k *Client) DeployAnnotation(namespace, deployName, annotation string) (string, error)

func (*Client) DeployRollbackToRevision

func (k *Client) DeployRollbackToRevision(namespace, name, revision string) error

func (*Client) DeploySetReplicas

func (k *Client) DeploySetReplicas(namespace, name string, replicas int32) error

func (*Client) ExposeDeploy

func (k *Client) ExposeDeploy(namespace, appName, svcType, portName string, vHosts []string, reserveStaticIp bool, w io.Writer) error

ExposeDeploy creates a service and/or a ingress if needed

func (*Client) GetSecret

func (c *Client) GetSecret(namespace, secretName string) (map[string][]byte, error)

func (*Client) HasIngress

func (k *Client) HasIngress(namespace, appName string) (bool, error)

func (*Client) HealthCheck

func (k *Client) HealthCheck() error

func (*Client) IngressAnnotations

func (c *Client) IngressAnnotations(namespace, ingName string) (map[string]string, error)

func (*Client) IngressEnabled

func (c *Client) IngressEnabled() bool

func (*Client) IsAlreadyExists

func (k *Client) IsAlreadyExists(err error) bool

func (*Client) IsInvalid

func (k *Client) IsInvalid(err error) bool

func (*Client) IsNotFound

func (k *Client) IsNotFound(err error) bool

func (*Client) IsUnknown

func (k *Client) IsUnknown(err error) bool

func (*Client) Limits

func (k *Client) Limits(namespace, name string) (*app.Limits, error)

func (*Client) NamespaceAnnotation

func (k *Client) NamespaceAnnotation(namespace, annotation string) (string, error)

func (*Client) NamespaceLabel

func (k *Client) NamespaceLabel(namespace, label string) (string, error)

func (*Client) NamespaceListByLabel

func (k *Client) NamespaceListByLabel(label, value string) ([]string, error)

func (*Client) PodList

func (k *Client) PodList(namespace string, opts *app.PodListOptions) ([]*app.Pod, error)

func (*Client) PodLogs

func (k *Client) PodLogs(namespace string, podName string, opts *app.LogOptions) (io.ReadCloser, error)

func (*Client) PodRun

func (k *Client) PodRun(podSpec *spec.Pod) (io.ReadCloser, <-chan int, error)

func (*Client) ReplicaSetListByLabel

func (k *Client) ReplicaSetListByLabel(namespace, label, value string) ([]*deploy.ReplicaSetListItem, error)

func (*Client) ResumeCronJob

func (k *Client) ResumeCronJob(namespace, name string) error

func (*Client) Service

func (c *Client) Service(namespace, svcName string) (*spec.Service, error)

func (*Client) ServiceAnnotations

func (c *Client) ServiceAnnotations(namespace, svcName string) (map[string]string, error)

func (*Client) SetIngressAnnotations

func (c *Client) SetIngressAnnotations(namespace, ingName string, annotations map[string]string) error

func (*Client) SetLoadBalancerSourceRanges

func (c *Client) SetLoadBalancerSourceRanges(namespace, svcName string, sourceRanges []string) error

func (*Client) SetNamespaceAnnotations

func (k *Client) SetNamespaceAnnotations(namespace string, annotations map[string]string) error

func (*Client) SetNamespaceLabels

func (k *Client) SetNamespaceLabels(namespace string, labels map[string]string) error

func (*Client) SetServiceAnnotations

func (c *Client) SetServiceAnnotations(namespace, svcName string, annotations map[string]string) error

func (*Client) Status

func (k *Client) Status(namespace string) (*app.Status, error)

func (*Client) SuspendCronJob

func (k *Client) SuspendCronJob(namespace, name string) error

func (*Client) UpdateIngress

func (k *Client) UpdateIngress(namespace, name string, vHosts []string, reserveStaticIp bool) error

func (*Client) UpdateServicePorts

func (c *Client) UpdateServicePorts(namespace, svcName string, ports []spec.ServicePort) error

func (*Client) WatchDeploy

func (c *Client) WatchDeploy(namespace, deployName string) error

func (*Client) WatchServiceURL

func (c *Client) WatchServiceURL(namespace, name string) ([]string, error)

type Config

type Config struct {
	ConfigFile    string        `split_words:"true"`
	PodRunTimeout time.Duration `split_words:"true" default:"30m"`
	Ingress       bool          `split_words:"true" default:"false"`
}

Jump to

Keyboard shortcuts

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