Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayContains(s []string, e string) bool
- func Base64EncodeCSR(c []byte) []byte
- func Config(kubeConfigFlag string) (*rest.Config, *clientcmdapi.Config, error)
- func DynClient(config *rest.Config) (dynamic.Interface, error)
- func FilePath() (string, string)
- func KubeClient(config *rest.Config) (kubernetes.Interface, error)
- func Username(u string) string
- type Cluster
- type Clusters
- type Context
- type Contexts
- type KubeConfig
- type User
- type Users
Constants ¶
View Source
const ( Name = "akcess" ResourceAnnotationKey = "allow.akcess.id" )
Variables ¶
View Source
var ( // Valid resource verb list for validation. ValidResourceVerbs = []string{"*", "get", "delete", "list", "create", "update", "patch", "watch", "proxy", "deletecollection", "use", "bind", "escalate", "impersonate"} SpecialVerbs = map[string][]schema.GroupResource{ "use": { { Group: "policy", Resource: "podsecuritypolicies", }, { Group: "extensions", Resource: "podsecuritypolicies", }, }, "bind": { { Group: "rbac.authorization.k8s.io", Resource: "roles", }, { Group: "rbac.authorization.k8s.io", Resource: "clusterroles", }, }, "escalate": { { Group: "rbac.authorization.k8s.io", Resource: "roles", }, { Group: "rbac.authorization.k8s.io", Resource: "clusterroles", }, }, "impersonate": { { Group: "", Resource: "users", }, { Group: "", Resource: "serviceaccounts", }, { Group: "", Resource: "groups", }, { Group: "authentication.k8s.io", Resource: "userextras", }, }, } )
Functions ¶
func ArrayContains ¶
func Base64EncodeCSR ¶
func Config ¶
Config gets us rest.Config considering the kubeconfig flag provided as kubeConfigFlag if not, falls back 1. KUBECONFIG env var 2. default kubeconfig file location
func KubeClient ¶
func KubeClient(config *rest.Config) (kubernetes.Interface, error)
Types ¶
type Cluster ¶
type Cluster struct { CertificateAuthorityData string `yaml:"certificate-authority-data"` Server string `yaml:"server"` }
Cluster holds the cluster data
type KubeConfig ¶
type KubeConfig struct { APIVersion string `yaml:"apiVersion"` Clusters Clusters `yaml:"clusters"` Contexts Contexts `yaml:"contexts"` CurrentContext string `yaml:"current-context"` Kind string `yaml:"kind"` Preferences struct{} `yaml:"preferences"` Users Users `yaml:"users"` }
KubeConfig holds the necessary data for creating a new KubeConfig file
Click to show internal directories.
Click to hide internal directories.