kubernetes

package
v0.0.0-...-dfb2727 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNamespace

func CreateNamespace(client client.Client, name string) error

CreateNamespace creates a namespace.

func DeleteNamespace

func DeleteNamespace(client client.Client, name string) error

DeleteNamespace deletes a namespace.

Types

type ClusterRole

type ClusterRole struct {
	rbacv1.ClusterRole
	// contains filtered or unexported fields
}

ClusterRole wraps a Kubernetes ClusterRole.

func GetClusterRole

func GetClusterRole(client client.Client, name string) (ClusterRole, error)

GetClusterRole gets a clusterrole.

func ListClusterRoles

func ListClusterRoles(client client.Client) ([]ClusterRole, error)

ListClusterRoles lists all clusterroles.

func NewClusterRole

func NewClusterRole(client client.Client, clusterrole rbacv1.ClusterRole) (ClusterRole, error)

NewClusterRole creates a ClusterRole from its Kubernetes ClusterRole.

func (ClusterRole) Delete

func (clusterrole ClusterRole) Delete() error

Delete deletes a ClusterRole from the Kubernetes cluster.

func (*ClusterRole) Save

func (clusterrole *ClusterRole) Save() error

Save saves the current ClusterRole.

func (*ClusterRole) Update

func (clusterrole *ClusterRole) Update() error

Update gets the current ClusterRole status.

type ClusterRoleBinding

type ClusterRoleBinding struct {
	rbacv1.ClusterRoleBinding
	// contains filtered or unexported fields
}

ClusterRoleBinding wraps a Kubernetes ClusterRoleBinding.

func GetClusterRoleBinding

func GetClusterRoleBinding(client client.Client, name string) (ClusterRoleBinding, error)

GetClusterRoleBinding gets a clusterrolebinding.

func ListClusterRoleBindings

func ListClusterRoleBindings(client client.Client) ([]ClusterRoleBinding, error)

ListClusterRoleBindings lists all clusterrolebindings.

func NewClusterRoleBinding

func NewClusterRoleBinding(client client.Client, clusterrolebinding rbacv1.ClusterRoleBinding) (ClusterRoleBinding, error)

NewClusterRoleBinding creates a ClusterRoleBinding from its Kubernetes ClusterRoleBinding.

func (ClusterRoleBinding) Delete

func (clusterrolebinding ClusterRoleBinding) Delete() error

Delete deletes a ClusterRoleBinding from the Kubernetes cluster.

func (*ClusterRoleBinding) Save

func (clusterrolebinding *ClusterRoleBinding) Save() error

Save saves the current ClusterRoleBinding.

func (*ClusterRoleBinding) Update

func (clusterrolebinding *ClusterRoleBinding) Update() error

Update gets the current ClusterRoleBinding status.

type Node

type Node struct {
	corev1.Node
	// contains filtered or unexported fields
}

Node wraps a Kubernetes Node.

func GetNode

func GetNode(client client.Client, name string) (Node, error)

GetNode gets a node.

func ListNodes

func ListNodes(client client.Client) ([]Node, error)

ListNodes lists all nodes.

func NewNode

func NewNode(client client.Client, node corev1.Node) (Node, error)

NewNode creates a Node from its Kubernetes Node.

func (Node) Delete

func (node Node) Delete() error

Delete deletes a Node from the Kubernetes cluster.

func (*Node) Save

func (node *Node) Save() error

Save saves the current Node.

func (*Node) Update

func (node *Node) Update() error

Update gets the current Node status.

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	corev1.PersistentVolumeClaim
	// contains filtered or unexported fields
}

PersistentVolumeClaim wraps a Kubernetes PersistentVolumeClaim.

func GetPersistentVolumeClaim

func GetPersistentVolumeClaim(client client.Client, name string, namespace string) (PersistentVolumeClaim, error)

GetPersistentVolumeClaim gets a persistentvolumeclaim in a namespace.

func ListPersistentVolumeClaims

func ListPersistentVolumeClaims(client client.Client, namespace string) ([]PersistentVolumeClaim, error)

ListPersistentVolumeClaims lists all persistentvolumeclaims in a namespace.

func NewPersistentVolumeClaim

func NewPersistentVolumeClaim(client client.Client, persistentvolumeclaim corev1.PersistentVolumeClaim) (PersistentVolumeClaim, error)

