Documentation ¶
Overview ¶
Small Kubernetes api wrapper
Index ¶
- type AuthProvider
- type AuthProviderConfig
- type Cluster
- type ClusterData
- type Context
- type ContextData
- type KubeConf
- type KubeDeploymentItem
- type KubeDeployments
- type KubeNode
- type KubeNodeMetadata
- type KubeNodeSpec
- type KubeNodeStatus
- type KubeNodeStatusConditions
- type KubePod
- type KubePodEvent
- type KubeReplicaSet
- type KubeResponse
- type KubernetesCoreV1Api
- func (api KubernetesCoreV1Api) CreateNamespacedBinding(namespace string, body io.Reader) (response *http.Response, err error)
- func (api KubernetesCoreV1Api) ListNamespacedDeployments(namespace, fieldSelector string) (deployments KubeDeployments, err error)
- func (api KubernetesCoreV1Api) ListNamespacedReplicaset(namespace string, replicaName string) (replicaSet KubeReplicaSet, err error)
- func (api KubernetesCoreV1Api) ListNodes() (nodes []KubeNode, err error)
- func (api *KubernetesCoreV1Api) LoadKubeConfig() (err error)
- func (api KubernetesCoreV1Api) ReplaceDeploymentScheduler(item KubeDeploymentItem, scheduler string) (modified KubeDeploymentItem, err error)
- func (api KubernetesCoreV1Api) Request(httpMethod, apiMethod, contentType string, values url.Values, body io.Reader) (response *http.Response, err error)
- func (api KubernetesCoreV1Api) Watch(httpMethod, apiMethod string, values url.Values, body io.Reader) (responseChannel chan []byte, err error)
- type User
- type UserData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthProvider ¶
type AuthProvider struct { Config AuthProviderConfig `yaml:"config"` Name string `yaml:"name"` }
type AuthProviderConfig ¶
type Cluster ¶
type Cluster struct { Data ClusterData `yaml:"cluster"` Name string `yaml:"name"` }
type ClusterData ¶
type Context ¶
type Context struct { Data ContextData `yaml:"context"` Name string `yaml:"name"` }
type ContextData ¶
type KubeDeploymentItem ¶
type KubeDeploymentItem struct { Metadata struct { Name string `json:"name"` Namespace string `json:"namespace"` SelfLink string `json:"selfLink"` UID string `json:"uid"` ResourceVersion string `json:"resourceVersion"` Generation int `json:"generation"` CreationTimestamp time.Time `json:"creationTimestamp"` Labels map[string]string `json:"labels"` Annotations map[string]string `json:"annotations"` } `json:"metadata"` Spec struct { Replicas int `json:"replicas"` Selector struct { MatchLabels map[string]string `json:"matchLabels"` } `json:"selector"` Template struct { Metadata struct { CreationTimestamp interface{} `json:"creationTimestamp"` Labels map[string]string `json:"labels"` } `json:"metadata"` Spec struct { Containers []struct { Name string `json:"name"` Image string `json:"image"` Resources struct { Limits struct { CPU string `json:"cpu,omitempty"` Memory string `json:"memory,omitempty"` } `json:"limits,omitempty"` Requests struct { Memory string `json:"memory"` } `json:"requests"` } `json:"resources"` TerminationMessagePath string `json:"terminationMessagePath"` TerminationMessagePolicy string `json:"terminationMessagePolicy"` ImagePullPolicy string `json:"imagePullPolicy"` } `json:"containers"` RestartPolicy string `json:"restartPolicy"` TerminationGracePeriodSeconds int `json:"terminationGracePeriodSeconds"` DNSPolicy string `json:"dnsPolicy"` SecurityContext struct { } `json:"securityContext"` SchedulerName string `json:"schedulerName,omitempty"` } `json:"spec"` } `json:"template"` Strategy struct { Type string `json:"type"` RollingUpdate struct { MaxUnavailable interface{} `json:"maxUnavailable"` MaxSurge interface{} `json:"maxSurge"` } `json:"rollingUpdate"` } `json:"strategy"` RevisionHistoryLimit int `json:"revisionHistoryLimit"` ProgressDeadlineSeconds int `json:"progressDeadlineSeconds"` } `json:"spec"` Status struct { ObservedGeneration int `json:"observedGeneration"` Replicas int `json:"replicas"` UpdatedReplicas int `json:"updatedReplicas"` UnavailableReplicas int `json:"unavailableReplicas"` Conditions []struct { Type string `json:"type"` Status string `json:"status"` LastUpdateTime time.Time `json:"lastUpdateTime"` LastTransitionTime time.Time `json:"lastTransitionTime"` Reason string `json:"reason"` Message string `json:"message"` } `json:"conditions"` } `json:"status"` }
type KubeDeployments ¶
type KubeDeployments struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` Metadata struct { } `json:"metadata"` Items []KubeDeploymentItem `json:"items"` }
type KubeNode ¶
type KubeNode struct { Metadata KubeNodeMetadata `json:"metadata"` Spec KubeNodeSpec `json:"spec"` Status KubeNodeStatus `json:"status"` }
type KubeNodeMetadata ¶
type KubeNodeSpec ¶
type KubeNodeStatus ¶
type KubeNodeStatus struct {
Conditions []KubeNodeStatusConditions `json:"conditions"`
}
type KubePod ¶
type KubePod struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` Metadata struct { Name string `json:"name"` GenerateName string `json:"generateName"` Namespace string `json:"namespace"` SelfLink string `json:"selfLink"` UID string `json:"uid"` ResourceVersion string `json:"resourceVersion"` CreationTimestamp time.Time `json:"creationTimestamp"` Labels map[string]string `json:"labels"` OwnerReferences []struct { APIVersion string `json:"apiVersion"` Kind string `json:"kind"` Name string `json:"name"` UID string `json:"uid"` Controller bool `json:"controller"` BlockOwnerDeletion bool `json:"blockOwnerDeletion"` } `json:"ownerReferences"` } `json:"metadata"` Spec struct { Volumes []struct { Name string `json:"name"` Secret struct { SecretName string `json:"secretName"` DefaultMode int `json:"defaultMode"` } `json:"secret"` } `json:"volumes"` Containers []struct { Name string `json:"name"` Image string `json:"image"` Ports []struct { Name string `json:"name"` ContainerPort int `json:"containerPort"` Protocol string `json:"protocol"` } `json:"ports"` Resources struct { } `json:"resources"` VolumeMounts []struct { Name string `json:"name"` ReadOnly bool `json:"readOnly"` MountPath string `json:"mountPath"` } `json:"volumeMounts"` TerminationMessagePath string `json:"terminationMessagePath"` TerminationMessagePolicy string `json:"terminationMessagePolicy"` ImagePullPolicy string `json:"imagePullPolicy"` } `json:"containers"` RestartPolicy string `json:"restartPolicy"` TerminationGracePeriodSeconds int `json:"terminationGracePeriodSeconds"` DNSPolicy string `json:"dnsPolicy"` ServiceAccountName string `json:"serviceAccountName"` ServiceAccount string `json:"serviceAccount"` NodeName string `json:"nodeName"` SecurityContext struct { } `json:"securityContext"` SchedulerName string `json:"schedulerName"` Tolerations []struct { Key string `json:"key"` Operator string `json:"operator"` Effect string `json:"effect"` TolerationSeconds int `json:"tolerationSeconds"` } `json:"tolerations"` } `json:"spec"` Status struct { Phase string `json:"phase"` Conditions []struct { Type string `json:"type"` Status string `json:"status"` LastProbeTime interface{} `json:"lastProbeTime"` LastTransitionTime time.Time `json:"lastTransitionTime"` } `json:"conditions"` HostIP string `json:"hostIP"` PodIP string `json:"podIP"` StartTime time.Time `json:"startTime"` ContainerStatuses []struct { Name string `json:"name"` State struct { Running struct { StartedAt time.Time `json:"startedAt"` } `json:"running"` } `json:"state"` LastState struct { } `json:"lastState"` Ready bool `json:"ready"` RestartCount int `json:"restartCount"` Image string `json:"image"` ImageID string `json:"imageID"` ContainerID string `json:"containerID"` } `json:"containerStatuses"` QosClass string `json:"qosClass"` } `json:"status"` }
type KubePodEvent ¶
type KubeReplicaSet ¶
type KubeReplicaSet struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` Metadata struct { Name string `json:"name"` Namespace string `json:"namespace"` SelfLink string `json:"selfLink"` UID string `json:"uid"` ResourceVersion string `json:"resourceVersion"` Generation int `json:"generation"` CreationTimestamp time.Time `json:"creationTimestamp"` Labels map[string]string `json:"labels"` Annotations map[string]string `json:"annotations"` OwnerReferences []struct { APIVersion string `json:"apiVersion"` Kind string `json:"kind"` Name string `json:"name"` UID string `json:"uid"` Controller bool `json:"controller"` BlockOwnerDeletion bool `json:"blockOwnerDeletion"` } `json:"ownerReferences"` } `json:"metadata"` Spec struct { Replicas int `json:"replicas"` Selector struct { MatchLabels map[string]string `json:"matchLabels"` } `json:"selector"` Template struct { Metadata struct { Name string `json:"name"` CreationTimestamp interface{} `json:"creationTimestamp"` Labels map[string]string `json:"labels"` } `json:"metadata"` Spec struct { Containers []struct { Name string `json:"name"` Image string `json:"image"` Ports []struct { Name string `json:"name"` ContainerPort int `json:"containerPort"` Protocol string `json:"protocol"` } `json:"ports"` Resources struct { } `json:"resources"` TerminationMessagePath string `json:"terminationMessagePath"` TerminationMessagePolicy string `json:"terminationMessagePolicy"` ImagePullPolicy string `json:"imagePullPolicy"` } `json:"containers"` RestartPolicy string `json:"restartPolicy"` TerminationGracePeriodSeconds int `json:"terminationGracePeriodSeconds"` DNSPolicy string `json:"dnsPolicy"` SecurityContext struct { } `json:"securityContext"` SchedulerName string `json:"schedulerName"` } `json:"spec"` } `json:"template"` } `json:"spec"` Status struct { Replicas int `json:"replicas"` FullyLabeledReplicas int `json:"fullyLabeledReplicas"` ObservedGeneration int `json:"observedGeneration"` } `json:"status"` }
type KubeResponse ¶
type KubeResponse struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` Metadata struct { } `json:"metadata"` Status string `json:"status"` Message string `json:"message"` Reason string `json:"reason"` Details struct { Name string `json:"name"` Kind string `json:"kind"` } `json:"details"` Code int `json:"code"` }
type KubernetesCoreV1Api ¶
type KubernetesCoreV1Api struct {
// contains filtered or unexported fields
}
func (KubernetesCoreV1Api) CreateNamespacedBinding ¶
func (KubernetesCoreV1Api) ListNamespacedDeployments ¶
func (api KubernetesCoreV1Api) ListNamespacedDeployments(namespace, fieldSelector string) (deployments KubeDeployments, err error)
func (KubernetesCoreV1Api) ListNamespacedReplicaset ¶
func (api KubernetesCoreV1Api) ListNamespacedReplicaset(namespace string, replicaName string) (replicaSet KubeReplicaSet, err error)
func (KubernetesCoreV1Api) ListNodes ¶
func (api KubernetesCoreV1Api) ListNodes() (nodes []KubeNode, err error)
func (*KubernetesCoreV1Api) LoadKubeConfig ¶
func (api *KubernetesCoreV1Api) LoadKubeConfig() (err error)
Reads the configuration file and loads the config struct
func (KubernetesCoreV1Api) ReplaceDeploymentScheduler ¶
func (api KubernetesCoreV1Api) ReplaceDeploymentScheduler(item KubeDeploymentItem, scheduler string) (modified KubeDeploymentItem, err error)
type User ¶
type User struct { Name string `yaml:"name"` Data UserData `yaml:"user"` AuthProvider AuthProvider `yaml:"auth-provider"` }
Click to show internal directories.
Click to hide internal directories.