kubernetes

package
v20.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 57 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNamespaceFlag

func AddNamespaceFlag(flags *flag.FlagSet)

AddNamespaceFlag adds the namespace flag to the given flag set

func GetServices

func GetServices(dockerCli *KubeCli, opts options.Services) ([]swarm.Service, error)

GetServices is the kubernetes implementation of listing stack services

func GetStacks

func GetStacks(kubeCli *KubeCli, opts options.List) ([]*formatter.Stack, error)

GetStacks lists the kubernetes stacks

func RunDeploy

func RunDeploy(dockerCli *KubeCli, opts options.Deploy, cfg *composetypes.Config) error

RunDeploy is the kubernetes implementation of docker stack deploy

func RunPS

func RunPS(dockerCli *KubeCli, options options.PS) error

RunPS is the kubernetes implementation of docker stack ps

func RunRemove

func RunRemove(dockerCli *KubeCli, opts options.Remove) error

RunRemove is the kubernetes implementation of docker stack remove

Types

type Factory

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

Factory is the kubernetes client factory

func NewFactory

func NewFactory(namespace string, config *restclient.Config, clientSet *kubeclient.Clientset) (*Factory, error)

NewFactory creates a kubernetes client factory

func (*Factory) ConfigMaps

func (s *Factory) ConfigMaps() corev1.ConfigMapInterface

ConfigMaps returns a client for kubernetes's config maps

func (*Factory) DaemonSets

DaemonSets returns a client for kubernetes daemon sets

func (*Factory) Nodes

func (s *Factory) Nodes() corev1.NodeInterface

Nodes returns a client for kubernetes's nodes

func (*Factory) Pods

func (s *Factory) Pods() corev1.PodInterface

Pods returns a client for kubernetes's pods

func (*Factory) ReplicaSets

func (s *Factory) ReplicaSets() typesappsv1beta2.ReplicaSetInterface

ReplicaSets returns a client for kubernetes replace sets

func (*Factory) ReplicationControllers

func (s *Factory) ReplicationControllers() corev1.ReplicationControllerInterface

ReplicationControllers returns a client for kubernetes replication controllers

func (*Factory) Secrets

func (s *Factory) Secrets() corev1.SecretInterface

Secrets returns a client for kubernetes's secrets

func (*Factory) Services

func (s *Factory) Services() corev1.ServiceInterface

Services returns a client for kubernetes's secrets

func (*Factory) Stacks

func (s *Factory) Stacks(allNamespaces bool) (StackClient, error)

Stacks returns a client for Docker's Stack on Kubernetes

type KubeCli

type KubeCli struct {
	command.Cli
	// contains filtered or unexported fields
}

KubeCli holds kubernetes specifics (client, namespace) with the command.Cli

func WrapCli

func WrapCli(dockerCli command.Cli, opts Options) (*KubeCli, error)

WrapCli wraps command.Cli with kubernetes specifics

type Options

type Options struct {
	Namespace    string
	Config       string
	Orchestrator command.Orchestrator
}

Options contains resolved parameters to initialize kubernetes clients

func NewOptions

func NewOptions(flags *flag.FlagSet, orchestrator command.Orchestrator) Options

NewOptions returns an Options initialized with command line flags

type Stack

type Stack struct {
	Name        string
	Namespace   string
	ComposeFile string
	Spec        *latest.StackSpec
}

Stack is the main type used by stack commands so they remain independent from kubernetes compose component version.

type StackClient

type StackClient interface {
	StackConverter
	CreateOrUpdate(s Stack, childResources []childResource) error
	Delete(name string) error
	Get(name string) (Stack, error)
	List(opts metav1.ListOptions) ([]Stack, error)
	IsColliding(servicesClient corev1.ServiceInterface, s Stack) error
}

StackClient talks to a kubernetes compose component.

type StackConverter

type StackConverter interface {
	FromCompose(stderr io.Writer, name string, cfg *composetypes.Config) (Stack, error)
}

StackConverter converts a compose types.Config to a Stack

func NewStackConverter

func NewStackConverter(version string) (StackConverter, error)

NewStackConverter returns a converter from types.Config (compose) to the specified stack version or error out if the version is not supported or existent.

Jump to

Keyboard shortcuts

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