Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) BlueGreenStrategy(_ model.DeploymentRequest) (bool, error)
- func (c *Cluster) CanaryStrategy(_ model.DeploymentRequest) (bool, error)
- func (c *Cluster) Config() error
- func (c *Cluster) Deploy(deploymentRequest model.DeploymentRequest) (bool, error)
- func (c *Cluster) FetchDeploymentStatus(ctx context.Context, namespace, name string, limit int) (bool, error)
- func (c *Cluster) GetApplication(ctx context.Context, namespace, id, name, format string) (model.Application, error)
- func (c *Cluster) GetConfig(ctx context.Context, namespace string) (model.Configs, error)
- func (c *Cluster) GetConfigMap(ctx context.Context, namespace, name string) (model.ConfigMap, error)
- func (c *Cluster) GetDeployment(ctx context.Context, namespace, name string) (model.Deployment, error)
- func (c *Cluster) GetDeployments(ctx context.Context, namespace, label string) ([]model.Deployment, error)
- func (c *Cluster) GetNamespace(ctx context.Context, name string) (model.Namespace, error)
- func (c *Cluster) GetNamespaces(ctx context.Context) ([]model.Namespace, error)
- func (c *Cluster) Override(objects ...runtime.Object)
- func (c *Cluster) PatchDeployment(ctx context.Context, namespace, name, data string) (bool, error)
- func (c *Cluster) Ping(ctx context.Context) (bool, error)
- func (c *Cluster) RampedStrategy(deploymentRequest model.DeploymentRequest) (bool, error)
- func (c *Cluster) RecreateStrategy(deploymentRequest model.DeploymentRequest) (bool, error)
- type Clusters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Name string `mapstructure:",name"` Kubeconfig string `mapstructure:",kubeconfig"` InCluster bool `mapstructure:",inCluster"` ClientSet kubernetes.Interface Fake bool }
Cluster struct
func (*Cluster) BlueGreenStrategy ¶
func (c *Cluster) BlueGreenStrategy(_ model.DeploymentRequest) (bool, error)
BlueGreenStrategy releases a new version alongside the old version then switch traffic.
func (*Cluster) CanaryStrategy ¶
func (c *Cluster) CanaryStrategy(_ model.DeploymentRequest) (bool, error)
CanaryStrategy releases a new version to a subset of users, then proceed to a full rollout.
func (*Cluster) Deploy ¶
func (c *Cluster) Deploy(deploymentRequest model.DeploymentRequest) (bool, error)
Deploy deploys an application
func (*Cluster) FetchDeploymentStatus ¶
func (c *Cluster) FetchDeploymentStatus(ctx context.Context, namespace, name string, limit int) (bool, error)
FetchDeploymentStatus get deployment status
func (*Cluster) GetApplication ¶
func (c *Cluster) GetApplication(ctx context.Context, namespace, id, name, format string) (model.Application, error)
GetApplication gets current application version
func (*Cluster) GetConfigMap ¶
func (c *Cluster) GetConfigMap(ctx context.Context, namespace, name string) (model.ConfigMap, error)
GetConfigMap gets a configmap data
func (*Cluster) GetDeployment ¶
func (c *Cluster) GetDeployment(ctx context.Context, namespace, name string) (model.Deployment, error)
GetDeployment gets a deployment by name
func (*Cluster) GetDeployments ¶
func (c *Cluster) GetDeployments(ctx context.Context, namespace, label string) ([]model.Deployment, error)
GetDeployments gets a list of deployments
func (*Cluster) GetNamespace ¶
GetNamespace gets a namespace by name
func (*Cluster) GetNamespaces ¶
GetNamespaces gets a list of cluster namespaces
func (*Cluster) PatchDeployment ¶
PatchDeployment updates the deployment
func (*Cluster) RampedStrategy ¶
func (c *Cluster) RampedStrategy(deploymentRequest model.DeploymentRequest) (bool, error)
RampedStrategy releases a new version on a rolling update fashion, one after the other.
it will set maxSurge as 25% and maxUnavailable as 25%
This method is like running this command ¶
$ kubectl patch deployment toad-deployment --type=json -p '[
{"op":"replace", "path":"/spec/strategy", "value":{"type":"RollingUpdate"}}, {"op":"replace", "path":"/spec/strategy/rollingUpdate", "value":{"maxSurge":""}}, {"op":"replace", "path":"/spec/strategy/rollingUpdate", "value":{"maxUnavailable":""}}, {"op":"replace","path":"/spec/template/spec/containers/0/image","value":"clivern/toad:release-0.2.4"}
]'
func (*Cluster) RecreateStrategy ¶
func (c *Cluster) RecreateStrategy(deploymentRequest model.DeploymentRequest) (bool, error)
RecreateStrategy terminates the old version and release the new one.
This method is like running this command ¶
$ kubectl patch deployment toad-deployment --type=json -p '[
{"op":"replace", "path":"/spec/strategy", "value":{"type":"Recreate"}}, {"op":"replace","path":"/spec/template/spec/containers/0/image","value":"clivern/toad:release-0.2.4"}
]'