kubernetes

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelManageKey   = "kubepi.org/manage"
	LabelRoleTypeKey = "kubepi.org/role-type"
	LabelClusterId   = "kubepi.org/cluster-id"
	LabelUsername    = "kubepi.org/username"

	RoleTypeCluster   = "cluster"
	RoleTypeNamespace = "namespace"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Ping() error
	Version() (*version.Info, error)
	VersionMinor() (int, error)
	Config() (*rest.Config, error)
	Client() (*kubernetes.Clientset, error)
	HasPermission(attributes v1.ResourceAttributes) (PermissionCheckResult, error)
	CreateCommonUser(commonName string) ([]byte, error)
	CreateDefaultClusterRoles() error
	GetUserNamespaceNames(username string, options ...interface{}) ([]string, error)
	CanVisitAllNamespace(username string) (bool, error)
	IsNamespacedResource(resourceName string) (bool, error)
	CleanManagedClusterRole() error
	CleanManagedClusterRoleBinding(username string) error
	CleanManagedRoleBinding(username string) error
	CleanAllRBACResource() error
	CreateOrUpdateClusterRoleBinding(clusterRoleName string, username string, builtIn bool) error
	CreateOrUpdateRolebinding(namespace string, clusterRoleName string, username string, builtIn bool) error
	CreateAppMarketCRD() error
}

func NewKubernetes

func NewKubernetes(cluster *v1Cluster.Cluster) Interface

type Kubernetes

type Kubernetes struct {
	*v1Cluster.Cluster
}

func (*Kubernetes) CanVisitAllNamespace

func (k *Kubernetes) CanVisitAllNamespace(username string) (bool, error)

func (*Kubernetes) CleanAllRBACResource

func (k *Kubernetes) CleanAllRBACResource() error

func (*Kubernetes) CleanManagedClusterRole

func (k *Kubernetes) CleanManagedClusterRole() error

func (*Kubernetes) CleanManagedClusterRoleBinding

func (k *Kubernetes) CleanManagedClusterRoleBinding(username string) error

func (*Kubernetes) CleanManagedRoleBinding

func (k *Kubernetes) CleanManagedRoleBinding(username string) error

func (*Kubernetes) Client

func (k *Kubernetes) Client() (*kubernetes.Clientset, error)

func (*Kubernetes) Config

func (k *Kubernetes) Config() (*rest.Config, error)

func (*Kubernetes) CreateAppMarketCRD added in v1.1.0

func (k *Kubernetes) CreateAppMarketCRD() error

func (*Kubernetes) CreateCommonUser

func (k *Kubernetes) CreateCommonUser(commonName string) ([]byte, error)

func (*Kubernetes) CreateDefaultClusterRoles

func (k *Kubernetes) CreateDefaultClusterRoles() error

func (*Kubernetes) CreateOrUpdateClusterRoleBinding

func (k *Kubernetes) CreateOrUpdateClusterRoleBinding(clusterRoleName string, username string, builtIn bool) error

func (*Kubernetes) CreateOrUpdateRolebinding

func (k *Kubernetes) CreateOrUpdateRolebinding(namespace string, clusterRoleName string, username string, builtIn bool) error

func (*Kubernetes) GetUserNamespaceNames

func (k *Kubernetes) GetUserNamespaceNames(username string, options ...interface{}) ([]string, error)

func (*Kubernetes) HasPermission

func (k *Kubernetes) HasPermission(attributes v1.ResourceAttributes) (PermissionCheckResult, error)

func (*Kubernetes) IsNamespacedResource

func (k *Kubernetes) IsNamespacedResource(resourceName string) (bool, error)

func (*Kubernetes) Ping

func (k *Kubernetes) Ping() error

func (*Kubernetes) Version

func (k *Kubernetes) Version() (*version.Info, error)

func (*Kubernetes) VersionMinor

func (k *Kubernetes) VersionMinor() (int, error)

type PermissionCheckResult

type PermissionCheckResult struct {
	Resource v1.ResourceAttributes
	Allowed  bool
}

Jump to

Keyboard shortcuts

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