resources

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMap

type ConfigMap struct {
	Name   string            `sm:"metadata.name"`
	Labels map[string]string `sm:"metadata.labels"`
	Data   map[string]string `sm:"data"`
}

func (ConfigMap) API

func (ConfigMap) Dump

func (cm ConfigMap) Dump(from interface{}) (interface{}, error)

func (ConfigMap) Load

func (cm ConfigMap) Load(from, into interface{}) error

type ConfigMapAPI

type ConfigMapAPI struct {
	base.KubeAPI
}

func (*ConfigMapAPI) Create

func (cm *ConfigMapAPI) Create(namespace string, obj interface{}) error

func (*ConfigMapAPI) Delete

func (cm *ConfigMapAPI) Delete(name, namespace string) error

func (*ConfigMapAPI) Get

func (cm *ConfigMapAPI) Get(name, namespace string) (interface{}, error)

func (*ConfigMapAPI) List

func (cm *ConfigMapAPI) List(namespace string) ([]interface{}, error)

func (*ConfigMapAPI) Update

func (cm *ConfigMapAPI) Update(namespace string, obj interface{}) error

type Container

type Container struct {
	Name      string              `sm:"name"`
	Image     string              `sm:"image"`
	Ports     []ContainerPort     `sm:"ports"`
	Command   []string            `sm:"command"`
	Resources *ContainerResources `sm:"resources.limits"`
	Env       []EnvVar            `sm:"env"`
}

type ContainerPort

type ContainerPort struct {
	Port int `sm:"containerPort"`
}

type ContainerResources

type ContainerResources struct {
	Cpu    string `json:"cpu"`
	Memory string `json:"memory"`
}

type CronJob

type CronJob struct {
	Name           string            `sm:"metadata.name"`
	Schedule       string            `sm:"spec.schedule"`
	Behaviour      CronJobBehaviour  `sm:"->"`
	ServiceAccount string            `sm:"spec.jobTemplate.spec.template.spec.serviceAccountName"`
	Containers     []Container       `sm:"spec.jobTemplate.spec.template.spec.containers"`
	Labels         map[string]string `sm:"metadata.labels"`
	NodeSelector   map[string]string `sm:"spec.jobTemplate.spec.template.spec.nodeSelector"`
	TemplateLabels map[string]string `sm:"spec.jobTemplate.spec.template.metadata.labels"`
}

func (CronJob) API

func (cj CronJob) API() NamespacedResourceAPI

func (CronJob) Dump

func (cj CronJob) Dump(from interface{}) (interface{}, error)

func (CronJob) Load

func (cj CronJob) Load(from, into interface{}) error

type CronJobAPI

type CronJobAPI struct {
	base.KubeAPI
}

func (*CronJobAPI) Create

func (cj *CronJobAPI) Create(namespace string, obj interface{}) error

func (*CronJobAPI) Delete

func (cj *CronJobAPI) Delete(name, namespace string) error

func (*CronJobAPI) Get

func (cj *CronJobAPI) Get(name, namespace string) (interface{}, error)

func (*CronJobAPI) List

func (cj *CronJobAPI) List(namespace string) ([]interface{}, error)

func (*CronJobAPI) Update

func (cj *CronJobAPI) Update(namespace string, obj interface{}) error

type CronJobBehaviour

type CronJobBehaviour struct {
	RestartPolicy    v1.RestartPolicy `sm:"spec.jobTemplate.spec.template.spec.restartPolicy"`
	SuccessHistory   int32            `sm:"spec.successfulJobsHistoryLimit"`
	FailedHistory    int32            `sm:"spec.failedJobsHistoryLimit"`
	StartingDeadline int64            `sm:"spec.startingDeadlineSeconds"`
}

type Deployment

type Deployment struct {
	Name            string            `sm:"metadata.name"`
	ServiceAccount  string            `sm:"spec.template.spec.serviceAccountName"`
	Containers      []Container       `sm:"spec.template.spec.containers"`
	Labels          map[string]string `sm:"metadata.labels"`
	TemplateLabels  map[string]string `sm:"spec.template.metadata.labels"`
	ServiceSelector map[string]string `sm:"spec.selector.matchLabels"`
	NodeSelector    map[string]string `sm:"spec.template.spec.nodeSelector"`
}

func (Deployment) API

func (Deployment) Dump

func (d Deployment) Dump(from interface{}) (interface{}, error)

func (Deployment) Load

func (d Deployment) Load(from, into interface{}) error

type DeploymentAPI

type DeploymentAPI struct {
	base.KubeAPI
}

func (*DeploymentAPI) Create

func (d *DeploymentAPI) Create(namespace string, obj interface{}) error

func (*DeploymentAPI) Delete

func (d *DeploymentAPI) Delete(name, namespace string) error

func (*DeploymentAPI) Get

func (d *DeploymentAPI) Get(name, namespace string) (interface{}, error)

func (*DeploymentAPI) List

func (d *DeploymentAPI) List(namespace string) ([]interface{}, error)

func (*DeploymentAPI) Update

func (d *DeploymentAPI) Update(namespace string, obj interface{}) error

type EnvVar

type EnvVar struct {
	Name  string `sm:"name"`
	Value string `sm:"value"`
}

type HPA added in v0.2.0

type HPA struct {
	Name    string      `sm:"metadata.name"`
	Min     int         `sm:"spec.minReplicas"`
	Max     int         `sm:"spec.maxReplicas"`
	Target  HPATarget   `sm:"spec.scaleTargetRef"`
	Metrics []HPAMetric `sm:"spec.metrics"`
}

func (HPA) API added in v0.2.0

func (h HPA) API() NamespacedResourceAPI

func (HPA) Dump added in v0.2.0

func (h HPA) Dump(from interface{}) (interface{}, error)

