Documentation ¶
Index ¶
- Constants
- func Delete(c context.Context, containerPreName, containerName string) error
- func DeleteMultiple(c context.Context, request *common.DeleteContainersRequest) error
- func Deploy(c context.Context, dog *dogger.DeploymentLogger, ...) error
- func PodLog(ctx context.Context, request *agent.ContainerLogRequest) (*grpc.ContainerLogContext, error)
- func WaitForRunningDeployment(ctx context.Context, namespace, name string, expectedReplicaCount int32, ...) error
- type Client
- type DeleteFacade
- type DeployFacade
- type DeployFacadeParams
- type DeployIngressOptions
- type Deployment
- func (d *Deployment) DeployDeployment(p *deploymentParams) error
- func (d *Deployment) GetDeployments(ctx context.Context, namespace string, cfg *config.Configuration) (*kappsv1.DeploymentList, error)
- func (d *Deployment) Restart(namespace, name string) error
- func (d *Deployment) Scale(namespace, name string, target int) error
- type DockerConfig
- type DockerConfigEntry
- type DockerConfigJSON
- type KubeContainerLogReader
- type Namespace
- type NamespaceResponse
- type PVC
- type ResourceError
- type Secret
- func (s *Secret) ApplyOpaqueSecret(ctx context.Context, namespace, name string, values map[string][]byte) (version string, err error)
- func (s *Secret) ApplyRegistryAuthSecret(ctx context.Context, namespace, name string, ...) error
- func (s *Secret) GetSecret(namespace, name string) (secretFiles map[string][]byte, version string, err error)
- func (s *Secret) GetValidSecret() (string, error)
- func (s *Secret) ListSecrets(namespace, name string) ([]string, error)
- type Service
- type ServiceMonitor
- type ServiceParams
Constants ¶
View Source
const ( FieldCPU = "CPU" FieldMemory = "Memory" GroupLimits = "Limits" GroupRequests = "Requests" )
View Source
const ( ServiceMonitorKind = "ServiceMonitor" ServiceMonitorVersion = "monitoring.coreos.com/v1" )
View Source
const CraneUpdatedAnnotation = "crane.dyrector.io/restartedAt"
View Source
const LogBufferSize = 2048
View Source
const SecretFileName = "private.key"
Variables ¶
This section is empty.
Functions ¶
func DeleteMultiple ¶
func DeleteMultiple(c context.Context, request *common.DeleteContainersRequest) error
hard-delete if called with prefix name only without container name
func Deploy ¶
func Deploy(c context.Context, dog *dogger.DeploymentLogger, deployImageRequest *v1.DeployImageRequest, versionData *v1.VersionData, ) error
func PodLog ¶
func PodLog(ctx context.Context, request *agent.ContainerLogRequest) (*grpc.ContainerLogContext, error)
Types ¶
type Client ¶
type Client struct { InClusterConfig func() (*rest.Config, error) BuildConfigFromFlags func(masterUrl, kubeconfigPath string) (*rest.Config, error) // contains filtered or unexported fields }
func NewClient ¶
func NewClient(cfg *config.Configuration) *Client
func (*Client) GetClientSet ¶
func (c *Client) GetClientSet() (*kubernetes.Clientset, error)
func (*Client) VerifyAPIResourceExists ¶
type DeleteFacade ¶
type DeleteFacade struct {
// contains filtered or unexported fields
}
func NewDeleteFacade ¶
func NewDeleteFacade(ctx context.Context, namespace, name string, cfg *config.Configuration) *DeleteFacade
func (*DeleteFacade) DeleteConfigMaps ¶
func (d *DeleteFacade) DeleteConfigMaps() error
func (*DeleteFacade) DeleteDeployment ¶
func (d *DeleteFacade) DeleteDeployment() error
func (*DeleteFacade) DeleteIngresses ¶
func (d *DeleteFacade) DeleteIngresses() error
func (*DeleteFacade) DeleteNamespace ¶
func (d *DeleteFacade) DeleteNamespace(namespace string) error
func (*DeleteFacade) DeleteServices ¶
func (d *DeleteFacade) DeleteServices() error
type DeployFacade ¶
type DeployFacade struct { ServiceMonitor *ServiceMonitor // contains filtered or unexported fields }
func NewDeployFacade ¶
func NewDeployFacade(params *DeployFacadeParams, cfg *config.Configuration) *DeployFacade
func (*DeployFacade) CheckPreConditions ¶
func (d *DeployFacade) CheckPreConditions() error
func (*DeployFacade) Clear ¶
func (d *DeployFacade) Clear() error
func (*DeployFacade) Deploy ¶
func (d *DeployFacade) Deploy() error
func (*DeployFacade) PostDeploy ¶
func (d *DeployFacade) PostDeploy() error
type DeployFacadeParams ¶
type DeployFacadeParams struct { Ctx context.Context Image string InstanceConfig v1.InstanceConfig ContainerConfig v1.ContainerConfig RuntimeConfig *string Issuer string // contains filtered or unexported fields }
type DeployIngressOptions ¶
type DeployIngressOptions struct {
// contains filtered or unexported fields
}
type Deployment ¶
type Deployment struct {
// contains filtered or unexported fields
}
facade object for Deployment management
func NewDeployment ¶
func NewDeployment(ctx context.Context, cfg *config.Configuration) *Deployment
func (*Deployment) DeployDeployment ¶
func (d *Deployment) DeployDeployment(p *deploymentParams) error
func (*Deployment) GetDeployments ¶
func (d *Deployment) GetDeployments(ctx context.Context, namespace string, cfg *config.Configuration) (*kappsv1.DeploymentList, error)
func (*Deployment) Restart ¶
func (d *Deployment) Restart(namespace, name string) error
type DockerConfig ¶
type DockerConfig map[string]DockerConfigEntry
DockerConfig represents the config file used by the docker CLI.
type DockerConfigEntry ¶
type DockerConfigEntry struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Email string `json:"email,omitempty"` Auth string `json:"auth,omitempty"` }
DockerConfigEntry holds the user information that grant the access to docker registry
type DockerConfigJSON ¶
type DockerConfigJSON struct {
Auths DockerConfig `json:"auths"`
}
types from kubectl DockerConfigJSON represents a local docker auth config file for pulling images.
type KubeContainerLogReader ¶
type KubeContainerLogReader struct { EventChannel chan grpc.ContainerLogEvent LogStreams []io.ReadCloser ErrorGroup *errgroup.Group grpc.ContainerLogReader }
func (*KubeContainerLogReader) Close ¶
func (kubeReader *KubeContainerLogReader) Close() error
func (*KubeContainerLogReader) Next ¶
func (kubeReader *KubeContainerLogReader) Next() <-chan grpc.ContainerLogEvent
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace wrapper for the facade
func NewNamespaceClient ¶
func (*Namespace) DeleteNamespace ¶
func (*Namespace) DeployNamespace ¶
func (*Namespace) EnsureExists ¶
func (*Namespace) GetNamespaces ¶
func (n *Namespace) GetNamespaces() ([]NamespaceResponse, error)
type NamespaceResponse ¶
type NamespaceResponse struct {
Name string `json:"name" binding:"required"`
}
namespace entity
type PVC ¶
type PVC struct {
// contains filtered or unexported fields
}
facade object for PVC management
func (*PVC) ApplyVolume ¶
func (p *PVC) ApplyVolume(client typedv1.PersistentVolumeClaimInterface, namespace, name string, volume *v1.Volume, volumeType coreV1.PersistentVolumeAccessMode, ) error
type ResourceError ¶
func NewResourceError ¶
func NewResourceError(errorField, errorGroup string, fallback bool) ResourceError
func (ResourceError) Error ¶
func (resourceError ResourceError) Error() string
type Secret ¶
type Secret struct {
// contains filtered or unexported fields
}
namespace wrapper for the facade
func (*Secret) ApplyOpaqueSecret ¶
func (*Secret) ApplyRegistryAuthSecret ¶
func (s *Secret) ApplyRegistryAuthSecret(ctx context.Context, namespace, name string, credentials *imageHelper.RegistryAuth, appConfig *config.Configuration, ) error
func (*Secret) GetValidSecret ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
facade object for Service management
func (*Service) DeployService ¶
func (s *Service) DeployService(params *ServiceParams) error
func (*Service) GetServices ¶
func (s *Service) GetServices(namespace string) (*corev1.ServiceList, error)
type ServiceMonitor ¶
type ServiceMonitor struct { Ctx context.Context Client *Client ClientSet *versionedv1.Clientset // contains filtered or unexported fields }
func NewServiceMonitor ¶
func NewServiceMonitor(ctx context.Context, cli *Client) (*ServiceMonitor, error)
service monitor is spawned per deployment
func (*ServiceMonitor) Cleanup ¶
func (sm *ServiceMonitor) Cleanup(namespace, serviceName string) error
cleanup ignores errors, expected to run if no metrics were defined
type ServiceParams ¶
Click to show internal directories.
Click to hide internal directories.