Documentation ¶
Index ¶
- Constants
- Variables
- func AddManagementKubeconfigFlags(kubeconfig, kubecontext *string, flags *pflag.FlagSet)
- func AddMeshctlConfigFlags(meshctlConfigPath *string, flags *pflag.FlagSet)
- func AddOutputFlag(cmd *cobra.Command, format *string)
- func BuildClient(kubeConfigPath, kubeContext string) (client.Client, error)
- func BuildClientConfigAndClientset(kubeconfig, kubeContext string) (clientcmd.ClientConfig, *kubernetes.Clientset, error)
- func BuildClientset(kubeConfigPath, kubeContext string) (*kubernetes.Clientset, error)
- func DefaultMeshctlConfigFilePath() (string, error)
- func EnsureNamespace(ctx context.Context, kubeClient client.Client, namespace string) error
- func GetGlooMeshVersion(ctx context.Context, kubeConfigPath, kubeContext, namespace string) (string, error)
- func MarshalProtoWithFormat(msg proto.Message, format string) (string, error)
- func PortForwardFromDeployment(ctx context.Context, kubeConfig string, kubeContext string, deployName string, ...) (string, error)
- func PortForwardFromPod(ctx context.Context, kubeConfig string, kubeContext string, podName string, ...) (string, error)
- func RunShell(c string, writer io.Writer)
- func UpdateMeshctlConfigWithDeregistrationInfo(...) error
- func UpdateMeshctlConfigWithInstallInfo(mgmtKubeConfig, mgmtKubecontext string) error
- func UpdateMeshctlConfigWithRegistrationInfo(...) error
- func WriteConfigToFile(config MeshctlConfig, meshctlConfigPath string) error
- func Zip(fs afero.Fs, dir string, file string) error
- type GlobalFlags
- type KubeConfig
- type KubeConfigCluster
- type MeshctlCluster
- type MeshctlConfig
Constants ¶
const ( ConfigFileName = "meshctl-config.yaml" ConfigDirName = ".gloo-mesh" )
const ( Yaml = "yaml" Json = "json" )
Variables ¶
var (
DefaultConfigPath = path.Join(homeDir, ConfigDirName, ConfigFileName)
)
Functions ¶
func AddManagementKubeconfigFlags ¶
Set kubeconfig path and context flags for the management cluster.
func AddMeshctlConfigFlags ¶ added in v1.1.0
Set the meshctl config file path
func AddOutputFlag ¶ added in v0.12.7
augment the input cobra command with a flag specifying the output format, also add pre-run validation that the format string is valid
func BuildClientConfigAndClientset ¶ added in v1.1.0
func BuildClientConfigAndClientset(kubeconfig, kubeContext string) (clientcmd.ClientConfig, *kubernetes.Clientset, error)
BuildClientConfigAndClientset creates a rest.Config and Clientset from the given kubeconfig path and Context.
func BuildClientset ¶ added in v1.1.0
func BuildClientset(kubeConfigPath, kubeContext string) (*kubernetes.Clientset, error)
func DefaultMeshctlConfigFilePath ¶ added in v1.1.0
return the default meshctl config filepath
func EnsureNamespace ¶ added in v1.0.0
func GetGlooMeshVersion ¶ added in v1.0.0
func MarshalProtoWithFormat ¶ added in v0.12.7
marshal a proto message with the given format
func PortForwardFromDeployment ¶ added in v0.12.7
func PortForwardFromDeployment( ctx context.Context, kubeConfig string, kubeContext string, deployName string, deployNamespace string, localPort string, remotePort string, ) (string, error)
Open a port-forward against the specified deployment. Returns the local port. If localPort is unspecified, a free port will be chosen at random. Canceling the context will stop the port-forward.
func PortForwardFromPod ¶ added in v0.12.7
func PortForwardFromPod( ctx context.Context, kubeConfig string, kubeContext string, podName string, podNamespace string, localPort string, remotePort string, ) (string, error)
Open a port forward against the specified pod. Returns the stop channel and the local port. If localPort is unspecified, a free port will be chosen at random. Close the port forward by closing the returned channel.
func UpdateMeshctlConfigWithDeregistrationInfo ¶ added in v1.1.0
func UpdateMeshctlConfigWithDeregistrationInfo(mgmtKubeConfigPath, mgmtKubecontext, remoteClusterName, remoteKubeConfigPath string) error
update the default meschtl config file with deregistration info
func UpdateMeshctlConfigWithInstallInfo ¶ added in v1.1.0
update the default meschtl config file with install info
func UpdateMeshctlConfigWithRegistrationInfo ¶ added in v1.1.0
func UpdateMeshctlConfigWithRegistrationInfo(mgmtKubeConfigPath, mgmtKubecontext, remoteClusterName, remoteKubeConfigPath, remoteKubecontext string) error
update the default meschtl config file with registration info
func WriteConfigToFile ¶ added in v1.1.0
func WriteConfigToFile(config MeshctlConfig, meshctlConfigPath string) error
Types ¶
type GlobalFlags ¶ added in v0.10.6
type GlobalFlags struct {
Verbose bool
}
func (*GlobalFlags) AddToFlags ¶ added in v0.10.6
func (g *GlobalFlags) AddToFlags(flags *pflag.FlagSet)
type KubeConfig ¶ added in v1.1.0
type KubeConfig struct { ApiVersion string `json:"apiVersion"` Clusters []KubeConfigCluster `yaml:"clusters"` }
type KubeConfigCluster ¶ added in v1.1.0
type KubeConfigCluster struct {
Name string `yaml:"name"`
}
type MeshctlCluster ¶ added in v1.1.0
type MeshctlConfig ¶ added in v1.1.0
type MeshctlConfig struct { ApiVersion string `json:"apiVersion"` Clusters map[string]MeshctlCluster `json:"clusters"` // contains filtered or unexported fields }
func NewMeshctlConfig ¶ added in v1.1.0
func NewMeshctlConfig() MeshctlConfig
new initialized meshctl config
func ParseMeshctlConfig ¶ added in v1.1.0
func ParseMeshctlConfig(meshctlConfigPath string) (MeshctlConfig, error)
parse the meshctl config file into a MeshctlConfig struct If the file doesn't exist or is invalid, return an error
func (MeshctlConfig) AddDataPlaneCluster ¶ added in v1.1.0
func (c MeshctlConfig) AddDataPlaneCluster(name string, kc MeshctlCluster) error
add a data plane cluster config
func (MeshctlConfig) AddMgmtCluster ¶ added in v1.1.0
func (c MeshctlConfig) AddMgmtCluster(kc MeshctlCluster)
add the management cluster config
func (MeshctlConfig) FilePath ¶ added in v1.1.0
func (c MeshctlConfig) FilePath() string
returns the path of the file storing the config
func (MeshctlConfig) IsMgmtCluster ¶ added in v1.1.0
func (c MeshctlConfig) IsMgmtCluster(name string) bool
returns the mgmt meshctl cluster name
func (MeshctlConfig) MgmtCluster ¶ added in v1.1.0
func (c MeshctlConfig) MgmtCluster() MeshctlCluster
returns the mgmt meshctl cluster config