func (HPA) Load added in v0.2.0

func (h HPA) Load(from, into interface{}) error

type HPAMetric added in v0.2.0

type HPAMetric struct {
	Type     scaling.MetricSourceType `sm:"type"`
	Resource HPAResourceMetric        `sm:"resource"`
}

type HPAResourceMetric added in v0.2.0

type HPAResourceMetric struct {
	Name        string                   `sm:"name"`
	Type        scaling.MetricTargetType `sm:"target.type"`
	Utilization int                      `sm:"target.averageUtilization"`
}

type HPATarget added in v0.2.0

type HPATarget struct {
	Name       string `sm:"name"`
	Kind       string `sm:"kind"`
	APIVersion string `sm:"apiVersion"`
}

type HPAapi added in v0.2.0

type HPAapi struct {
	base.KubeAPI
}

func (*HPAapi) Create added in v0.2.0

func (h *HPAapi) Create(namespace string, obj interface{}) error

func (*HPAapi) Delete added in v0.2.0

func (h *HPAapi) Delete(name, namespace string) error

func (*HPAapi) Get added in v0.2.0

func (h *HPAapi) Get(name, namespace string) (interface{}, error)

func (*HPAapi) List added in v0.2.0

func (h *HPAapi) List(namespace string) ([]interface{}, error)

func (*HPAapi) Update added in v0.2.0

func (h *HPAapi) Update(namespace string, obj interface{}) error

type Ingress

type Ingress struct {
	Name   string            `sm:"metadata.name"`
	Domain string            `sm:"spec.rules[0].host"`
	Paths  []IngressPathDef  `sm:"spec.rules[0].http.paths"`
	Labels map[string]string `sm:"metadata.labels"`
}

func (Ingress) API

func (Ingress) Dump

func (i Ingress) Dump(from interface{}) (interface{}, error)

func (Ingress) Load

func (i Ingress) Load(from, into interface{}) error

type IngressAPI

type IngressAPI struct {
	base.KubeAPI
}

func (*IngressAPI) Create

func (i *IngressAPI) Create(namespace string, obj interface{}) error

func (*IngressAPI) Delete

func (i *IngressAPI) Delete(name, namespace string) error

func (*IngressAPI) Get

func (i *IngressAPI) Get(name, namespace string) (interface{}, error)

func (*IngressAPI) List

func (i *IngressAPI) List(namespace string) ([]interface{}, error)

func (*IngressAPI) Update

func (i *IngressAPI) Update(namespace string, obj interface{}) error

type IngressPathDef

type IngressPathDef struct {
	Path    string       `sm:"path"`
	Type    net.PathType `sm:"pathType"`
	Service string       `sm:"backend.service.name"`
	Port    int          `sm:"backend.service.port.number"`
}

type Job

type Job struct {
	Name           string            `sm:"metadata.name"`
	ServiceAccount string            `sm:"spec.template.spec.serviceAccountName"`
	Behaviour      JobBehaviour      `sm:"->"`
	Containers     []Container       `sm:"spec.template.spec.containers"`
	Labels         map[string]string `sm:"metadata.labels"`
	NodeSelector   map[string]string `sm:"spec.template.spec.nodeSelector"`
	TemplateLabels map[string]string `sm:"spec.template.metadata.labels"`
}

func (Job) API

func (j Job) API() NamespacedResourceAPI

func (Job) Dump

func (j Job) Dump(from interface{}) (interface{}, error)

func (Job) Load

func (j Job) Load(from, into interface{}) error

type JobAPI

type JobAPI struct {
	base.KubeAPI
}

func (*JobAPI) Create

func (j *JobAPI) Create(namespace string, obj interface{}) error

func (*JobAPI) Delete

func (j *JobAPI) Delete(name, namespace string) error

func (*JobAPI) Get

func (j *JobAPI) Get(name, namespace string) (interface{}, error)

func (*JobAPI) List

func (j *JobAPI) List(namespace string) ([]interface{}, error)

func (*JobAPI) Update

func (j *JobAPI) Update(namespace string, obj interface{}) error

type JobBehaviour

type JobBehaviour struct {
	RestartPolicy v1.RestartPolicy `sm:"spec.template.spec.restartPolicy"`
	FinishedTTL   int32            `sm:"spec.ttlSecondsAfterFinished"`
}

type NamespacedResourceAPI

type NamespacedResourceAPI interface {
	Config(ctx context.Context, k8s kubernetes.Interface)
	SetOpts(opts base.QueryOpts)

	Get(name, namespace string) (interface{}, error)
	Create(namespace string, obj interface{}) error
	Update(namespace string, obj interface{}) error
	List(namespace string) ([]interface{}, error)
	Delete(name, namespace string) error
}

type Service

type Service struct {
	Name     string            `sm:"metadata.name"`
	Port     int               `sm:"spec.ports[0].port"`
	Selector map[string]string `sm:"spec.selector"`
	Labels   map[string]string `sm:"metadata.labels"`
}

func (Service) API

func (Service) Dump

func (s Service) Dump(from interface{}) (interface{}, error)

func (Service) Load

func (s Service) Load(from, into interface{}) error

type ServiceAPI

type ServiceAPI struct {
	base.KubeAPI
}

func (*ServiceAPI) Create

func (s *ServiceAPI) Create(namespace string, obj interface{}) error

func (*ServiceAPI) Delete

func (s *ServiceAPI) Delete(name, namespace string) error

func (*ServiceAPI) Get

func (s *ServiceAPI) Get(name, namespace string) (interface{}, error)

func (*ServiceAPI) List

func (s *ServiceAPI) List(namespace string) ([]interface{}, error)

func (*ServiceAPI) Update

func (s *ServiceAPI) Update(namespace string, obj interface{}) error

Jump to

Keyboard shortcuts

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