kubernetes

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFile

func ApplyFile(file string) error

func ApplyFileWithNamespace

func ApplyFileWithNamespace(file, namespace string) error

func ApplyLable

func ApplyLable(itemType, itemName, labelName string, overWrite bool) error

func CreateClusterRoleBinding

func CreateClusterRoleBinding(clusterRole, user string) error

func CreateConfigMapWithNamespace

func CreateConfigMapWithNamespace(name, confFile, namespace string) error

func CreateFile

func CreateFile(file string) error

func DefaultConfigDir

func DefaultConfigDir() (string, error)

func DefaultConfigFile

func DefaultConfigFile() (string, error)

func DeleteAllCells

func DeleteAllCells() error

func DeleteCell

func DeleteCell(cellInstance string) (string, error)

func DeleteFile

func DeleteFile(file string) error

func DeleteFileWithNamespace

func DeleteFileWithNamespace(file, namespace string) error

func DeleteNameSpace

func DeleteNameSpace(nameSpace string) error

func DeletePersistedVolume

func DeletePersistedVolume(persistedVolume string) error

func DeleteResource

func DeleteResource(kind, instance string) (string, error)

func GetContext

func GetContext() (string, error)

func GetContexts

func GetContexts() ([]byte, error)

func GetDeployment

func GetDeployment(namespace, deployment string) (string, error)

func GetDeploymentNames

func GetDeploymentNames(namespace string) ([]string, error)

func GetGatewayAsMapInterface

func GetGatewayAsMapInterface(gw string) (map[string]interface{}, error)

func GetMasterNodeName

func GetMasterNodeName() (string, error)

func JsonPatchWithNameSpace

func JsonPatchWithNameSpace(kind, instance, jsonPatch, nameSpace string) error

func UseContext

func UseContext(context string) error

func WaitForCell

func WaitForCell(condition string, timeoutSeconds int, resourceName string, namespace string) error

func WaitForCluster

func WaitForCluster(timeout time.Duration) error

func WaitForCondition

func WaitForCondition(condition string, timeoutSeconds int, resourceName string, namespace string) error

func WaitForDeployment

func WaitForDeployment(condition string, timeoutSeconds int, resourceName string, namespace string) error

func WaitForDeployments

func WaitForDeployments(namespace string, timeout time.Duration) error

func WriteConfig

func WriteConfig(file string, conf *Config) error

Types

type APIDefinition

type APIDefinition struct {
	Path   string `json:"path"`
	Method string `json:"method"`
}

type ApiPublisherConfig

type ApiPublisherConfig struct {
	Authenticate bool   `json:"authenticate,omitempty"`
	Backend      string `json:"backend,omitempty"`
	Context      string `json:"context,omitempty"`
	Version      string `json:"version,omitempty"`
}

type AuthInfo

type AuthInfo struct {
	// LocationOfOrigin indicates where this object came from.  It is used for round tripping config post-merge, but never serialized.
	LocationOfOrigin string `json:"-"`
	// ClientCertificate is the path to a client cert file for TLS.
	// +optional
	ClientCertificate string `json:"client-certificate,omitempty"`
	// ClientCertificateData contains PEM-encoded data from a client cert file for TLS. Overrides ClientCertificate
	// +optional
	ClientCertificateData []byte `json:"client-certificate-data,omitempty"`
	// ClientKey is the path to a client key file for TLS.
	// +optional
	ClientKey string `json:"client-key,omitempty"`
	// ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey
	// +optional
	ClientKeyData []byte `json:"client-key-data,omitempty"`
	// Token is the bearer token for authentication to the kubernetes cluster.
	// +optional
	Token string `json:"token,omitempty"`
	// TokenFile is a pointer to a file that contains a bearer token (as described above).  If both Token and TokenFile are present, Token takes precedence.
	// +optional
	TokenFile string `json:"tokenFile,omitempty"`
	// Impersonate is the username to act-as.
	// +optional
	Impersonate string `json:"act-as,omitempty"`
	// ImpersonateGroups is the groups to imperonate.
	// +optional
	ImpersonateGroups []string `json:"act-as-groups,omitempty"`
	// ImpersonateUserExtra contains additional information for impersonated user.
	// +optional
	ImpersonateUserExtra map[string][]string `json:"act-as-user-extra,omitempty"`
	// Username is the username for basic authentication to the kubernetes cluster.
	// +optional
	Username string `json:"username,omitempty"`
	// Password is the password for basic authentication to the kubernetes cluster.
	// +optional
	Password string `json:"password,omitempty"`
	// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
	// +optional
	AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"`
	// Exec specifies a custom exec-based authentication plugin for the kubernetes cluster.
	// +optional
	Exec *ExecConfig `json:"exec,omitempty"`
	// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
	// +optional
	Extensions map[string]interface{} `json:"extensions,omitempty"`
}

