k8s

package
v0.0.0-...-3b5879d Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExternalSecretsEnabled = false

Functions

func CRDClient

func CRDClient(groupVersion *schema.GroupVersion) (*rest.RESTClient, error)

CRDClient returns rest.RESTClient for CustomResourceDefinitions

Types

type Client

type Client struct {
	Interface kubernetes.Interface
	Namespace string
	CRDClient rest.Interface
}

Client is a top level struct, wrapping all other clients

func ClientForNamespace

func ClientForNamespace(ns string) (*Client, error)

ClientForNamespace configures REST client to operate in a given namespace

func (*Client) ConfigMap

func (c *Client) ConfigMap() *ConfigMap

ConfigMap builds ConfigMap client

func (*Client) CustomResourceDefinition

func (c *Client) CustomResourceDefinition(kind string) *CustomResourceDefinition

CustomResourceDefinition builds CRD client

func (*Client) Deployment

func (c *Client) Deployment() *Deployment

Deployment builds Deployment client

func (*Client) ExternalSecret

func (c *Client) ExternalSecret() *ExternalSecret

ExternalSecret builds ExternalSec

func (*Client) HorizontalPodAutoscaler

func (c *Client) HorizontalPodAutoscaler() *HorizontalPodAutoscaler

HorizontalPodAutoscaler builds HPA client

func (*Client) Ingress

func (c *Client) Ingress() *Ingress

Ingress builds Ingress client

func (*Client) Job

func (c *Client) Job() *Job

ConfigMap builds ConfigMap client

func (*Client) Ns

func (c *Client) Ns() *Namespace

Ns builds Ingress client

func (*Client) PVC

func (c *Client) PVC() *PersistentVolumeClaim

PVC builds PersistentVolumeClaim client

func (*Client) Pod

func (c *Client) Pod() *Pod

Pod builds Pod client

func (*Client) Secret

func (c *Client) Secret() *Secret

Secret builds Secrets client

func (*Client) Service

func (c *Client) Service() *Service

Service builds Service client

func (*Client) StatefulSet

func (c *Client) StatefulSet() *StatefulSet

StatefulSet builds Statefulset client

type ConfigMap

type ConfigMap struct {
	kubernetes.Interface
	Namespace string
}

ConfigMap type actions on configmaps in k8s cluster

func (*ConfigMap) Apply

func (client *ConfigMap) Apply(resource *v1.ConfigMap) error

Apply updates or creates ingress in k8s

func (*ConfigMap) Create

func (client *ConfigMap) Create(resource *v1.ConfigMap) error

Create creates new configmap in k8s

func (*ConfigMap) Destroy

func (client *ConfigMap) Destroy(name string) error

Destroy deletes configmap from the k8 cluster

func (*ConfigMap) Exist

func (client *ConfigMap) Exist(name string) bool

Exist returns boolean value if ingress exists in k8s

func (*ConfigMap) Get

func (client *ConfigMap) Get(name string) (*v1.ConfigMap, error)

Get returns ingress object from the k8s by name

func (*ConfigMap) List

func (client *ConfigMap) List() ([]v1.ConfigMap, error)

List returns the list of k8s services maintained by pipeline

func (*ConfigMap) Update

func (client *ConfigMap) Update(resource *v1.ConfigMap) error

Update updates existing ingress in k8s

type CronJob

type CronJob struct {
	kubernetes.Interface
	Namespace string
}

CronJob type actions on cronjobs in k8s cluster

func (*CronJob) Apply

func (client *CronJob) Apply(resource *v1beta1.CronJob) error

Apply updates or creates service in k8s

func (*CronJob) Create

func (client *CronJob) Create(resource *v1beta1.CronJob) error

Create creates new service in k8s

func (*CronJob) Destroy

func (client *CronJob) Destroy(name string) error

Destroy deletes service from the k8 cluster

func (*CronJob) Exist

