Documentation ¶
Overview ¶
Copyright 2016 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /////////////////////////////////////////////////////////////////////////
Copyright 2016 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /////////////////////////////////////////////////////////////////////////
Copyright 2016 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /////////////////////////////////////////////////////////////////////////
Copyright 2016 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /////////////////////////////////////////////////////////////////////////
Copyright 2016 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /////////////////////////////////////////////////////////////////////////
Index ¶
- Constants
- Variables
- func AddConfig(key string, files map[string]string) (string, error)
- func AddSecret(key string, files map[string]string) (string, error)
- func CreateServiceConfig(name, namespace string) error
- func CreateServicePorts(ports Ports) []api.ServicePort
- func ExtractFromGCP(name string)
- func ExtractFromPods(name string)
- func GetBackend() (string, error)
- func GetESPEndpoints(name string) (map[string]map[string]string, error)
- func GetESPServices(name string) ([]*versioned.Service, error)
- func GetEndpoints(svc *versioned.Service) (map[string]string, error)
- func InjectDeployment(app string, ports Ports, backend string) (map[string]string, error)
- func InjectService(app string, selector map[string]string, ports Ports, ...) (err error)
- func MakeContainer(serviceName string, ports Ports, backend string) (*api.Container, []api.Volume, error)
- func PrintLogs(name, pod string)
- type Ports
Constants ¶
const AnnotationConfigId = "endpoints.googleapis.com/config-id"
const AnnotationConfigName = "endpoints.googleapis.com/config-name"
Label to tag ESP services with service config name and id
const AnnotationDeploymentType = "endpoints.googleapis.com/deployment-type"
Label to tag ESP services with the type of the deployment
const AnnotationEndpointsService = "endpoints.googleapis.com/endpoints"
Label to tag ESP pods for loosely coupled ESP services (to support multiple loose ESP deployments for a service)
const AnnotationManagedService = "endpoints.googleapis.com/managed-service"
Label to tag pods running ESP for a given k8s service Label to tag ESP services for a given k8s service
const EndpointsContainer = "gcr.io/endpoints-release/endpoints-runtime:1"
const EndpointsPrefix = "endpoints-"
Prefix for ESP managed resources
const MaxTries = 10
Variables ¶
var RootCmd = &cobra.Command{ Use: "espcli", Short: "ESP deployment manager for Kubernetes", Long: "A tool to deploy and monitor Extensible Service Proxy on a Kubernetes cluster", Run: func(cmd *cobra.Command, args []string) { log.Println("Please run 'espcli help' to see the list of available commands.") }, PersistentPreRun: func(cmd *cobra.Command, args []string) { config, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig( clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{}, ).ClientConfig() if err != nil { log.Println("Cannot find the default Kubernetes configuration.") log.Println("Please check with kubectl your cluster config.") os.Exit(-2) } clientset, err = kubernetes.NewForConfig(config) if err != nil { log.Println("Cannot connect to the Kubernetes API: ", err) os.Exit(-2) } }, }
RootCmd for CLI
Functions ¶
func CreateServiceConfig ¶
CreateServiceConfig creates/enables/submits configuration for the service
func CreateServicePorts ¶
func CreateServicePorts(ports Ports) []api.ServicePort
CreateServicePorts lists published ports for ESP container
func ExtractFromPods ¶
func ExtractFromPods(name string)
ExtractFromPods fetches logs from pods running ESP container
func GetBackend ¶
GetBackend returns the backend address for ESP service
func GetESPEndpoints ¶
GetESPEndpoints collects endpoints information
func GetESPServices ¶
GetESPServices for a Kubernetes service
func GetEndpoints ¶
GetEndpoints retrieves endpoints information for an ESP service
func InjectDeployment ¶
InjectDeployment creates ESP pods
func InjectService ¶
func InjectService( app string, selector map[string]string, ports Ports, serviceType api.ServiceType) (err error)
InjectService creates ESP service