AuthInfo contains information that describes identity information. This is use to tell the kubernetes cluster who you are.

type AuthProviderConfig

type AuthProviderConfig struct {
	Name string `json:"name"`
	// +optional
	Config map[string]string `json:"config,omitempty"`
}

AuthProviderConfig holds the configuration for a specified auth provider.

type Authority

type Authority struct {
	Regex string `json:"regex"`
}

type AutoScalingPolicy

type AutoScalingPolicy struct {
	Components []ComponentScalePolicy `json:"components,omitempty"`
	Gateway    GwScalePolicy          `json:"gateway,omitempty"`
}

type AutoscalePolicy

type AutoscalePolicy struct {
	Kind       string                  `json:"kind"`
	APIVersion string                  `json:"apiVersion"`
	Metadata   AutoscalePolicyMetadata `json:"metadata"`
	Spec       AutoscalePolicySpec     `json:"spec"`
}

type AutoscalePolicyMetadata

type AutoscalePolicyMetadata struct {
	Name string `json:"name"`
}

type AutoscalePolicySpec

type AutoscalePolicySpec struct {
	Overridable bool   `json:"overridable"`
	Policy      Policy `json:"policy"`
}

type Cell

type Cell struct {
	//TODO: Remove components from Cell Struct
	Component    map[string]ComponentDetail `json:"components,omitempty"`
	Kind         string                     `json:"kind"`
	APIVersion   string                     `json:"apiVersion"`
	CellMetaData K8SMetaData                `json:"metadata"`
	CellSpec     CellSpec                   `json:"spec"`
	CellStatus   CellStatus                 `json:"status"`
}

func GetCell

func GetCell(cellName string) (Cell, error)

type CellAnnotations

type CellAnnotations struct {
	Organization                        string `json:"mesh.cellery.io/cell-image-org"`
	Name                                string `json:"mesh.cellery.io/cell-image-name"`
	Version                             string `json:"mesh.cellery.io/cell-image-version"`
	Dependencies                        string `json:"mesh.cellery.io/cell-dependencies"`
	ApiVersion                          string `json:"mesh.cellery.io/apiVersion"`
	OriginalDependencyComponentServices string `json:"mesh.cellery.io/original-component-svcs,omitempty"`
}

type CellSpec

type CellSpec struct {
	ComponentTemplates []ComponentTemplate `json:"components"`
	GateWayTemplate    Gateway             `json:"gateway,omitempty"`
}

type CellStatus

type CellStatus struct {
	Status       string `json:"status"`
	Gateway      string `json:"gatewayServiceName"`
	ServiceCount int    `json:"componentCount"`
}

type CelleryKubeCli

type CelleryKubeCli struct {
}

func NewCelleryKubeCli

func NewCelleryKubeCli() *CelleryKubeCli

NewCelleryCli returns a CelleryCli instance.

func (*CelleryKubeCli) ApplyFile

func (kubeCli *CelleryKubeCli) ApplyFile(file string) error

func (*CelleryKubeCli) DeleteResource

func (kubeCli *CelleryKubeCli) DeleteResource(kind, instance string) (string, error)

