k8s

package
v0.0.0-...-a288e68 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNamespace = "psmdb"
	DefaultInitDelay = "0s"
)
View Source
const (
	EnvKubernetesHost = "KUBERNETES_SERVICE_HOST"
	EnvKubernetesPort = "KUBERNETES_SERVICE_PORT"
)
View Source
const (
	EnvNamespace = "NAMESPACE"
)

Variables

This section is empty.

Functions

func GetMongoHost

func GetMongoHost(pod, service, replset, namespace string) string

Types

type CustomResourceState

type CustomResourceState struct {
	Name           string
	Pods           []corev1.Pod
	Services       []corev1.Service
	ServicesExpose bool
	Statefulsets   []appsv1.StatefulSet
}

CustomResourceState represents the state of a single Kubernetes CR for PSMDB

type Pods

type Pods struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewPods

func NewPods(namespace string) *Pods

func (*Pods) Delete

func (p *Pods) Delete(crState *CustomResourceState)

Delete deletes the state of a single PSMDB CR

func (*Pods) GetTasks

func (p *Pods) GetTasks(podName string) ([]pod.Task, error)

GetTasks returns tasks for a single pod by name

func (*Pods) Name

func (p *Pods) Name() string

func (*Pods) Pods

func (p *Pods) Pods() ([]string, error)

Pods returns all available pod names

func (*Pods) URL

func (p *Pods) URL() string

func (*Pods) Update

func (p *Pods) Update(crState *CustomResourceState)

Update updates the state of a single PSMDB CR

type Task

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

func NewTask

func NewTask(namespace string, cr *CustomResourceState, pod *corev1.Pod) *Task

func (*Task) GetMongoAddr

func (t *Task) GetMongoAddr() (*db.Addr, error)

func (*Task) GetMongoReplsetName

func (t *Task) GetMongoReplsetName() (string, error)

func (*Task) HasState

func (t *Task) HasState() bool

func (*Task) IsRunning

func (t *Task) IsRunning() bool

func (*Task) IsTaskType

func (t *Task) IsTaskType(taskType pod.TaskType) bool

func (*Task) IsUpdating

func (t *Task) IsUpdating() bool

func (*Task) Name

func (t *Task) Name() string

func (*Task) Service

func (t *Task) Service() string

func (*Task) State

func (t *Task) State() pod.TaskState

type TaskState

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

func NewTaskState

func NewTaskState(status corev1.PodStatus) *TaskState

func (TaskState) String

func (ts TaskState) String() string

Jump to

Keyboard shortcuts

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