func (client *CronJob) Exist(name string) bool

Exist returns boolean value if pvc exists in k8s

func (*CronJob) Get

func (client *CronJob) Get(name string) (*v1beta1.CronJob, error)

Get returns service object from the k8s by name

func (*CronJob) List

func (client *CronJob) List() ([]v1beta1.CronJob, error)

List returns the list of k8s services maintained by pipeline

func (*CronJob) Update

func (client *CronJob) Update(resource *v1beta1.CronJob) error

Update updates existing service in k8s

type CustomResourceDefinition

type CustomResourceDefinition struct {
	rest.Interface

	Namespace string
	Type      string
}

CustomResourceDefinition represents TPR API on the cluster

func (*CustomResourceDefinition) Apply

Apply creates or updates PrsnExternalResource in k8s

func (*CustomResourceDefinition) Create

Create creates given tpr in

func (*CustomResourceDefinition) Destroy

func (client *CustomResourceDefinition) Destroy(name string) error

Destroy deletes named resource

func (*CustomResourceDefinition) Exist

func (client *CustomResourceDefinition) Exist(name string) bool

Exist checks if named resource exist in k8s cluster

func (*CustomResourceDefinition) Get

Get retrieves PrsnExternalResource from the k8s using name

func (*CustomResourceDefinition) List

List returns a list of tprs. Depends on kind.

func (*CustomResourceDefinition) Update

Update updates existing resource in k8s

type Deployment

type Deployment struct {
	kubernetes.Interface
	Namespace string
}

Deployment type actions on ingresses in k8s cluster

func (*Deployment) Apply

func (client *Deployment) Apply(deployment *apps_v1.Deployment) error

Apply updates or creates deployment in k8s

func (*Deployment) Create

func (client *Deployment) Create(deployment *apps_v1.Deployment) error

Create creates new deployment in k8s

func (*Deployment) Destroy

func (client *Deployment) Destroy(name string) error

Destroy deletes deployment from the k8 cluster

func (*Deployment) Exist

func (client *Deployment) Exist(name string) bool

Exist returns boolean value if deployment exists in k8s

func (*Deployment) Get

func (client *Deployment) Get(name string) (*apps_v1.Deployment, error)

Get returns deployment object from the k8s by name

func (*Deployment) List

func (client *Deployment) List() ([]apps_v1.Deployment, error)

List returns the list of k8s services maintained by pipeline

func (*Deployment) Update

func (client *Deployment) Update(deployment *apps_v1.Deployment) error

Update updates existing deployment in k8s

type ExternalSecret

type ExternalSecret struct {
	rest.Interface

	Namespace string
	Type      string
}

ExternalSecret represents ExternalSecret crd on the cluster

func (*ExternalSecret) Apply

func (client *ExternalSecret) Apply(resource *extensions.ExternalSecret) error

Apply creates or updates ExternalSecret in k8s

func (*ExternalSecret) Create

func (client *ExternalSecret) Create(resource *extensions.ExternalSecret) error

Create creates given ExternalSecret in k8s

func (*ExternalSecret) Destroy

func (client *ExternalSecret) Destroy(name string) error

Destroy deletes named resource

func (*ExternalSecret) Exist

func (client *ExternalSecret) Exist(name string) bool

Exist checks if named resource exist in k8s cluster

func (*ExternalSecret) Get

func (client *ExternalSecret) Get(name string) (*extensions.ExternalSecret, error)

Get retrieves ExternalSecret from the k8s using name

func (*ExternalSecret) List

func (client *ExternalSecret) List() ([]extensions.ExternalSecret, error)

List returns a list of ExternalSecret.

func (*ExternalSecret) Update

func (client *ExternalSecret) Update(resource *extensions.ExternalSecret) error

Update updates existing resource in k8s

type HorizontalPodAutoscaler

type HorizontalPodAutoscaler struct {
	kubernetes.Interface
	Namespace string
}