func (*CelleryKubeCli) DescribeCell

func (kubeCli *CelleryKubeCli) DescribeCell(cellName string) error

func (*CelleryKubeCli) GetCell

func (kubeCli *CelleryKubeCli) GetCell(cellName string) (Cell, error)

func (*CelleryKubeCli) GetCellInstanceAsMapInterface

func (kubeCli *CelleryKubeCli) GetCellInstanceAsMapInterface(cell string) (map[string]interface{}, error)

func (*CelleryKubeCli) GetCellLogsAllComponents

func (kubeCli *CelleryKubeCli) GetCellLogsAllComponents(cellName string) (string, error)

func (*CelleryKubeCli) GetCellLogsUserComponents

func (kubeCli *CelleryKubeCli) GetCellLogsUserComponents(cellName string) (string, error)

func (*CelleryKubeCli) GetCells

func (kubeCli *CelleryKubeCli) GetCells() ([]Cell, error)

GetCells returns mock cell instances array.

func (*CelleryKubeCli) GetComponentLogs

func (kubeCli *CelleryKubeCli) GetComponentLogs(cellName, componentName string) (string, error)

func (*CelleryKubeCli) GetComposite

func (kubeCli *CelleryKubeCli) GetComposite(compositeName string) (Composite, error)

func (*CelleryKubeCli) GetCompositeInstanceAsMapInterface

func (kubeCli *CelleryKubeCli) GetCompositeInstanceAsMapInterface(composite string) (map[string]interface{}, error)

func (*CelleryKubeCli) GetComposites

func (kubeCli *CelleryKubeCli) GetComposites() ([]Composite, error)

func (*CelleryKubeCli) GetInstanceBytes

func (kubeCli *CelleryKubeCli) GetInstanceBytes(instanceKind, InstanceName string) ([]byte, error)

func (*CelleryKubeCli) GetInstancesNames

func (kubeCli *CelleryKubeCli) GetInstancesNames() ([]string, error)

func (*CelleryKubeCli) GetPodsForCell

func (kubeCli *CelleryKubeCli) GetPodsForCell(cellName string) (Pods, error)

func (*CelleryKubeCli) GetPodsForComposite

func (kubeCli *CelleryKubeCli) GetPodsForComposite(compName string) (Pods, error)

func (*CelleryKubeCli) GetServices

func (kubeCli *CelleryKubeCli) GetServices(cellName string) (Services, error)

func (*CelleryKubeCli) JsonPatch

func (kubeCli *CelleryKubeCli) JsonPatch(kind, instance, jsonPatch string) error

func (*CelleryKubeCli) SetVerboseMode

func (kubeCli *CelleryKubeCli) SetVerboseMode(enable bool)

func (*CelleryKubeCli) Version

func (kubeCli *CelleryKubeCli) Version() (string, string, error)

type Cells

type Cells struct {
	Items []Cell `json:"items"`
}

func GetCells

func GetCells() (Cells, error)

type Cluster

type Cluster struct {
	// LocationOfOrigin indicates where this object came from.  It is used for round tripping config post-merge, but never serialized.
	LocationOfOrigin string `json:"-"`
	// Server is the address of the kubernetes cluster (https://hostname:port).
	Server string `json:"server"`
	// InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
	// +optional
	InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"`
	// CertificateAuthority is the path to a cert file for the certificate authority.
	// +optional
	CertificateAuthority string `json:"certificate-authority,omitempty"`
	// CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority
	// +optional
	CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"`
	// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
	// +optional
	Extensions map[string]interface{} `json:"extensions,omitempty"`
}

Cluster contains information about how to communicate with a kubernetes cluster

type ClusterInfo

type ClusterInfo struct {
	Name    string   `json:"name"`
	Cluster *Cluster `json:"cluster"`
}

type ClusterIngress

type ClusterIngress struct {
	Host string      `json:"host,omitempty"`
	Tls  interface{} `json:"tls,omitempty"`
}

type ComponentDetail

