client

package
v1.16.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrReadNamespace is returned when the names could not be read from service account
	ErrReadNamespace = errors.New("Could not read namespace from service account secret")
)

Functions

func CertPoolFromFile

func CertPoolFromFile(filename string) (*x509.CertPool, error)

CertPoolFromFile returns an x509.CertPool containing the certificates in the given PEM-encoded file. Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates

func CertsFromPEM

func CertsFromPEM(pemCerts []byte) ([]*x509.Certificate, error)

CertsFromPEM returns the x509.Certificates contained in the given PEM-encoded byte array Returns an error if a certificate could not be parsed, or if the data does not contain any certificates

func NewClientInCluster

func NewClientInCluster() *client

NewClientInCluster should work similarily to the official api NewInClient by setting up a client configuration for use within a k8s pod.

Types

type Deployment

type Deployment struct {
	Metadata *Metadata `json:"metadata"`
	Status   *Status   `json:"status"`
}

Deployment is Kubernetes deployment

type DeploymentList

type DeploymentList struct {
	Items []Deployment `json:"items"`
}

DeploymentList

type Kubernetes

type Kubernetes interface {
	// UpdateDeployment patches deployment annotations with new metadata
	UpdateDeployment(string, interface{}) error
	// ListDeployments lists all micro deployments
	ListDeployments(labels map[string]string) (*DeploymentList, error)
}

Kubernetes client

type Metadata

type Metadata struct {
	Name        string            `json:"name,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

Metadata defines api request metadata

type Spec

type Spec struct {
	Template *Template `json:"template,omitempty"`
}

Spec defines micro deployment spec

type Status

type Status struct {
	Replicas          int `json:"replicas"`
	AvailableReplicas int `json:"availablereplicas"`
}

Status is Kubernetes deployment status

type Template

type Template struct {
	Metadata *Metadata `json:"metadata,omitempty"`
}

Template is micro deployment template

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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