HorizontalPodAutoscaler type actions in k8s cluster

func (*HorizontalPodAutoscaler) Apply

Apply updates or creates hpa in k8s

func (*HorizontalPodAutoscaler) Create

Create creates new hpa in k8s

func (*HorizontalPodAutoscaler) Destroy

func (client *HorizontalPodAutoscaler) Destroy(name string) error

Destroy deletes service from the k8 cluster

func (*HorizontalPodAutoscaler) Exist

func (client *HorizontalPodAutoscaler) Exist(name string) bool

Exist returns boolean value if hpa exists in k8s

func (*HorizontalPodAutoscaler) Get

Get returns hpa object from k8s by name

func (*HorizontalPodAutoscaler) List

List returns the list of k8s hpa

func (*HorizontalPodAutoscaler) Update

Update updates existing hpa in k8s

type Ingress

type Ingress struct {
	kubernetes.Interface
	Namespace string
}

Ingress type actions on ingresses in k8s cluster

func (*Ingress) Apply

func (client *Ingress) Apply(resource *netwk_v1beta1.Ingress) error

Apply updates or creates ingress in k8s

func (*Ingress) Create

func (client *Ingress) Create(resource *netwk_v1beta1.Ingress) error

Create creates new ingress in k8s

func (*Ingress) Destroy

func (client *Ingress) Destroy(name string) error

Destroy deletes ingress from the k8 cluster

func (*Ingress) Exist

func (client *Ingress) Exist(name string) bool

Exist returns boolean value if ingress exists in k8s

func (*Ingress) Get

func (client *Ingress) Get(name string) (*netwk_v1beta1.Ingress, error)

Get returns ingress object from the k8s by name

func (*Ingress) List

func (client *Ingress) List() ([]netwk_v1beta1.Ingress, error)

List returns the list of k8s services maintained by pipeline

func (*Ingress) Update

func (client *Ingress) Update(resource *netwk_v1beta1.Ingress) error

Update updates existing ingress in k8s

type Job

type Job struct {
	kubernetes.Interface
	Namespace string
}

Job type actions on pvcs in k8s cluster

func (*Job) Apply

func (client *Job) Apply(resource *v1batch.Job) error

Apply updates or creates service in k8s

func (*Job) Create

func (client *Job) Create(resource *v1batch.Job) error

Create creates new service in k8s

func (*Job) Destroy

func (client *Job) Destroy(name string) error

Destroy deletes service from the k8 cluster

func (*Job) Exist

func (client *Job) Exist(name string) bool

Exist returns boolean value if pvc exists in k8s

func (*Job) Get

func (client *Job) Get(name string) (*v1batch.Job, error)

Get returns service object from the k8s by name

func (*Job) List

func (client *Job) List() ([]v1batch.Job, error)

List returns the list of k8s services maintained by pipeline

func (*Job) Update

func (client *Job) Update(job *v1batch.Job) error

Update updates existing job in k8s

type Namespace

type Namespace struct {
	Interface kubernetes.Interface
	Namespace string
}

Namespace is a client for interacting with namespaces

func (*Namespace) Get

func (client *Namespace) Get() (*v1.Namespace, error)

Get returns namespace object from the k8s by name

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	kubernetes.Interface
	Namespace string
}

PersistentVolumeClaim type actions on pvcs in k8s cluster

func (*PersistentVolumeClaim) Apply

func (client *PersistentVolumeClaim) Apply(resource *v1.PersistentVolumeClaim) error

Apply updates or creates pvc in k8s

func (*PersistentVolumeClaim) Create

func (client *PersistentVolumeClaim) Create(resource *v1.PersistentVolumeClaim) error

Create creates new ingress in k8s

func (*PersistentVolumeClaim) Destroy

func (client *PersistentVolumeClaim) Destroy(name string) error

Destroy deletes pvc from the k8 cluster

func (*PersistentVolumeClaim) Exist

