client

package
v1.16.0 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 added in v1.16.0

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

Deployment is Kubernetes deployment

type DeploymentList added in v1.16.0

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 added in v1.16.0

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

Spec defines micro deployment spec

type Status added in v1.16.0

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

Status is Kubernetes deployment status

type Template added in v1.16.0

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