type ComponentDetail struct {
	Ingress       map[string]IngressDetail `json:"ingresses"`
	ComponentName string                   `json:"name"`
}

type ComponentScalePolicy

type ComponentScalePolicy struct {
	Name          string      `json:"name,omitempty"`
	ScalingPolicy interface{} `json:"scalingPolicy,omitempty"`
}

type ComponentTemplate

type ComponentTemplate struct {
	Metadata ComponentTemplateMetadata `json:"metadata"`
	Spec     ComponentTemplateSpec     `json:"spec"`
}

type ComponentTemplateMetadata

type ComponentTemplateMetadata struct {
	Name string `json:"name"`
}

type ComponentTemplateSpec

type ComponentTemplateSpec struct {
	PodTemplate PodTemplate `json:"template"`
	Ports       []Port      `json:"ports"`
}

type Composite

type Composite struct {
	Kind              string          `json:"kind"`
	APIVersion        string          `json:"apiVersion"`
	CompositeMetaData K8SMetaData     `json:"metadata"`
	CompositeSpec     CompositeSpec   `json:"spec"`
	CompositeStatus   CompositeStatus `json:"status"`
}

func GetComposite

func GetComposite(compositeName string) (Composite, error)

type CompositeSpec

type CompositeSpec struct {
	ComponentTemplates []ComponentTemplate `json:"components"`
}

type CompositeStatus

type CompositeStatus struct {
	Status       string `json:"status"`
	ServiceCount int    `json:"componentCount"`
}

type Composites

type Composites struct {
	Items []Composite `json:"items"`
}

func GetComposites

func GetComposites() (Composites, error)

type Config

type Config struct {
	// Legacy field from pkg/api/types.go TypeMeta.
	// TODO(jlowdermilk): remove this after eliminating downstream dependencies.
	// +optional
	Kind string `json:"kind,omitempty"`
	// Legacy field from pkg/api/types.go TypeMeta.
	// TODO(jlowdermilk): remove this after eliminating downstream dependencies.
	// +optional
	APIVersion string `json:"apiVersion,omitempty"`
	// Preferences holds general information to be use for cli interactions
	Preferences Preferences `json:"preferences"`
	// Clusters is a map of referencable names to cluster configs
	Clusters []*ClusterInfo `json:"clusters"`
	// AuthInfos is a map of referencable names to user configs
	AuthInfos []*UserInfo `json:"users"`
	// Contexts is a map of referencable names to context configs
	Contexts []*ContextInfo `json:"contexts"`
	// CurrentContext is the name of the context that you would like to use by default
	CurrentContext string `json:"current-context"`
	// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
	// +optional
	Extensions map[string]interface{} `json:"extensions,omitempty"`
}

Config holds the information needed to build connect to remote kubernetes clusters as a given user IMPORTANT if you add fields to this struct, please update IsConfigEmpty() +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func MergeConfig

func MergeConfig(old, new *Config) *Config

func ReadConfig

func ReadConfig(file string) (*Config, error)

type ContainerTemplate

type ContainerTemplate struct {
	Env   []Env  `json:"env,omitempty"`
	Image string `json:"image"`
	Name  string `json:"name"`
}

type Context

type Context struct {
	// LocationOfOrigin indicates where this object came from.  It is used for round tripping config post-merge, but never serialized.
	LocationOfOrigin string `json:"-"`
	// Cluster is the name of the cluster for this context
	Cluster string `json:"cluster"`
	// AuthInfo is the name of the authInfo for this context
	AuthInfo string `json:"user"`
	// Namespace is the default namespace to use on unspecified requests
	// +optional
	Namespace string `json:"namespace,omitempty"`
	// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
	// +optional
	Extensions map[string]interface{} `json:"extensions,omitempty"`
}

Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with)

type ContextInfo

type ContextInfo struct {
	Name    string   `json:"name"`
	Context *Context `json:"context"`
}

type Destination

type Destination struct {
	Host string `json:"host"`
}

type Env

type Env struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ExecConfig

