kubernetes

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 16 Imported by: 2

Documentation

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 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) ConfigPath

func (k *Kubernetes) ConfigPath() string

func (*Kubernetes) CurrentNamespace

func (k *Kubernetes) CurrentNamespace() string

func (*Kubernetes) InCluster

func (k *Kubernetes) InCluster() bool

func (*Kubernetes) ListNamespaces

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

func (*Kubernetes) Namespace

func (k *Kubernetes) Namespace(namespace string) api.Cluster

func (*Kubernetes) Resource

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

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"
)

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 WithKubeConfig

func WithKubeConfig(path string) NewOption

func WithNamespace

func WithNamespace(namespace 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

Jump to

Keyboard shortcuts

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