kubernetes

package
v0.0.0-...-270f78c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Zlib Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNamespace is the default namespace used when no namespace is specified
	DefaultNamespace = "default"
)

Variables

This section is empty.

Functions

func AddAppLabels

func AddAppLabels(manifestYaml []byte, appLabels map[string]string) ([]byte, error)

AddAppLabels adds required labels to "Resource"->metadata->labels. It'll add those labels to all Resource (nodes with a kind property exluding a list) it can find in provided yaml. Items in the yaml file could either be organised as a list or broken into multi documents.

func ExtractDocuments

func ExtractDocuments(manifestYaml []byte, postProcessYaml func(interface{}) error) ([][]byte, error)

ExtractDocuments extracts all the documents from a yaml file Optionally post-process each document with a function, which can modify the document in place. Pass in nil for postProcessYaml to skip post-processing.

func GetHelmAppLabels

func GetHelmAppLabels(name, owner string) map[string]string

GetHelmAppLabels returns the labels to be applied to portainer deployed helm applications

func GetNamespace

func GetNamespace(manifestYaml []byte) (string, error)

GetNamespace returns the namespace of a kubernetes resource from its metadata It returns an empty string if namespace is not found in the resource

Types

type KubeAppLabels

type KubeAppLabels struct {
	StackID   int
	StackName string
	Owner     string
	Kind      string
}

KubeAppLabels are labels applied to all resources deployed in a kubernetes stack

func (*KubeAppLabels) ToMap

func (kal *KubeAppLabels) ToMap() map[string]string

ToMap converts KubeAppLabels to a map[string]string

type KubeClusterAccessService

type KubeClusterAccessService interface {
	IsSecure() bool
	GetData(hostURL string, endpointId portainer.EndpointID) kubernetesClusterAccessData
}

KubeClusterAccessService represents a service that is responsible for centralizing kube cluster access data

func NewKubeClusterAccessService

func NewKubeClusterAccessService(baseURL, httpsBindAddr, tlsCertPath string) KubeClusterAccessService

NewKubeClusterAccessService creates a new instance of a KubeClusterAccessService

type Snapshotter

type Snapshotter struct {
	// contains filtered or unexported fields
}

func NewSnapshotter

func NewSnapshotter(clientFactory *cli.ClientFactory) *Snapshotter

NewSnapshotter returns a new Snapshotter instance

func (*Snapshotter) CreateSnapshot

func (snapshotter *Snapshotter) CreateSnapshot(endpoint *portainer.Endpoint) (*portainer.KubernetesSnapshot, error)

CreateSnapshot creates a snapshot of a specific Kubernetes environment(endpoint)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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