type ExecConfig struct {
	// Command to execute.
	Command string `json:"command"`
	// Arguments to pass to the command when executing it.
	// +optional
	Args []string `json:"args"`
	// Env defines additional environment variables to expose to the process. These
	// are unioned with the host's environment, as well as variables client-go uses
	// to pass argument to the plugin.
	// +optional
	Env []ExecEnvVar `json:"env"`

	// Preferred input version of the ExecInfo. The returned ExecCredentials MUST use
	// the same encoding version as the input.
	APIVersion string `json:"apiVersion,omitempty"`
}

ExecConfig specifies a command to provide client credentials. The command is exec'd and outputs structured stdout holding credentials.

See the client.authentiction.k8s.io API group for specifications of the exact input and output format

type ExecEnvVar

type ExecEnvVar struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

ExecEnvVar is used for setting environment variables when executing an exec-based credential plugin.

type Extensions

type Extensions struct {
	ApiPublisher   ApiPublisherConfig `json:"apiPublisher,omitempty"`
	ClusterIngress ClusterIngress     `json:"clusterIngress"`
	Oidc           interface{}        `json:"oidc,omitempty"`
}

type Gateway

type Gateway struct {
	GatewaySpec GatewaySpec `json:"spec,omitempty"`
}

type GatewayConfig

type GatewayConfig struct {
	Context string `json:"context"`
	Vhost   string `json:"vhost"`
}

type GatewayDefinition

type GatewayDefinition struct {
	Method string `json:"method"`
	Path   string `json:"path"`
}

type GatewayGrpcApi

type GatewayGrpcApi struct {
	Backend     string              `json:"backend"`
	Context     string              `json:"context"`
	Definitions []GatewayDefinition `json:"definitions"`
	Global      bool                `json:"global"`
	Vhost       string              `json:"vhost"`
}

type GatewayHttpApi

type GatewayHttpApi struct {
	Context      string          `json:"context"`
	Version      string          `json:"version"`
	Definitions  []APIDefinition `json:"definitions"`
	Global       bool            `json:"global"`
	Authenticate bool            `json:"authenticate"`
	Port         uint32          `json:"port"`
	Destination  Destination     `json:"destination,omitempty"`
	ZeroScale    bool            `json:"zeroScale,omitempty"`
}

type GatewaySpec

type GatewaySpec struct {
	Ingress Ingress `json:"ingress,omitempty"`
}

type GatewayTcpApi

type GatewayTcpApi struct {
	Backend     string              `json:"backend"`
	Context     string              `json:"context"`
	Definitions []GatewayDefinition `json:"definitions"`
	Global      bool                `json:"global"`
	Vhost       string              `json:"vhost"`
}

type GwScalePolicy

type GwScalePolicy struct {
	ScalingPolicy interface{} `json:"scalingPolicy,omitempty"`
}

type HTTP

type HTTP struct {
	Match []HTTPMatch `json:"match"`
	Route []HTTPRoute `json:"route"`
}

type HTTPMatch

type HTTPMatch struct {
	Authority    Authority               `json:"authority"`
	SourceLabels map[string]string       `json:"sourceLabels"`
	Headers      map[string]*StringMatch `json:"headers,omitempty"`
}

type HTTPRoute

type HTTPRoute struct {
	Destination Destination `json:"destination"`
	Weight      int         `json:"weight,omitempty"`
}

type Ingress

type Ingress struct {
	Extensions Extensions       `json:"extensions,omitempty"`
	HttpApis   []GatewayHttpApi `json:"http,omitempty"`
	TcpApis    []GatewayTcpApi  `json:"tcp,omitempty"`
	GrpcApis   []GatewayGrpcApi `json:"grpc,omitempty"`
}

type IngressDetail

