kubernetes

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(filepath string) (string, error)

func ApplyString

func ApplyString(content string) (string, error)

func CanIGetPods

func CanIGetPods(namespace string) bool

func CreateServiceAccount

func CreateServiceAccount(namespace string, accountName string) error

func Delete

func Delete(filepath string) (string, error)

func DeleteDeployment

func DeleteDeployment(deploymentName string, namespace string) error

func DeleteString

func DeleteString(content string) (string, error)

func GetCurrentMasterPlaneFqdn

func GetCurrentMasterPlaneFqdn() (string, error)

func PrintAllCopsNamespaces

func PrintAllCopsNamespaces() error

func RemoveServiceAccount

func RemoveServiceAccount(namespace string, accountName string) error

func UseContext

func UseContext(contextName string) error

Types

type Cluster

type Cluster struct {
	Name    string `json:"name"`
	Cluster struct {
		Server string `json:"server"`
	} `json:"cluster"`
}

type ConfigResponse

type ConfigResponse struct {
	Kind        string `json:"kind"`
	APIVersion  string `json:"apiVersion"`
	Preferences struct {
	} `json:"preferences"`
	Clusters       []Cluster `json:"clusters"`
	Contexts       []Context `json:"contexts"`
	CurrentContext string    `json:"current-context"`
}

func GetCurrentConfig

func GetCurrentConfig() (*ConfigResponse, error)

type Context

type Context struct {
	Name    string `json:"name"`
	Context struct {
		Cluster string `json:"cluster"`
		User    string `json:"user"`
	} `json:"context"`
}

type CopsNamespaceResponse

type CopsNamespaceResponse struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name string `yaml:"name"`
	} `yaml:"metadata"`
	Spec struct {
		NamespaceAdminUsers           []string             `yaml:"namespaceAdminUsers"`
		NamespaceAdminServiceAccounts []CopsServiceAccount `yaml:"namespaceAdminServiceAccounts"`
	} `yaml:"spec"`
}

func GetCopsNamespace

func GetCopsNamespace(namespace string) (*CopsNamespaceResponse, error)

type CopsServiceAccount

type CopsServiceAccount struct {
	ServiceAccount string `yaml:"serviceAccount"`
	Namespace      string `yaml:"namespace"`
}

type ServiceAccount

type ServiceAccount struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		CreationTimestamp struct {
		} `yaml:"creationTimestamp"`
		Name            string `yaml:"name"`
		Namespace       string `yaml:"namespace"`
		ResourceVersion string `yaml:"resourceVersion"`
		SelfLink        string `yaml:"selfLink"`
		UID             string `yaml:"uid"`
	} `yaml:"metadata"`
	Secrets []struct {
		Name string `yaml:"name"`
	} `yaml:"secrets"`
}

func GetServiceAccount

func GetServiceAccount(namespace string, name string) ServiceAccount

type ServiceAccountSecret

type ServiceAccountSecret struct {
	APIVersion string `yaml:"apiVersion"`
	Data       struct {
		CaCrt     string `yaml:"ca.crt"`
		Namespace string `yaml:"namespace"`
		Token     string `yaml:"token"`
	} `yaml:"data"`
	Kind     string `yaml:"kind"`
	Metadata struct {
		Annotations struct {
			KubernetesIoServiceAccountName string `yaml:"kubernetes.io/service-account.name"`
			KubernetesIoServiceAccountUID  string `yaml:"kubernetes.io/service-account.uid"`
		} `yaml:"annotations"`
		CreationTimestamp struct {
		} `yaml:"creationTimestamp"`
		Name            string `yaml:"name"`
		Namespace       string `yaml:"namespace"`
		ResourceVersion string `yaml:"resourceVersion"`
		SelfLink        string `yaml:"selfLink"`
		UID             string `yaml:"uid"`
	} `yaml:"metadata"`
	Type string `yaml:"type"`
}

func GetServiceAccountSecret

func GetServiceAccountSecret(namespace string, name string) ServiceAccountSecret

Jump to

Keyboard shortcuts

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