NewPersistentVolumeClaim creates a PersistentVolumeClaim from its Kubernetes PersistentVolumeClaim.

func (PersistentVolumeClaim) Delete

func (persistentvolumeclaim PersistentVolumeClaim) Delete() error

Delete deletes a PersistentVolumeClaim from the Kubernetes cluster.

func (*PersistentVolumeClaim) Save

func (persistentvolumeclaim *PersistentVolumeClaim) Save() error

Save saves the current PersistentVolumeClaim.

func (*PersistentVolumeClaim) Update

func (persistentvolumeclaim *PersistentVolumeClaim) Update() error

Update gets the current PersistentVolumeClaim status.

type Pod

type Pod struct {
	corev1.Pod
	// contains filtered or unexported fields
}

Pod wraps a Kubernetes Pod.

func GetPod

func GetPod(client client.Client, name string, namespace string) (Pod, error)

GetPod gets a pod in a namespace.

func ListPods

func ListPods(client client.Client, namespace string) ([]Pod, error)

ListPods lists all pods in a namespace.

func NewPod

func NewPod(client client.Client, pod corev1.Pod) (Pod, error)

NewPod creates a Pod from its Kubernetes Pod.

func (Pod) ContainerExec

func (pod Pod) ContainerExec(container string, command cmd.Builder) error

ContainerExec runs a command in a pod's container.

func (Pod) ContainerLogs

func (pod Pod) ContainerLogs(container string) ([]byte, error)

ContainerLogs returns the (current) logs of a pod's container.

func (Pod) Delete

func (pod Pod) Delete() error

Delete deletes a Pod from the Kubernetes cluster.

func (*Pod) Save

func (pod *Pod) Save() error

Save saves the current Pod.

func (*Pod) Update

func (pod *Pod) Update() error

Update gets the current Pod status.

type Role

type Role struct {
	rbacv1.Role
	// contains filtered or unexported fields
}

Role wraps a Kubernetes Role.

func GetRole

func GetRole(client client.Client, name string, namespace string) (Role, error)

GetRole gets a role in a namespace.

func ListRoles

func ListRoles(client client.Client, namespace string) ([]Role, error)

ListRoles lists all roles in a namespace.

func NewRole

func NewRole(client client.Client, role rbacv1.Role) (Role, error)

NewRole creates a Role from its Kubernetes Role.

func (Role) Delete

func (role Role) Delete() error

Delete deletes a Role from the Kubernetes cluster.

func (*Role) Save

func (role *Role) Save() error

Save saves the current Role.

func (*Role) Update

func (role *Role) Update() error

Update gets the current Role status.

type RoleBinding

type RoleBinding struct {
	rbacv1.RoleBinding
	// contains filtered or unexported fields
}

RoleBinding wraps a Kubernetes RoleBinding.

func GetRoleBinding

func GetRoleBinding(client client.Client, name string, namespace string) (RoleBinding, error)

GetRoleBinding gets a rolebinding in a namespace.

func ListRoleBindings

func ListRoleBindings(client client.Client, namespace string) ([]RoleBinding, error)

ListRoleBindings lists all rolebindings in a namespace.

func NewRoleBinding

func NewRoleBinding(client client.Client, rolebinding rbacv1.RoleBinding) (RoleBinding, error)

NewRoleBinding creates a RoleBinding from its Kubernetes RoleBinding.

func (RoleBinding) Delete

func (rolebinding RoleBinding) Delete() error

Delete deletes a RoleBinding from the Kubernetes cluster.

func (*RoleBinding) Save

func (rolebinding *RoleBinding) Save() error

Save saves the current RoleBinding.

func (*RoleBinding) Update

func (rolebinding *RoleBinding) Update() error

Update gets the current RoleBinding status.

type Secret

type Secret struct {
	corev1.Secret
	// contains filtered or unexported fields
}

Secret wraps a Kubernetes Secret.

func GetSecret

func GetSecret(client client.Client, name string, namespace string) (Secret, error)

GetSecret gets a secret in a namespace.

func ListSecrets

func ListSecrets(client client.Client, namespace string) ([]Secret, error)

ListSecrets lists all secrets in a namespace.

func NewSecret

func NewSecret(client client.Client, secret corev1.Secret) (Secret, error)

NewSecret creates a Secret from its Kubernetes Secret.

func (Secret) Delete

func (secret Secret) Delete() error