type IngressDetail struct {
	IngressType    string                     `json:"ingressType"`
	IngressTypeTCP string                     `json:"ingressTypeTCP"`
	ApiVersion     string                     `json:"apiVersion"`
	Port           int                        `json:"port"`
	Context        string                     `json:"context"`
	Expose         string                     `json:"expose"`
	Definition     map[string][]APIDefinition `json:"definition"`
	GatewayPort    int                        `json:"gatewayPort"`
	GatewayConfig  GatewayConfig              `json:"gatewayConfig"`
}

type InstanceKind

type InstanceKind string
const (
	InstanceKindCell      InstanceKind = "cells.mesh.cellery.io"
	InstanceKindComposite InstanceKind = "composites.mesh.cellery.io"
)

type K8SMetaData

type K8SMetaData struct {
	CreationTimestamp string          `json:"creationTimestamp"`
	Annotations       CellAnnotations `json:"annotations"`
	Name              string          `json:"name"`
}

type K8sVersion

type K8sVersion struct {
	ServerVersion struct {
		GitVersion string
	}
	ClientVersion struct {
		GitVersion string
	}
}

type KubeCli

type KubeCli interface {
	GetCells() ([]Cell, error)
	SetVerboseMode(enable bool)
	DeleteResource(kind, instance string) (string, error)
	GetComposites() ([]Composite, error)
	GetInstancesNames() ([]string, error)
	GetCell(cellName string) (Cell, error)
	GetComposite(compositeName string) (Composite, error)
	GetInstanceBytes(instanceKind, InstanceName string) ([]byte, error)
	DescribeCell(cellName string) error
	Version() (string, string, error)
	GetServices(cellName string) (Services, error)
	GetCellLogsUserComponents(cellName string) (string, error)
	GetCellLogsAllComponents(cellName string) (string, error)
	GetComponentLogs(cellName, componentName string) (string, error)
	JsonPatch(kind, instance, jsonPatch string) error
	ApplyFile(file string) error
	GetCellInstanceAsMapInterface(cell string) (map[string]interface{}, error)
	GetCompositeInstanceAsMapInterface(composite string) (map[string]interface{}, error)
	GetPodsForCell(cellName string) (Pods, error)
	GetPodsForComposite(compName string) (Pods, error)
}

KubeCli represents kubernetes client.

type Metric

type Metric struct {
	Type     string   `json:"type"`
	Resource Resource `json:"resource"`
}

type Node

type Node struct {
	Items []NodeItem `json:"items"`
}

func GetNodes

func GetNodes() (Node, error)

type NodeInfo

type NodeInfo struct {
	KubeletVersion string `json:"kubeletVersion"`
}

type NodeItem

type NodeItem struct {
	Metadata NodeMetaData `json:"metadata"`
	Status   NodeStatus   `json:"status"`
}

type NodeMetaData

type NodeMetaData struct {
	Name string `json:"name"`
}

type NodeStatus

type NodeStatus struct {
	NodeInfo NodeInfo `json:"nodeInfo"`
}

type Pod

type Pod struct {
	MetaData  PodMetaData `json:"metadata"`
	PodStatus PodStatus   `json:"status"`
}

type PodCondition

type PodCondition struct {
	Type               string `json:"type"`
	Status             string `json:"status"`
	LastTransitionTime string `json:"lastTransitionTime"`
}

type PodMetaData

type PodMetaData struct {
	Name string `json:"name"`
}

type PodStatus

type PodStatus struct {
	Phase      string         `json:"phase"`
	StartTime  string         `json:"startTime"`
	Conditions []PodCondition `json:"conditions"`
}

type PodTemplate

type PodTemplate struct {
	Containers []ContainerTemplate `json:"containers"`
}

type Pods

type Pods struct {
	Items []Pod `json:"items"`
}

type Policy

type Policy struct {
	MinReplicas    string         `json:"minReplicas"`
	MaxReplicas    int            `json:"maxReplicas"`
	ScaleTargetRef ScaleTargetRef `json:"scaleTargetRef"`
	Metrics        []Metric       `json:"metrics"`
}

type Port

