Documentation ¶
Index ¶
- Constants
- func AddAppLabels(manifestYaml []byte, appLabels map[string]string) ([]byte, error)
- func ExtractDocuments(manifestYaml []byte, postProcessYaml func(interface{}) error) ([][]byte, error)
- func GetHelmAppLabels(name, owner string) map[string]string
- func GetNamespace(manifestYaml []byte) (string, error)
- type KubeAppLabels
- type KubeClusterAccessService
- type Snapshotter
Constants ¶
const (
// DefaultNamespace is the default namespace used when no namespace is specified
DefaultNamespace = "default"
)
Variables ¶
This section is empty.
Functions ¶
func AddAppLabels ¶
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 ¶
GetHelmAppLabels returns the labels to be applied to portainer deployed helm applications
func GetNamespace ¶
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 ¶
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)