helm

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Provider       = constants.ProviderKubernetes
	ProviderConfig = `
provider_type: helm
enable: true
`
)
View Source
const (
	RuntimeAnnotationKey = "openpitrix_runtime"

	DeploymentFlag  = "-Deployment"
	StatefulSetFlag = "-StatefulSet"
	DaemonSetFlag   = "-DaemonSet"
	Driver          = "configmap"
)
View Source
const (
	Type       = "type"
	ExternalIp = "external_ip"
)

Variables

View Source
var (
	NamespaceReg    = `^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
	NamespaceRegExp = regexp.MustCompile(NamespaceReg)

	ClusterNameReg    = `^[a-z]([-a-z0-9]*[a-z0-9])?$`
	ClusterNameRegExp = regexp.MustCompile(ClusterNameReg)
)

Codecs provides access to encoding and decoding for the scheme

ParameterCodec handles versioning of objects that are converted to query parameters.

View Source
var Scheme = runtime.NewScheme()

Scheme is the default instance of runtime.Scheme to which types in the Kubernetes API are already registered. NOTE: If you are copying this file to start a new api group, STOP! Copy the extensions group instead. This Scheme is special and should appear ONLY in the api group, unless you really know what you're doing. TODO(lavalamp): make the above error impossible.

Functions

func AppInstall

func AppInstall(scheme *runtime.Scheme)

func ConvertJsonToYaml

func ConvertJsonToYaml(data []byte) ([]byte, error)

func CreateRelease

func CreateRelease(cfg *action.Configuration, releaseName, ns string, ch *chart.Chart, vals map[string]interface{}) (*release.Release, error)

func DeleteRelease

func DeleteRelease(cfg *action.Configuration, name string, keepHistory bool) error

func ExtensionInstall

func ExtensionInstall(scheme *runtime.Scheme)

func GetLabelString

func GetLabelString(m map[string]string) string

func GetRelease

func GetRelease(cfg *action.Configuration, releaseName string) (*release.Release, error)

func GetStringFromValues

func GetStringFromValues(vals map[string]interface{}, key string) (string, bool)

func ListReleases

func ListReleases(cfg *action.Configuration, releaseName, ns, status string) ([]*release.Release, error)

func RollbackRelease

func RollbackRelease(cfg *action.Configuration, name string, revision int32) (*release.Release, error)

func Serve

func Serve(cfg *config.Config)

func UpgradeRelease

func UpgradeRelease(cfg *action.Configuration, name string, ch *chart.Chart, vals map[string]interface{}) (*release.Release, error)

Types

type JobDirective

type JobDirective struct {
	Namespace   string
	RuntimeId   string
	Values      string
	ClusterName string
}

type Parser

type Parser struct {
	Chart     *chart.Chart
	Conf      string
	VersionId string
	RuntimeId string
	Namespace string
	// contains filtered or unexported fields
}

func (*Parser) Parse

func (p *Parser) Parse(clusterWrapper *models.ClusterWrapper, appId string) error

type Proxy

type Proxy struct {
	RuntimeId    string
	WorkloadInfo *Workload
	// contains filtered or unexported fields
}

Helm kubernetes proxy

func NewProxy

func NewProxy(ctx context.Context, runtimeId string) *Proxy

func (*Proxy) CheckApiVersionsSupported

func (proxy *Proxy) CheckApiVersionsSupported(apiVersions []string) error

func (*Proxy) CheckClusterNameIsUnique

func (proxy *Proxy) CheckClusterNameIsUnique(clusterName, namespace string) error

func (*Proxy) DeleteRelease

func (proxy *Proxy) DeleteRelease(cfg *action.Configuration, releaseName string, purge bool, namespace string) error

func (*Proxy) DescribeClusterDetails

func (proxy *Proxy) DescribeClusterDetails(clusterWrapper *models.ClusterWrapper) error

func (*Proxy) DescribeRuntimeProviderZones

func (proxy *Proxy) DescribeRuntimeProviderZones(runtimeCredential *models.RuntimeCredential) ([]string, error)

func (*Proxy) DescribeVersionInfo

func (proxy *Proxy) DescribeVersionInfo() (*version.Info, error)

func (*Proxy) GetHelmConfig

func (proxy *Proxy) GetHelmConfig(namespace string) (*action.Configuration, error)

func (*Proxy) GetKubeClient

func (proxy *Proxy) GetKubeClient() (*kubernetes.Clientset, *rest.Config, error)

func (*Proxy) GetKubeClientWithCredential

func (proxy *Proxy) GetKubeClientWithCredential(credential string) (*kubernetes.Clientset, *rest.Config, error)

func (*Proxy) InstallReleaseFromChart

func (proxy *Proxy) InstallReleaseFromChart(cfg *action.Configuration, c *chart.Chart, rawVals map[string]interface{}, releaseName, namespace string) error

func (*Proxy) ListRelease

func (proxy *Proxy) ListRelease(cfg *action.Configuration, name string) (*release.Release, error)

func (*Proxy) ReleaseStatus

func (proxy *Proxy) ReleaseStatus(cfg *action.Configuration, releaseName string) (release.Status, error)

func (*Proxy) RollbackRelease

func (proxy *Proxy) RollbackRelease(cfg *action.Configuration, releaseName string) error

func (*Proxy) UpdateReleaseFromChart

func (proxy *Proxy) UpdateReleaseFromChart(cfg *action.Configuration, releaseName string, c *chart.Chart, rawVals map[string]interface{}, namespace string) error

func (*Proxy) ValidateRuntime

func (proxy *Proxy) ValidateRuntime(zone string, runtimeCredential *models.RuntimeCredential, needCreate bool) error

func (*Proxy) WaitWorkloadReady

func (proxy *Proxy) WaitWorkloadReady(runtimeId, namespace string, clusterRoles map[string]*models.ClusterRole, timeout time.Duration, waitInterval time.Duration) error

type Server

type Server struct {
	runtimeprovider.Server
}

func (*Server) CheckResource

func (p *Server) CheckResource(ctx context.Context, req *pb.CheckResourceRequest) (*pb.CheckResourceResponse, error)

func (*Server) DescribeSubnets

func (p *Server) DescribeSubnets(ctx context.Context, req *pb.DescribeSubnetsRequest) (*pb.DescribeSubnetsResponse, error)

func (*Server) DescribeVpc

func (p *Server) DescribeVpc(ctx context.Context, req *pb.DescribeVpcRequest) (*pb.DescribeVpcResponse, error)

func (*Server) DescribeZones

func (p *Server) DescribeZones(ctx context.Context, req *pb.DescribeZonesRequest) (*pb.DescribeZonesResponse, error)

func (*Server) HandleSubtask

func (s *Server) HandleSubtask(ctx context.Context, req *pb.HandleSubtaskRequest) (*pb.HandleSubtaskResponse, error)

func (*Server) ParseClusterConf

func (p *Server) ParseClusterConf(ctx context.Context, req *pb.ParseClusterConfRequest) (*pb.ParseClusterConfResponse, error)

func (*Server) SplitJobIntoTasks

func (p *Server) SplitJobIntoTasks(ctx context.Context, req *pb.SplitJobIntoTasksRequest) (*pb.SplitJobIntoTasksResponse, error)

func (*Server) ValidateRuntime

func (p *Server) ValidateRuntime(ctx context.Context, req *pb.ValidateRuntimeRequest) (*pb.ValidateRuntimeResponse, error)

func (*Server) WaitSubtask

func (s *Server) WaitSubtask(ctx context.Context, req *pb.WaitSubtaskRequest) (*pb.WaitSubtaskResponse, error)

type TaskDirective

type TaskDirective struct {
	VersionId         string
	Namespace         string
	RuntimeId         string
	Values            string
	ClusterName       string
	RawClusterWrapper string
}

type Workload

type Workload struct {
	Deployments  []appsv1.Deployment  `json:"deployments,omitempty" description:"deployment list"`
	Statefulsets []appsv1.StatefulSet `json:"statefulsets,omitempty" description:"statefulset list"`
	Daemonsets   []appsv1.DaemonSet   `json:"daemonsets,omitempty" description:"daemonset list"`
	Services     []corev1.Service     `json:"services,omitempty" description:"application services"`
	Ingresses    []v1beta1.Ingress    `json:"ingresses,omitempty" description:"application ingresses"`
}

Jump to

Keyboard shortcuts

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