type Port struct {
	Name            string `json:"name,omitempty"`
	Protocol        string `json:"protocol"`
	Port            int32  `json:"port"`
	TargetContainer string `json:"targetContainer,omitempty"`
	TargetPort      int32  `json:"targetPort"`
}

type Preferences

type Preferences struct {
	// +optional
	Colors bool `json:"colors,omitempty"`
	// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
	// +optional
	Extensions map[string]interface{} `json:"extensions,omitempty"`
}

IMPORTANT if you add fields to this struct, please update IsConfigEmpty()

type Resource

type Resource struct {
	Name                     string `json:"name"`
	TargetAverageUtilization int    `json:"targetAverageUtilization,omitempty"`
	TargetAverageValue       string `json:"targetAverageValue,omitempty"`
}

type ScaleResource

type ScaleResource struct {
	Spec struct {
		Components []struct {
			Metadata struct {
				Name string `json:"name,omitempty"`
			} `json:"metadata,omitempty"`
			Spec struct {
				ScalingPolicy interface{} `json:"scalingPolicy,omitempty"`
			} `json:"spec,omitempty"`
		} `json:"components,omitempty"`
		Gateway struct {
			Metadata struct {
				Name string `json:"name,omitempty"`
			} `json:"metadata,omitempty"`
			Spec struct {
				ScalingPolicy interface{} `json:"scalingPolicy,omitempty"`
			} `json:"spec,omitempty"`
		} `json:"gateway,omitempty"`
	} `json:"spec,omitempty"`
}

type ScaleTargetRef

type ScaleTargetRef struct {
	ApiVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`
	Name       string `json:"name"`
}

type ScalingPolicy

type ScalingPolicy struct {
	Hpa struct {
		Overridable *bool `json:"overridable,omitempty"`
	} `json:"hpa,omitempty"`
}

type Service

type Service struct {
	Metadata ServiceMetaData `json:"metadata"`
	Spec     ServiceSpec     `json:"spec"`
}

func GetService

func GetService(service, namespace string) (Service, error)

type ServiceMetaData

type ServiceMetaData struct {
	Name string `json:"name"`
}

type ServicePort

type ServicePort struct {
	Port int `json:"port"`
}

type ServiceSpec

type ServiceSpec struct {
	Ports       []ServicePort `json:"ports"`
	ExternalIPs []string      `json:"externalIPs"`
}

type Services

type Services struct {
	Items []Service `json:"items"`
}

type StringMatch

type StringMatch struct {
	Exact  string `json:"exact,omitempty"`
	Prefix string `json:"prefix,omitempty"`
	Regex  string `json:"regex,omitempty"`
}

type TCP

type TCP struct {
	Match []TCPMatch `json:"match"`
	Route []TCPRoute `json:"route"`
}

type TCPDestination

type TCPDestination struct {
	Host string  `json:"host"`
	Port TCPPort `json:"port"`
}

type TCPMatch

type TCPMatch struct {
	Port         int               `json:"port"`
	SourceLabels map[string]string `json:"sourceLabels"`
}

type TCPPort

type TCPPort struct {
	Number int `json:"number"`
}

type TCPRoute

type TCPRoute struct {
	Destination TCPDestination `json:"destination"`
	Weight      int            `json:"weight,omitempty"`
}

type UserInfo

type UserInfo struct {
	Name string    `json:"name"`
	User *AuthInfo `json:"user"`
}

type VirtualService

type VirtualService struct {
	Kind       string     `json:"kind"`
	APIVersion string     `json:"apiVersion"`
	VsMetaData VsMetaData `json:"metadata"`
	VsSpec     VsSpec     `json:"spec"`
}

func GetVirtualService

func GetVirtualService(vs string) (VirtualService, error)

type VsMetaData

type VsMetaData struct {
	Name string `json:"name"`
}

type VsSpec

type VsSpec struct {
	Hosts []string `json:"hosts"`
	HTTP  []HTTP   `json:"http,omitempty"`
	TCP   []TCP    `json:"tcp,omitempty"`
}

Jump to

Keyboard shortcuts

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