Delete deletes a Secret from the Kubernetes cluster.

func (*Secret) Save

func (secret *Secret) Save() error

Save saves the current Secret.

func (*Secret) Update

func (secret *Secret) Update() error

Update gets the current Secret status.

type SecretBuilder

type SecretBuilder struct {
	Name       string
	Namespace  string
	Data       map[string][]byte
	StringData map[string]string
}

SecretBuilder tracks the options set for a secret.

func CreateSecret

func CreateSecret(name string) SecretBuilder

CreateSecret creates a secret. Additional parameters can be added to this call. The creation is started by calling 'Do'.

func (SecretBuilder) Do

func (builder SecretBuilder) Do(client client.Client) (Secret, error)

Do creates the secret in the cluster.

func (SecretBuilder) WithData

func (builder SecretBuilder) WithData(data map[string][]byte) SecretBuilder

WithData sets the data the secret should hold.

func (SecretBuilder) WithNamespace

func (builder SecretBuilder) WithNamespace(namespace string) SecretBuilder

WithNamespace sets the namespace in which the secret will be created.

func (SecretBuilder) WithStringData

func (builder SecretBuilder) WithStringData(data map[string]string) SecretBuilder

WithStringData sets the data the secret should hold as string

type Service

type Service struct {
	corev1.Service
	// contains filtered or unexported fields
}

Service wraps a Kubernetes Service.

func GetService

func GetService(client client.Client, name string, namespace string) (Service, error)

GetService gets a service in a namespace.

func ListServices

func ListServices(client client.Client, namespace string) ([]Service, error)

ListServices lists all services in a namespace.

func NewService

func NewService(client client.Client, service corev1.Service) (Service, error)

NewService creates a Service from its Kubernetes Service.

func (Service) Delete

func (service Service) Delete() error

Delete deletes a Service from the Kubernetes cluster.

func (*Service) Save

func (service *Service) Save() error

Save saves the current Service.

func (*Service) Update

func (service *Service) Update() error

Update gets the current Service status.

type ServiceAccount

type ServiceAccount struct {
	corev1.ServiceAccount
	// contains filtered or unexported fields
}

ServiceAccount wraps a Kubernetes ServiceAccount.

func GetServiceAccount

func GetServiceAccount(client client.Client, name string, namespace string) (ServiceAccount, error)

GetServiceAccount gets a serviceaccount in a namespace.

func ListServiceAccounts

func ListServiceAccounts(client client.Client, namespace string) ([]ServiceAccount, error)

ListServiceAccounts lists all serviceaccounts in a namespace.

func NewServiceAccount

func NewServiceAccount(client client.Client, serviceaccount corev1.ServiceAccount) (ServiceAccount, error)

NewServiceAccount creates a ServiceAccount from its Kubernetes ServiceAccount.

func (ServiceAccount) Delete

func (serviceaccount ServiceAccount) Delete() error

Delete deletes a ServiceAccount from the Kubernetes cluster.

func (*ServiceAccount) Save

func (serviceaccount *ServiceAccount) Save() error

Save saves the current ServiceAccount.

func (*ServiceAccount) Update

func (serviceaccount *ServiceAccount) Update() error

Update gets the current ServiceAccount status.

type StatefulSet

type StatefulSet struct {
	appsv1.StatefulSet
	// contains filtered or unexported fields
}

StatefulSet wraps a Kubernetes StatefulSet.

func GetStatefulSet

func GetStatefulSet(client client.Client, name string, namespace string) (StatefulSet, error)

GetStatefulSet gets a statefulset in a namespace.

func ListStatefulSets

func ListStatefulSets(client client.Client, namespace string) ([]StatefulSet, error)

ListStatefulSets lists all statefulsets in a namespace.

func NewStatefulSet

func NewStatefulSet(client client.Client, statefulset appsv1.StatefulSet) (StatefulSet, error)

NewStatefulSet creates a StatefulSet from its Kubernetes StatefulSet.

func (StatefulSet) Delete

func (statefulset StatefulSet) Delete() error

Delete deletes a StatefulSet from the Kubernetes cluster.

func (*StatefulSet) Save

func (statefulset *StatefulSet) Save() error

Save saves the current StatefulSet.

func (*StatefulSet) Update

func (statefulset *StatefulSet) Update() error

Update gets the current StatefulSet status.

Jump to

Keyboard shortcuts

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