Documentation ¶
Index ¶
- Constants
- Variables
- func AddAuthDetails(req *http.Request, filepath string) error
- func AddContextToConfig(contextName string, context config.Context, configPath string, set bool) error
- func AddTokenToConfig(token config.Token, configPath string) error
- func ApplyManifest(manifest []byte, client *meshkitkube.Client, update bool, delete bool) error
- func ApplyManifestFiles(manifestArr []Manifest, requestedAdapters []string, client *meshkitkube.Client, ...) error
- func AskForConfirmation(s string) bool
- func ChangeManifestVersion(fileName string, version string, filePath string) error
- func CheckK8sVersion(versionInfo *version.Info) error
- func CheckKubectlVersion() error
- func ContentTypeIsHTML(resp *http.Response) bool
- func CreateConfigFile() error
- func DownloadDockerComposeFile(ctx config.Context, force bool) error
- func DownloadFile(filepath string, url string) error
- func DownloadManifests(manifestArr []Manifest, rawManifestsURL string) error
- func GenerateConfigAKS(configPath, resourceGroup, clusterName string) error
- func GenerateConfigEKS(configPath, region, cluster string) error
- func GenerateConfigGKE(configPath, SAName, namespc string) error
- func GenerateConfigMinikube(configPath string) error
- func GetK8sVersionInfo() (*version.Info, error)
- func GetLatestStableReleaseTag() (string, error)
- func GetManifestTreeURL(version string) (string, error)
- func GetManifestURL(manifest Manifest, rawManifestsURL string) string
- func GetMesheryGitHubOrg() string
- func GetMesheryGitHubRepo() string
- func IsAdapterValid(manifestArr []Manifest, adapterManifest string) bool
- func IsMesheryRunning(currPlatform string) (bool, error)
- func IsValidSubcommand(available []*cobra.Command, sub string) bool
- func PerfError(msg string) string
- func PreReqCheck(subcommand string, focusedContext string) error
- func PrintToTable(header []string, data [][]string)
- func RootError(msg string) string
- func SafeClose(co io.Closer)
- func SetFileLocation() error
- func StringWithCharset(length int) string
- func SystemError(msg string) string
- func UpdateAuthDetails(filepath string) error
- func UpdateMesheryContainers() error
- func UploadFileWithParams(uri string, params map[string]string, paramName, path string) (*http.Request, error)
- func ValidateURL(URL string) error
- type Containers
- type DockerCompose
- type K8sCompose
- type Manifest
- type ManifestList
- type OnlyStringFormatterForLogrus
- type Service
- type Spec
- type Template
- type TemplateSpec
- type Volumes
Constants ¶
const ( OperatorURL = baseConfigURL + "manifests/default.yaml" BrokerURL = baseConfigURL + "samples/meshery_v1alpha1_broker.yaml" MeshsyncURL = baseConfigURL + "samples/meshery_v1alpha1_meshsync.yaml" )
Variables ¶
var ( // ResetFlag indicates if a reset is required ResetFlag bool // MesheryEndpoint is the default URL in which Meshery is exposed MesheryEndpoint = "http://localhost:9081" // MesheryFolder is the default relative location of the meshery config // related configuration files. MesheryFolder = ".meshery" // DockerComposeFile is the default location within the MesheryFolder // where the docker compose file is located. DockerComposeFile = "meshery.yaml" // AuthConfigFile is the location of the auth file for performing perf testing AuthConfigFile = "auth.json" // DefaultConfigPath is the detail path to mesheryctl config DefaultConfigPath = "config.yaml" // MesheryNamespace is the namespace to which Meshery is deployed in the Kubernetes cluster MesheryNamespace = "meshery" // MesheryDeployment is the name of a Kubernetes manifest file required to setup Meshery // check https://github.com/layer5io/meshery/tree/master/install/deployment_yamls/k8s MesheryDeployment = "meshery-deployment.yaml" // MesheryService is the name of a Kubernetes manifest file required to setup Meshery // check https://github.com/layer5io/meshery/tree/master/install/deployment_yamls/k8s MesheryService = "meshery-service.yaml" //MesheryOperator is the file for default Meshery operator //check https://github.com/layer5io/meshery-operator/blob/master/config/manifests/default.yaml MesheryOperator = "default.yaml" //MesheryOperatorBroker is the file for the Meshery broker //check https://github.com/layer5io/meshery-operator/blob/master/config/samples/meshery_v1alpha1_broker.yaml MesheryOperatorBroker = "meshery_v1alpha1_broker.yaml" //MesheryOperatorMeshsync is the file for the Meshery Meshsync Operator //check https://github.com/layer5io/meshery-operator/blob/master/config/samples/meshery_v1alpha1_meshsync.yaml MesheryOperatorMeshsync = "meshery_v1alpha1_meshsync.yaml" // ServiceAccount is the name of a Kubernetes manifest file required to setup Meshery // check https://github.com/layer5io/meshery/tree/master/install/deployment_yamls/k8s ServiceAccount = "service-account.yaml" // ViperCompose is an instance of viper for docker-compose ViperCompose = viper.New() // SilentFlag skips waiting for user input and proceeds with default options SilentFlag bool )
var ListOfAdapters = []string{"meshery-istio", "meshery-linkerd", "meshery-consul", "meshery-nsm", "meshery-kuma", "meshery-cpx", "meshery-osm", "meshery-traefik-mesh"}
ListOfAdapters returns the list of adapters available
var (
// ManifestsFolder is where the Kubernetes manifests are stored
ManifestsFolder = "manifests"
)
var TemplateContext = config.Context{ Endpoint: "http://localhost:9081", Token: "Default", Platform: "docker", Adapters: ListOfAdapters, Channel: "stable", Version: "latest", }
TemplateContext is the template context provided when creating a config file
var TemplateToken = config.Token{ Name: "Default", Location: AuthConfigFile, }
TemplateToken is the template token provided when creating a config file
Functions ¶
func AddAuthDetails ¶
AddAuthDetails Adds authentication cookies to the request
func AddContextToConfig ¶ added in v0.5.1
func AddContextToConfig(contextName string, context config.Context, configPath string, set bool) error
AddContextToConfig adds context passed to it to mesheryctl config file
func AddTokenToConfig ¶ added in v0.5.2
AddTokenToConfig adds token passed to it to mesheryctl config file
func ApplyManifest ¶ added in v0.5.2
ApplyManifest is a wrapper function for client.ApplyManifest
func ApplyManifestFiles ¶ added in v0.5.2
func ApplyManifestFiles(manifestArr []Manifest, requestedAdapters []string, client *meshkitkube.Client, update bool, delete bool) error
ApplyManifestFiles applies/updates/deletes all the required manifests into the Kubernetes cluster
func AskForConfirmation ¶ added in v0.5.1
AskForConfirmation asks the user for confirmation. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user.
func ChangeManifestVersion ¶ added in v0.5.3
func CheckK8sVersion ¶ added in v0.5.3
func CheckKubectlVersion ¶ added in v0.5.3
func CheckKubectlVersion() error
CheckKubectlVersion validates whether the installed kubectl version is running a minimum kubectl version.
func ContentTypeIsHTML ¶ added in v0.3.18
ContentTypeIsHTML Checks if the response is an HTML resposnse
func CreateConfigFile ¶ added in v0.5.1
func CreateConfigFile() error
CreateConfigFile creates config file in Meshery Folder
func DownloadDockerComposeFile ¶ added in v0.5.1
DownloadDockerComposeFile fetches docker-compose.yaml based on passed context if it does not exists. Use force to override download anyway
func DownloadFile ¶
DownloadFile from url and save to configured file location
func DownloadManifests ¶ added in v0.5.1
DownloadManifests downloads all the Kubernetes manifest files
func GenerateConfigAKS ¶ added in v0.5.1
GenerateConfigAKS generates kube config file in ~/.meshery/kubeconfig.yaml for a AKS cluster
func GenerateConfigEKS ¶ added in v0.5.1
GenerateConfigEKS generates kube config file in .meshery/kubeconfig.yaml for an EKS cluster
func GenerateConfigGKE ¶
GenerateConfigGKE generates kube config file in ~/.meshery/kubeconfig.yaml for a GKE cluster
func GenerateConfigMinikube ¶
GenerateConfigMinikube generates kube config file in ~/.meshery/kubeconfig.yaml for a Minikube cluster
func GetK8sVersionInfo ¶ added in v0.5.3
GetK8sVersionInfo returns version.Info for the Kubernetes cluster.
func GetLatestStableReleaseTag ¶ added in v0.5.1
GetLatestStableReleaseTag fetches and returns the latest release tag from GitHub
func GetManifestTreeURL ¶ added in v0.5.2
GetManifestTreeURL returns the manifest tree url based on version
func GetManifestURL ¶ added in v0.5.1
GetManifestURL returns the URLs for the manifest files
func GetMesheryGitHubOrg ¶ added in v0.4.11
func GetMesheryGitHubOrg() string
GetMesheryGitHubOrg retrieves the name of the GitHub organization under which the Meshery repository resides.
func GetMesheryGitHubRepo ¶ added in v0.4.11
func GetMesheryGitHubRepo() string
GetMesheryGitHubRepo retrieves the name of the Meshery repository
func IsAdapterValid ¶ added in v0.5.1
IsAdapterValid checks if the adapter mentioned by the user is a valid adapter
func IsMesheryRunning ¶
IsMesheryRunning checks if the meshery server containers are up and running
func IsValidSubcommand ¶
IsValidSubcommand checks if the passed subcommand is supported by the parent command
func PerfError ¶
PerfError returns a formatted error message with a link to 'perf' command usage page at in addition to the error message
func PreReqCheck ¶
PreReqCheck prerequisites check
func PrintToTable ¶ added in v0.5.2
PrintToTable prints the given data into a table format
func RootError ¶
RootError returns a formatted error message with a link to 'root' command usage page at in addition to the error message
func StringWithCharset ¶
StringWithCharset generates a random string with a given length
func SystemError ¶
SystemError returns a formatted error message with a link to 'system' command usage page in addition to the error message
func UpdateAuthDetails ¶
UpdateAuthDetails checks gets the token (old/refreshed) from meshery server and writes it back to the config file
func UpdateMesheryContainers ¶ added in v0.5.1
func UpdateMesheryContainers() error
UpdateMesheryContainers runs the update command for meshery client
func UploadFileWithParams ¶
func UploadFileWithParams(uri string, params map[string]string, paramName, path string) (*http.Request, error)
UploadFileWithParams returns a request configured to upload files with other values
func ValidateURL ¶ added in v0.5.1
ValidateURL validates url provided for meshery backend to mesheryctl context
Types ¶
type Containers ¶ added in v0.5.3
type DockerCompose ¶ added in v0.5.1
type K8sCompose ¶ added in v0.5.3
type Manifest ¶ added in v0.5.1
type Manifest struct { Path string `json:"path,omitempty"` Mode string `json:"mode,omitempty"` Typ string `json:"type,omitempty"` SHA string `json:"sha,omitempty"` Size json.Number `json:"size,omitempty"` URL string `json:"url,omitempty"` }
func FetchManifests ¶ added in v0.5.2
FetchManifests is a wrapper function that identifies the required manifest files as downloads them
func ListManifests ¶ added in v0.5.1
ListManifests lists the manifest files stored in GitHub
type ManifestList ¶ added in v0.5.1
type OnlyStringFormatterForLogrus ¶ added in v0.5.1
type OnlyStringFormatterForLogrus struct{}
OnlyStringFormatterForLogrus is a custom logrus formatter that returns only string of message as output
type Template ¶ added in v0.5.3
type Template struct { Metadata interface{} `yaml:"metadata,omitempty"` Spec TemplateSpec `yaml:"spec,omitempty"` }
type TemplateSpec ¶ added in v0.5.3
type TemplateSpec struct { ServiceAccount string `yaml:"serviceAccount,omitempty"` Containers []Containers `yaml:"containers,omitempty"` RestartPolicy string `yaml:"restartPolicy,omitempty"` }