func (client *PersistentVolumeClaim) Exist(name string) bool

Exist returns boolean value if pvc exists in k8s

func (*PersistentVolumeClaim) Get

Get returns pvc object from the k8s by name

func (*PersistentVolumeClaim) List

List returns the list of k8s services maintained by pipeline

func (*PersistentVolumeClaim) Update

func (client *PersistentVolumeClaim) Update(resource *v1.PersistentVolumeClaim) error

Update updates existing ingress in k8s

type Pod

type Pod struct {
	kubernetes.Interface
	Namespace string
}

Pod type actions on pods in k8s cluster

func (*Pod) GetLogs

func (client *Pod) GetLogs(name string) (string, error)

GetLogs returns pod's logs as a string

func (*Pod) List

func (client *Pod) List() ([]v1.Pod, error)

List returns the list of k8s services maintained by pipeline

type Secret

type Secret struct {
	kubernetes.Interface
	Namespace string
}

Secret is a client for interacting with secrets

func (*Secret) Apply

func (client *Secret) Apply(resource *v1.Secret) error

Apply updates or creates secrets in k8s

func (*Secret) Create

func (client *Secret) Create(resource *v1.Secret) error

Create creates new secret in k8s

func (*Secret) Exists

func (client *Secret) Exists(secretname string) bool

Exists checks if the secret exists in the namespace

func (*Secret) Get

func (client *Secret) Get(name string) (*v1.Secret, error)

Get returns secret object from the k8s by name

func (*Secret) List

func (client *Secret) List() ([]v1.Secret, error)

List returns the list of k8s secrets maintained by pipeline for provided client

func (*Secret) Update

func (client *Secret) Update(resource *v1.Secret) error

Update updates existing secrets in k8s

type Service

type Service struct {
	kubernetes.Interface
	Namespace string
}

Service type actions on pvcs in k8s cluster

func (*Service) Apply

func (client *Service) Apply(resource *v1.Service) error

Apply updates or creates service in k8s

func (*Service) Create

func (client *Service) Create(resource *v1.Service) error

Create creates new service in k8s

func (*Service) Destroy

func (client *Service) Destroy(name string) error

Destroy deletes service from the k8 cluster

func (*Service) Exist

func (client *Service) Exist(name string) bool

Exist returns boolean value if pvc exists in k8s

func (*Service) Get

func (client *Service) Get(name string) (*v1.Service, error)

Get returns service object from the k8s by name

func (*Service) List

func (client *Service) List() ([]v1.Service, error)

List returns the list of k8s services maintained by pipeline

func (*Service) Update

func (client *Service) Update(resource *v1.Service) error

Update updates existing service in k8s

type StatefulSet

type StatefulSet struct {
	kubernetes.Interface
	Namespace string
}

StatefulSet type actions on statefulset in k8s cluster

func (*StatefulSet) Apply

func (client *StatefulSet) Apply(resource *apps_v1.StatefulSet) error

Apply updates or creates statefulset in k8s

func (*StatefulSet) Create

func (client *StatefulSet) Create(resource *apps_v1.StatefulSet) error

Create creates new statefulset in k8s

func (*StatefulSet) Destroy

func (client *StatefulSet) Destroy(name string) error

Destroy deletes statefulset from the k8 cluster

func (*StatefulSet) Exist

func (client *StatefulSet) Exist(name string) bool

Exist returns boolean value if statefulset exists in k8s

func (*StatefulSet) Get

func (client *StatefulSet) Get(name string) (*apps_v1.StatefulSet, error)

Get returns statefulset object from the k8s by name

func (*StatefulSet) List

func (client *StatefulSet) List() ([]apps_v1.StatefulSet, error)

List returns the list of k8s services maintained by pipeline

func (*StatefulSet) Update

func (client *StatefulSet) Update(resource *apps_v1.StatefulSet) error

Update stateful set

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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