custom

package
v0.0.0-...-6b231d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 13 Imported by: 0

README

Custom Cluster

A custom cluster is a user-built cluster that can be highly customized through a configuration file

config

cluster:
  type: "custom"
  name: "" # the name of this cluster
  kubeconfig: "" # the path of kubeconfig file, use "" to use $HOMEDIR/.kube/.config or use in-cluster way
  # default config value
  config:
    node: # the way to fetch node machine level data
      type: "proxy" # via the a agent DaemonSet 
      namespace: "kube-jarvis" # the namespace of agent 
      daemonset: "kube-jarvis-agent" # the name of agent DaemonSet 

    components:  # the components that should to explore their information 
      kube-apiserver: # this is the example of component "kube-apiserver"
                      # the default components also includes as follow
                      # "kube-apiserver", "kube-scheduler", "kube-controller-manager", "etcd", "kube-proxy"
                      # "coredns", "kube-dns", "kubelet", "kube-proxy", "dockerd", "containerd"

        type: "auto"  # the way used to explore this component, 
                      # Auto : try follow ways one by one
                      # Bare : use "ps" command to explore component on nodes 
                      # Label: select pods with label selector to explore component
                      # StaticPod: use static pod on node to explore component

        name: "kube-apiserver" # the real name of target component
        namespace: "kube-system" # the namespace of the component if use "Lable" or "StaticPod" exploring
        masternodes: true # only explore component on master nodes 
                          # the master nodes are nodes with label item "node-role.kubernetes.io/master" exist

        nodes: [] # only explore component on target nodes
                  #  will try explore component on all nodes if "masternodes" is false and "nodes" is empty

        labels: # the labels that used to select pod when use "Label" exploring
          k8s-app : "kube-apiserver"

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.

Index

Constants

View Source
const (
	// Type is the cluster type
	Type = "custom"
)

Variables

This section is empty.

Functions

func GetIPTablesInfo

func GetIPTablesInfo(out string) (result cluster.IPTablesInfo)

GetIPTablesInfo cover a out from "iptables-save"

func GetSysCtlMap

func GetSysCtlMap(out string) map[string]string

GetSysCtlMap cover a out from "sysctl -a" to a map

func NewCluster

func NewCluster(log logger.Logger, cli kubernetes.Interface, config *rest.Config) cluster.Cluster

NewCluster return an new custom Cluster

Types

type Cluster

type Cluster struct {
	// Node is the config of node command executor
	Node *nodeexec.Config
	// Components is the components that will be explored
	Components map[string]*compexplorer.Auto
	// KubeConfig is the config file of kube-apiserver
	KubeConfig string
	// contains filtered or unexported fields
}

Cluster is a custom cluster

func (*Cluster) CloudType

func (c *Cluster) CloudType() string

CloudType return the cloud type of Cluster

func (*Cluster) Complete

func (c *Cluster) Complete() error

Complete check and complete config items

func (*Cluster) Finish

func (c *Cluster) Finish() error

Finish will be called once diagnostic done

func (*Cluster) Init

func (c *Cluster) Init(ctx context.Context, progress *plugins.Progress) error

Init do initialization for Cluster

func (*Cluster) Resources

func (c *Cluster) Resources() *cluster.Resources

Resources return fetched resources

Directories

Path Synopsis
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL