k8s

package
v0.5.0-dev15 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MonoskopeDomain        = "monoskope.io"
	ClusterRoleBindingKind = "ClusterRoleBinding"
	ClusterRoleKind        = "ClusterRole"
)

Variables

View Source
var AvailableRoles = []K8sRole{
	DefaultRole,
	AdminRole,
	OnCallRole,
}

A list of all existing cluster roles.

Functions

func GetK8sName added in v0.4.13

func GetK8sName(any string) (string, error)

GetK8sName returns a sanitized version of the input string which is allowed to be used as a kubernetes namespace or username.

func NewClusterRoleBinding added in v0.4.13

func NewClusterRoleBinding(clusterRoleName, userName, userNamePrefix string, labels map[string]string) *rbac.ClusterRoleBinding

NewClusterRoleBinding creates a new K8s API ClusterRoleBinding resource

func ValidateRole

func ValidateRole(role string) error

Types

type K8sRole

type K8sRole string

K8sRole is the name of a user's K8s role.

const (
	// User role
	DefaultRole K8sRole = "default"
	// Admin role
	AdminRole K8sRole = "admin"
	// OnCaller role
	OnCallRole K8sRole = "oncall"
)

K8s Roles

Jump to

Keyboard shortcuts

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