Documentation ¶
Overview ¶
* Tencent is pleased to support the open source community by making TKEStack * available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * 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 * * https://opensource.org/licenses/Apache-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 OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.
* Tencent is pleased to support the open source community by making TKEStack * available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * 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 * * https://opensource.org/licenses/Apache-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 OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.
* Tencent is pleased to support the open source community by making TKEStack * available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * 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 * * https://opensource.org/licenses/Apache-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 OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.
* Tencent is pleased to support the open source community by making TKEStack * available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * 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 * * https://opensource.org/licenses/Apache-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 OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.
* Tencent is pleased to support the open source community by making TKEStack * available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * 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 * * https://opensource.org/licenses/Apache-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 OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.
* Tencent is pleased to support the open source community by making TKEStack * available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * 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 * * https://opensource.org/licenses/Apache-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 OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( // TypeStaticPod is the type of StaticPod explore TypeStaticPod = "StaticPod" // TypeLabel is the type of Label explore TypeLabel = "Label" // TypeBare is the type of Bare explore TypeBare = "Bare" // TypeAuto is the type of Auto explore TypeAuto = "Auto" )
Variables ¶
This section is empty.
Functions ¶
func ExplorePods ¶
func ExplorePods(logger logger.Logger, name string, pods []v1.Pod, exec nodeexec.Executor) []cluster.Component
ExplorePod explore a component from k8s pods if exec is not nil, a bare explore will be used for fetching component command line arguments if bare explore failed, command line argument find in pod will be used
Types ¶
type Auto ¶
type Auto struct { // Type indicate the type that Auto explore use // if Type=Auto, multiple methods will be used for exploring component one by one // otherwise, explore that type=Type will be used Type string // Name is the name of target component // when use StaticPod explore, target pod name will be Name-NodeName // when use Label explore, default target label will be k8s-app=Name // when use Bare explore, Name is the target process name Name string // Namespace is the target namespace if Type is "StaticPod" or "Label" Namespace string // Nodes are target nodes for exploring components Nodes []string // MasterNodes indicate that whether only master nodes ares target nodes // if Nodes is empty and MasterNodes is false, all nodes are target nodes MasterNodes bool // Labels will be used when use label explore Labels map[string]string // contains filtered or unexported fields }
Auto is a component explorer that can try to explore component information by multiple methods
type Bare ¶
type Bare struct {
// contains filtered or unexported fields
}
Bare get component information by executing cmd on node
func NewBare ¶
func NewBare(logger logger.Logger, cmdName string, nodes []string, executor nodeexec.Executor) *Bare
NewBare create and int a StaticPods ComponentExecutor
type Explorer ¶
type Explorer interface { // Component get cluster components Component() ([]cluster.Component, error) // Finish will be called once every thing done Finish() error }
Explorer get component information
type LabelExp ¶
type LabelExp struct {
// contains filtered or unexported fields
}
LabelExp get select pod with labels and try get component from
func NewLabelExp ¶
func NewLabelExp(logger logger.Logger, cli kubernetes.Interface, namespace string, cmpName string, labels map[string]string, exec nodeexec.Executor) *LabelExp
NewLabelExp create and init a LabelExp Component
type StaticPods ¶
type StaticPods struct { ExplorePods func(logger logger.Logger, name string, pods []v12.Pod, exec nodeexec.Executor) []cluster.Component // contains filtered or unexported fields }
StaticPods get component information from static pod
func NewStaticPods ¶
func NewStaticPods(logger logger.Logger, cli kubernetes.Interface, namespace string, podPrefix string, nodes []string, exe nodeexec.Executor) *StaticPods
NewStaticPods create and int a StaticPods ComponentExecutor
func (*StaticPods) Component ¶
func (s *StaticPods) Component() ([]cluster.Component, error)
Component get cluster components
func (*StaticPods) Finish ¶
func (s *StaticPods) Finish() error
Finish will be called once every thing done