Documentation ¶
Index ¶
- Constants
- func ApplyFile(file string) error
- func ApplyFileWithNamespace(file, namespace string) error
- func ApplyLable(itemType, itemName, labelName string, overWrite bool) error
- func CreateClusterRoleBinding(clusterRole, user string) error
- func CreateConfigMapWithNamespace(name, confFile, namespace string) error
- func CreateFile(file string) error
- func DefaultConfigDir() (string, error)
- func DefaultConfigFile() (string, error)
- func DeleteAllCells() error
- func DeleteCell(cellInstance string) (string, error)
- func DeleteFile(file string) error
- func DeleteFileWithNamespace(file, namespace string) error
- func DeleteNameSpace(nameSpace string) error
- func DeletePersistedVolume(persistedVolume string) error
- func DeleteResource(kind, instance string) (string, error)
- func Describe(cellName string) error
- func GetCellInstanceAsMapInterface(cell string) (map[string]interface{}, error)
- func GetCellLogs(cellName string) (string, error)
- func GetComponentLogs(cellName, componentName string) (string, error)
- func GetCompositeInstanceAsMapInterface(composite string) (map[string]interface{}, error)
- func GetContext() (string, error)
- func GetContexts() ([]byte, error)
- func GetDeployment(namespace, deployment string) (string, error)
- func GetDeploymentNames(namespace string) ([]string, error)
- func GetGatewayAsMapInterface(gw string) (map[string]interface{}, error)
- func GetInstanceBytes(instanceKind, InstanceName string) ([]byte, error)
- func GetMasterNodeName() (string, error)
- func JsonPatch(kind, instance, jsonPatch string) error
- func SetVerboseMode(enable bool)
- func UseContext(context string) error
- func WaitForCluster(timeout time.Duration) error
- func WaitForCondition(condition string, timeoutSeconds int, resourceName string, namespace string) error
- func WaitForDeployment(condition string, timeoutSeconds int, resourceName string, namespace string) error
- func WaitForDeployments(namespace string, timeout time.Duration) error
- func WriteConfig(file string, conf *Config) error
- type APIDefinition
- type AuthInfo
- type AuthProviderConfig
- type Authority
- type AutoScalingPolicy
- type AutoscalePolicy
- type AutoscalePolicyMetadata
- type AutoscalePolicySpec
- type Cell
- type CellAnnotations
- type CellSpec
- type CellStatus
- type Cells
- type Cluster
- type ClusterInfo
- type ComponentScalePolicy
- type ComponentTemplate
- type ComponentTemplateMetadata
- type ComponentTemplateSpec
- type Composite
- type CompositeSpec
- type CompositeStatus
- type Composites
- type Config
- type ContainerTemplate
- type Context
- type ContextInfo
- type Destination
- type Env
- type ExecConfig
- type ExecEnvVar
- type Gateway
- type GatewayDefinition
- type GatewayGrpcApi
- type GatewayHttpApi
- type GatewaySpec
- type GatewayTcpApi
- type GwScalePolicy
- type HTTP
- type HTTPMatch
- type HTTPRoute
- type Ingress
- type InstanceKind
- type K8SMetaData
- type Metric
- type Node
- type NodeInfo
- type NodeItem
- type NodeMetaData
- type NodeStatus
- type Pod
- type PodCondition
- type PodMetaData
- type PodStatus
- type PodTemplate
- type Pods
- type Policy
- type Port
- type Preferences
- type Resource
- type ScaleResource
- type ScaleTargetRef
- type ScalingPolicy
- type Service
- type ServiceMetaData
- type ServicePort
- type ServiceSpec
- type Services
- type StringMatch
- type TCP
- type TCPDestination
- type TCPMatch
- type TCPPort
- type TCPRoute
- type UserInfo
- type VirtualService
- type VsMetaData
- type VsSpec
Constants ¶
const VerboseMode = "verbose"
Variables ¶
This section is empty.
Functions ¶
func ApplyFileWithNamespace ¶
func ApplyLable ¶ added in v0.2.1
func CreateClusterRoleBinding ¶ added in v0.2.1
func CreateFile ¶
func DefaultConfigDir ¶
func DefaultConfigFile ¶
func DeleteAllCells ¶
func DeleteAllCells() error
func DeleteCell ¶ added in v0.3.0
func DeleteFile ¶
func DeleteFileWithNamespace ¶
func DeleteNameSpace ¶
func DeletePersistedVolume ¶
func DeleteResource ¶ added in v0.3.0
func GetCellInstanceAsMapInterface ¶ added in v0.3.0
func GetCellLogs ¶ added in v0.3.0
func GetComponentLogs ¶ added in v0.3.0
func GetCompositeInstanceAsMapInterface ¶ added in v0.4.0
func GetContext ¶ added in v0.3.0
func GetContexts ¶ added in v0.3.0
func GetDeployment ¶ added in v0.3.0
func GetDeploymentNames ¶
func GetGatewayAsMapInterface ¶ added in v0.3.0
func GetInstanceBytes ¶ added in v0.4.0
func GetMasterNodeName ¶
func SetVerboseMode ¶ added in v0.3.0
func SetVerboseMode(enable bool)
func UseContext ¶ added in v0.2.1
func WaitForCluster ¶
func WaitForCondition ¶
func WaitForDeployment ¶
func WriteConfig ¶
Types ¶
type APIDefinition ¶ added in v0.4.0
type AuthInfo ¶
type AuthInfo struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. LocationOfOrigin string `json:"-"` // ClientCertificate is the path to a client cert file for TLS. // +optional ClientCertificate string `json:"client-certificate,omitempty"` // ClientCertificateData contains PEM-encoded data from a client cert file for TLS. Overrides ClientCertificate // +optional ClientCertificateData []byte `json:"client-certificate-data,omitempty"` // ClientKey is the path to a client key file for TLS. // +optional ClientKey string `json:"client-key,omitempty"` // ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey // +optional ClientKeyData []byte `json:"client-key-data,omitempty"` // Token is the bearer token for authentication to the kubernetes cluster. // +optional Token string `json:"token,omitempty"` // TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence. // +optional TokenFile string `json:"tokenFile,omitempty"` // Impersonate is the username to act-as. // +optional Impersonate string `json:"act-as,omitempty"` // ImpersonateGroups is the groups to imperonate. // +optional ImpersonateGroups []string `json:"act-as-groups,omitempty"` // ImpersonateUserExtra contains additional information for impersonated user. // +optional ImpersonateUserExtra map[string][]string `json:"act-as-user-extra,omitempty"` // Username is the username for basic authentication to the kubernetes cluster. // +optional Username string `json:"username,omitempty"` // Password is the password for basic authentication to the kubernetes cluster. // +optional Password string `json:"password,omitempty"` // AuthProvider specifies a custom authentication plugin for the kubernetes cluster. // +optional AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"` // Exec specifies a custom exec-based authentication plugin for the kubernetes cluster. // +optional Exec *ExecConfig `json:"exec,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]interface{} `json:"extensions,omitempty"` }
AuthInfo contains information that describes identity information. This is use to tell the kubernetes cluster who you are.
type AuthProviderConfig ¶
type AuthProviderConfig struct { Name string `json:"name"` // +optional Config map[string]string `json:"config,omitempty"` }
AuthProviderConfig holds the configuration for a specified auth provider.
type AutoScalingPolicy ¶ added in v0.4.0
type AutoScalingPolicy struct { Components []ComponentScalePolicy `json:"components,omitempty"` Gateway GwScalePolicy `json:"gateway,omitempty"` }
type AutoscalePolicy ¶ added in v0.3.0
type AutoscalePolicy struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` Metadata AutoscalePolicyMetadata `json:"metadata"` Spec AutoscalePolicySpec `json:"spec"` }
func GetAutoscalePolicy ¶ added in v0.3.0
func GetAutoscalePolicy(autoscalepolicy string) (*AutoscalePolicy, error)
type AutoscalePolicyMetadata ¶ added in v0.3.0
type AutoscalePolicyMetadata struct {
Name string `json:"name"`
}
type AutoscalePolicySpec ¶ added in v0.3.0
type Cell ¶ added in v0.3.0
type Cell struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` CellMetaData K8SMetaData `json:"metadata"` CellSpec CellSpec `json:"spec"` CellStatus CellStatus `json:"status"` }
type CellAnnotations ¶ added in v0.3.0
type CellAnnotations struct { Organization string `json:"mesh.cellery.io/cell-image-org"` Name string `json:"mesh.cellery.io/cell-image-name"` Version string `json:"mesh.cellery.io/cell-image-version"` Dependencies string `json:"mesh.cellery.io/cell-dependencies"` ApiVersion string `json:"mesh.cellery.io/apiVersion"` OriginalDependencyComponentServices string `json:"mesh.cellery.io/original-component-svcs,omitempty"` }
type CellSpec ¶ added in v0.3.0
type CellSpec struct { ComponentTemplates []ComponentTemplate `json:"components"` GateWayTemplate Gateway `json:"gateway,omitempty"` }
type CellStatus ¶ added in v0.3.0
type Cluster ¶
type Cluster struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. LocationOfOrigin string `json:"-"` // Server is the address of the kubernetes cluster (https://hostname:port). Server string `json:"server"` // InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure. // +optional InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"` // CertificateAuthority is the path to a cert file for the certificate authority. // +optional CertificateAuthority string `json:"certificate-authority,omitempty"` // CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority // +optional CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]interface{} `json:"extensions,omitempty"` }
Cluster contains information about how to communicate with a kubernetes cluster
type ClusterInfo ¶
type ComponentScalePolicy ¶ added in v0.4.0
type ComponentScalePolicy struct { Name string `json:"name,omitempty"` ScalingPolicy interface{} `json:"scalingPolicy,omitempty"` }
type ComponentTemplate ¶ added in v0.3.0
type ComponentTemplate struct { Metadata ComponentTemplateMetadata `json:"metadata"` Spec ComponentTemplateSpec `json:"spec"` }
type ComponentTemplateMetadata ¶ added in v0.3.0
type ComponentTemplateMetadata struct {
Name string `json:"name"`
}
type ComponentTemplateSpec ¶ added in v0.3.0
type ComponentTemplateSpec struct { PodTemplate PodTemplate `json:"template"` Ports []Port `json:"ports"` }
type Composite ¶ added in v0.4.0
type Composite struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` CompositeMetaData K8SMetaData `json:"metadata"` CompositeSpec CompositeSpec `json:"spec"` CompositeStatus CompositeStatus `json:"status"` }
func GetComposite ¶ added in v0.4.0
type CompositeSpec ¶ added in v0.4.0
type CompositeSpec struct {
ComponentTemplates []ComponentTemplate `json:"components"`
}
type CompositeStatus ¶ added in v0.4.0
type Composites ¶ added in v0.4.0
type Composites struct {
Items []Composite `json:"items"`
}
func GetComposites ¶ added in v0.4.0
func GetComposites() (Composites, error)
type Config ¶
type Config struct { // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. // +optional Kind string `json:"kind,omitempty"` // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. // +optional APIVersion string `json:"apiVersion,omitempty"` // Preferences holds general information to be use for cli interactions Preferences Preferences `json:"preferences"` // Clusters is a map of referencable names to cluster configs Clusters []*ClusterInfo `json:"clusters"` // AuthInfos is a map of referencable names to user configs AuthInfos []*UserInfo `json:"users"` // Contexts is a map of referencable names to context configs Contexts []*ContextInfo `json:"contexts"` // CurrentContext is the name of the context that you would like to use by default CurrentContext string `json:"current-context"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]interface{} `json:"extensions,omitempty"` }
Config holds the information needed to build connect to remote kubernetes clusters as a given user IMPORTANT if you add fields to this struct, please update IsConfigEmpty() +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func MergeConfig ¶
func ReadConfig ¶
type ContainerTemplate ¶ added in v0.3.0
type Context ¶
type Context struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. LocationOfOrigin string `json:"-"` // Cluster is the name of the cluster for this context Cluster string `json:"cluster"` // AuthInfo is the name of the authInfo for this context AuthInfo string `json:"user"` // Namespace is the default namespace to use on unspecified requests // +optional Namespace string `json:"namespace,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]interface{} `json:"extensions,omitempty"` }
Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with)
type ContextInfo ¶
type Destination ¶ added in v0.3.0
type Destination struct {
Host string `json:"host"`
}
type ExecConfig ¶
type ExecConfig struct { // Command to execute. Command string `json:"command"` // Arguments to pass to the command when executing it. // +optional Args []string `json:"args"` // Env defines additional environment variables to expose to the process. These // are unioned with the host's environment, as well as variables client-go uses // to pass argument to the plugin. // +optional Env []ExecEnvVar `json:"env"` // Preferred input version of the ExecInfo. The returned ExecCredentials MUST use // the same encoding version as the input. APIVersion string `json:"apiVersion,omitempty"` }
ExecConfig specifies a command to provide client credentials. The command is exec'd and outputs structured stdout holding credentials.
See the client.authentiction.k8s.io API group for specifications of the exact input and output format
type ExecEnvVar ¶
ExecEnvVar is used for setting environment variables when executing an exec-based credential plugin.
type Gateway ¶ added in v0.3.0
type Gateway struct {
GatewaySpec GatewaySpec `json:"spec,omitempty"`
}
func GetGateways ¶ added in v0.3.0
type GatewayDefinition ¶ added in v0.3.0
type GatewayGrpcApi ¶ added in v0.3.0
type GatewayGrpcApi struct { Backend string `json:"backend"` Context string `json:"context"` Definitions []GatewayDefinition `json:"definitions"` Global bool `json:"global"` Vhost string `json:"vhost"` }
type GatewayHttpApi ¶ added in v0.3.0
type GatewayHttpApi struct { Context string `json:"context"` Version string `json:"version"` Definitions []APIDefinition `json:"definitions"` Global bool `json:"global"` Authenticate bool `json:"authenticate"` Port uint32 `json:"port"` Destination Destination `json:"destination,omitempty"` ZeroScale bool `json:"zeroScale,omitempty"` }
type GatewaySpec ¶ added in v0.3.0
type GatewaySpec struct {
Ingress Ingress `json:"ingress,omitempty"`
}
type GatewayTcpApi ¶ added in v0.3.0
type GatewayTcpApi struct { Backend string `json:"backend"` Context string `json:"context"` Definitions []GatewayDefinition `json:"definitions"` Global bool `json:"global"` Vhost string `json:"vhost"` }
type GwScalePolicy ¶ added in v0.4.0
type GwScalePolicy struct {
ScalingPolicy interface{} `json:"scalingPolicy,omitempty"`
}
type HTTPMatch ¶ added in v0.3.0
type HTTPMatch struct { Authority Authority `json:"authority"` SourceLabels map[string]string `json:"sourceLabels"` Headers map[string]*StringMatch `json:"headers,omitempty"` }
type HTTPRoute ¶ added in v0.3.0
type HTTPRoute struct { Destination Destination `json:"destination"` Weight int `json:"weight,omitempty"` }
type Ingress ¶ added in v0.4.0
type Ingress struct { Extensions interface{} `json:"extensions,omitempty"` HttpApis []GatewayHttpApi `json:"http,omitempty"` TcpApis []GatewayTcpApi `json:"tcp,omitempty"` GrpcApis []GatewayGrpcApi `json:"grpc,omitempty"` }
type InstanceKind ¶ added in v0.4.0
type InstanceKind string
const ( InstanceKindCell InstanceKind = "cells.mesh.cellery.io" InstanceKindComposite InstanceKind = "composites.mesh.cellery.io" )
type K8SMetaData ¶ added in v0.4.0
type K8SMetaData struct { CreationTimestamp string `json:"creationTimestamp"` Annotations CellAnnotations `json:"annotations"` Name string `json:"name"` }
type NodeInfo ¶ added in v0.3.0
type NodeInfo struct {
KubeletVersion string `json:"kubeletVersion"`
}
type NodeItem ¶
type NodeItem struct { Metadata NodeMetaData `json:"metadata"` Status NodeStatus `json:"status"` }
type NodeMetaData ¶
type NodeMetaData struct {
Name string `json:"name"`
}
type NodeStatus ¶ added in v0.3.0
type NodeStatus struct {
NodeInfo NodeInfo `json:"nodeInfo"`
}
type Pod ¶ added in v0.3.0
type Pod struct { MetaData PodMetaData `json:"metadata"` PodStatus PodStatus `json:"status"` }
type PodCondition ¶ added in v0.3.0
type PodMetaData ¶ added in v0.3.0
type PodMetaData struct {
Name string `json:"name"`
}
type PodStatus ¶ added in v0.3.0
type PodStatus struct { Phase string `json:"phase"` StartTime string `json:"startTime"` Conditions []PodCondition `json:"conditions"` }
type PodTemplate ¶ added in v0.4.0
type PodTemplate struct {
Containers []ContainerTemplate `json:"containers"`
}
type Policy ¶ added in v0.3.0
type Policy struct { MinReplicas string `json:"minReplicas"` MaxReplicas int `json:"maxReplicas"` ScaleTargetRef ScaleTargetRef `json:"scaleTargetRef"` Metrics []Metric `json:"metrics"` }
type Preferences ¶
type Preferences struct { // +optional Colors bool `json:"colors,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]interface{} `json:"extensions,omitempty"` }
IMPORTANT if you add fields to this struct, please update IsConfigEmpty()
type ScaleResource ¶ added in v0.4.0
type ScaleResource struct { Spec struct { Components []struct { Metadata struct { Name string `json:"name,omitempty"` } `json:"metadata,omitempty"` Spec struct { ScalingPolicy interface{} `json:"scalingPolicy,omitempty"` } `json:"spec,omitempty"` } `json:"components,omitempty"` Gateway struct { Metadata struct { Name string `json:"name,omitempty"` } `json:"metadata,omitempty"` Spec struct { ScalingPolicy interface{} `json:"scalingPolicy,omitempty"` } `json:"spec,omitempty"` } `json:"gateway,omitempty"` } `json:"spec,omitempty"` }
type ScaleTargetRef ¶ added in v0.3.0
type ScalingPolicy ¶ added in v0.4.0
type ScalingPolicy struct { Hpa struct { Overridable *bool `json:"overridable,omitempty"` } `json:"hpa,omitempty"` }
type Service ¶ added in v0.3.0
type Service struct { Metadata ServiceMetaData `json:"metadata"` Spec ServiceSpec `json:"spec"` }
type ServiceMetaData ¶ added in v0.3.0
type ServiceMetaData struct {
Name string `json:"name"`
}
type ServicePort ¶ added in v0.3.0
type ServicePort struct {
Port int `json:"port"`
}
type ServiceSpec ¶ added in v0.3.0
type ServiceSpec struct {
Ports []ServicePort `json:"ports"`
}
type Services ¶ added in v0.3.0
type Services struct {
Items []Service `json:"items"`
}
func GetServices ¶ added in v0.3.0
type StringMatch ¶ added in v0.4.0
type TCPDestination ¶ added in v0.3.0
type TCPRoute ¶ added in v0.3.0
type TCPRoute struct { Destination TCPDestination `json:"destination"` Weight int `json:"weight,omitempty"` }
type VirtualService ¶ added in v0.3.0
type VirtualService struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` VsMetaData VsMetaData `json:"metadata"` VsSpec VsSpec `json:"spec"` }
func GetVirtualService ¶ added in v0.3.0
func GetVirtualService(vs string) (VirtualService, error)
type VsMetaData ¶ added in v0.3.0
type VsMetaData struct {
Name string `json:"name"`
}