kubernetes

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 18 Imported by: 2

Documentation

Overview

Package kubernetes is the API implementation on kubernetes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsClusterKind

func IsClusterKind(kind string) bool

func IsNamespaceKind

func IsNamespaceKind(kind string) bool

func StructedClusterRole

func StructedClusterRole(data []byte) (*rbacV1.ClusterRole, error)

func StructedClusterRoleBinding

func StructedClusterRoleBinding(data []byte) (*rbacV1.ClusterRoleBinding, error)

func StructedNode

func StructedNode(data []byte) (*coreV1.Node, error)

func StructedPod

func StructedPod(data []byte) (*coreV1.Pod, error)

func StructedRole

func StructedRole(data []byte) (*rbacV1.Role, error)

func StructedRoleBinding

func StructedRoleBinding(data []byte) (*rbacV1.RoleBinding, error)

func StructedSecret added in v1.3.8

func StructedSecret(data []byte) (*coreV1.Secret, error)

func StructedService

func StructedService(data []byte) (*coreV1.Service, error)

Types

type ClusterKind

type ClusterKind string
const (
	ComponentStatus     ClusterKind = "componentstatuses"
	Nodes               ClusterKind = "nodes"
	Namespaces          ClusterKind = "namespaces"
	PersistentVolumes   ClusterKind = "persistentvolumes"
	ClusterRoles        ClusterKind = "clusterroles"
	ClusterRoleBindings ClusterKind = "clusterrolebindings"
	PodSecurityPolicies ClusterKind = "podsecuritypolicies"
)

func GetClusterKinds

func GetClusterKinds() []ClusterKind

func (ClusterKind) String

func (k ClusterKind) String() string

type Kubernetes

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

func New

func New(options ...NewOption) (*Kubernetes, error)

func (*Kubernetes) Close

func (k *Kubernetes) Close() error

func (*Kubernetes) ConfigBytes added in v1.3.3

func (k *Kubernetes) ConfigBytes() []byte

func (*Kubernetes) ConfigPath

func (k *Kubernetes) ConfigPath() string

func (*Kubernetes) InCluster

func (k *Kubernetes) InCluster() bool

func (*Kubernetes) ListNamespaces

func (k *Kubernetes) ListNamespaces() ([]string, error)

func (*Kubernetes) Resource

func (k *Kubernetes) Resource(namespace string, kind string) (api.ClusterResource, error)

func (*Kubernetes) Version added in v1.3.7

func (k *Kubernetes) Version() string

type NamespaceKind

type NamespaceKind string
const (
	Deployments            NamespaceKind = "deployments"
	ReplicaSets            NamespaceKind = "replicasets"
	ReplicationControllers NamespaceKind = "replicationcontrollers"
	StatefulSets           NamespaceKind = "statefulsets"
	DaemonSets             NamespaceKind = "daemonsets"
	CronJobs               NamespaceKind = "cronjobs"
	Services               NamespaceKind = "services"
	Jobs                   NamespaceKind = "jobs"
	Pods                   NamespaceKind = "pods"
	ConfigMaps             NamespaceKind = "configmaps"
	Roles                  NamespaceKind = "roles"
	RoleBindings           NamespaceKind = "rolebindings"
	NetworkPolicys         NamespaceKind = "networkpolicies"
	Ingresss               NamespaceKind = "ingresses"
	ResourceQuotas         NamespaceKind = "resourcequotas"
	LimitRanges            NamespaceKind = "limitranges"
	Secrets                NamespaceKind = "secrets"
)

func GetNamespaceKinds

func GetNamespaceKinds() []NamespaceKind

func (NamespaceKind) String

func (k NamespaceKind) String() string

type NewOption

type NewOption func(kubernetes *Kubernetes) error

func WithInCluster

func WithInCluster() NewOption

func WithKubeConfigBytes added in v1.3.3

func WithKubeConfigBytes(config []byte) NewOption

func WithKubeConfigPath added in v1.3.3

func WithKubeConfigPath(path string) NewOption

type Resource

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

func (Resource) Close

func (r Resource) Close() error

func (Resource) Create

func (r Resource) Create(ctx context.Context, resource []byte) error

func (Resource) Get

func (r Resource) Get(ctx context.Context, name string) ([]byte, error)

func (Resource) Kind

func (r Resource) Kind() string

func (Resource) List

func (r Resource) List(ctx context.Context) ([]string, error)

func (Resource) Update

func (r Resource) Update(ctx context.Context, resource []byte) error

func (Resource) Watch added in v1.3.3

func (r Resource) Watch(ctx context.Context) (watch.Interface, error)

Jump to

Keyboard shortcuts

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