api

package
v0.0.0-...-1a511a4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultServiceCIDR   string = "10.43.0.0/16"
	DefaultServiceDomain string = "cluster.local"
	DefaultPodCIDR       string = "10.42.0.0/16"
)
View Source
const (
	ClusterResourceTypeHost    = "host"
	ClusterResourceTypeGuest   = "guest"
	ClusterResourceTypeUnknown = "unknown"
)
View Source
const (
	MachineResourceTypeBaremetal = "baremetal"
	MachineResourceTypeVm        = "vm"
)
View Source
const (
	RoleTypeControlplane = "controlplane"
	RoleTypeNode         = "node"
)
View Source
const (
	MachineStatusInit          = "init"
	MachineStatusCreating      = "creating"
	MachineStatusCreateFail    = "create_fail"
	MachineStatusPrepare       = "prepare"
	MachineStatusPrepareFail   = "prepare_fail"
	MachineStatusRunning       = "running"
	MachineStatusReady         = "ready"
	MachineStatusDeleting      = "deleting"
	MachineStatusDeleteFail    = "delete_fail"
	MachineStatusTerminating   = "terminating"
	MachineStatusTerminateFail = "terminate_fail"

	ClusterStatusInit              = "init"
	ClusterStatusCreating          = "creating"
	ClusterStatusCreateFail        = "create_fail"
	ClusterStatusCreatingMachine   = "creating_machine"
	ClusterStatusCreateMachineFail = "create_machine_fail"
	ClusterStatusDeploying         = "deploying"
	ClusterStatusDeployingFail     = "deploy_fail"
	ClusterStatusRunning           = "running"
	ClusterStatusLost              = "lost"
	ClusterStatusUnknown           = "unknown"
	ClusterStatusError             = "error"
	ClusterStatusDeleting          = "deleting"
	ClusterStatusDeleteFail        = "delete_fail"
)
View Source
const (
	ImportClusterDistributionK8s       = "k8s"
	ImportClusterDistributionOpenshift = "openshift"
)
View Source
const (
	ContainerSchedtag = "container"
	DefaultCluster    = "default"
)
View Source
const (
	ClusterResourceStatusCreating   = "creating"
	ClusterResourceStatusCreateFail = "create_fail"
	ClusterResourceStatusUpdating   = "updating"
	ClusterResourceStatusUpdateFail = "update_fail"
	ClusterResourceStatusDeleting   = "deleting"
	ClusterResourceStatusDeleteFail = "delete_fail"
	ClusterResourceStatusSyncing    = "syncing"
	ClusterResourceStatusSyncFail   = "sync_fail"
	ClusterResourceStatusActive     = "active"
)
View Source
const (
	ClusterComponentCephCSI      = "cephCSI"
	ClusterComponentMonitor      = "monitor"
	ClusterComponentFluentBit    = "fluentbit"
	ClusterComponentMinio        = "minio"
	ClusterComponentMonitorMinio = "monitorMinio"
	ClusterComponentThanos       = "thanos"
)
View Source
const (
	ComponentStatusDeploying    = "deploying"
	ComponentStatusDeployFail   = "deploy_fail"
	ComponentStatusDeployed     = "deployed"
	ComponentStatusDeleting     = "deleting"
	ComponentStatusUndeploying  = "undeploying"
	ComponentStatusUndeployFail = "undeploy_fail"
	ComponentStatusDeleteFail   = "delete_fail"
	ComponentStatusUpdating     = "updating"
	ComponentStatusUpdateFail   = "update_fail"
	ComponentStatusInit         = "init"
)
View Source
const (
	ComponentSettingFluentBitBackendTypeES    = "es"
	ComponentSettingFluentBitBackendTypeKafka = "kafka"
)
View Source
const (
	ContainerRegistryTypeHarbor = "harbor"
	ContainerRegistryTypeCommon = "common"
)
View Source
const (
	DaemonSetStatusObservedWaiting = "ObservedWaiting"
	DaemonSetStatusPodReadyWaiting = "PodReadyWaiting"
	DaemonSetStatusUpdateWaiting   = "UpdateWaiting"
)
View Source
const (
	DeploymentStatusNewReplicaUpdating    = "NewReplicaUpdating"
	DeploymentStatusOldReplicaTerminating = "OldReplicaTerminating"
	DeploymentStatusAvailableWaiting      = "AvailableWaiting"
	DeploymentStatusRunning               = "Running"
	DeploymentStatusObservedWaiting       = "ObservedWaiting"
)
View Source
const (
	DefaultDockerGraphDir        = "/opt/docker"
	DefaultDockerRegistryMirror1 = "https://lje6zxpk.mirror.aliyuncs.com"
	DefaultDockerRegistryMirror2 = "https://lms7sxqp.mirror.aliyuncs.com"
	DefaultDockerRegistryMirror3 = "https://registry.docker-cn.com"
)
View Source
const (
	FederatedResourceStatusActive     = "active"
	FederatedResourceStatusUpdateFail = "update_fail"
	FederatedResourceStatusSyncing    = "syncing"
	FedreatedResourceStatusSyncFail   = "sync_fail"
)
View Source
const (
	ReleaseStatusDeploying  = "deploying"
	ReleaseStatusDeployFail = "deploy_fail"
	ReleaseStatusDeployed   = "deployed"
	ReleaseStatusUpdating   = "updating"
	ReleaseStatusUpdateFail = "update_fail"
	ReleaseStatusDeleting   = "deleting"
	ReleaseStatusDeleteFail = "delete_fail"
)
View Source
const (
	DefaultVMMemSize      = 2048       // 2G
	DefaultVMCPUCount     = 2          // 2 core
	DefaultVMRootDiskSize = 100 * 1024 // 100G
)
View Source
const (
	NodeStatusReady    = "Ready"
	NodeStatusNotReady = "NotReady"
)
View Source
const (
	RepoBackendCommon = "common"
	RepoBackendNexus  = "nexus"
)
View Source
const (
	// k8s annotations for create pod
	YUNION_CNI_NETWORK_ANNOTATION = "cni.yunion.io/network"
	YUNION_CNI_IPADDR_ANNOTATION  = "cni.yunion.io/ip"

	YUNION_LB_NETWORK_ANNOTATION = "loadbalancer.yunion.io/network"
	YUNION_LB_CLUSTER_ANNOTATION = "loadbalancer.yunion.io/cluster"
	YUNION_LB_ADDRESS_ANNOTATION = "loadbalancer.yunion.io/address"
)
View Source
const (
	StatefulSetStatusObservedWaiting    = "ObservedWaiting"
	StatefulSetStatusPodReadyWaiting    = "PodReadyWaiting"
	StatefulSetStatusNewReplicaUpdating = "NewReplicaUpdating"
	StatefulSetStatusUpdateWaiting      = "UpdateWaiting"
)
View Source
const (
	// kubernetes native resource
	ResourceNameConfigMap               string = "configmaps"
	ResourceNameDaemonSet               string = "daemonsets"
	ResourceNameDeployment              string = "deployments"
	ResourceNameEvent                   string = "events"
	ResourceNameHorizontalPodAutoscaler string = "horizontalpodautoscalers"
	ResourceNameIngress                 string = "ingresses"
	ResourceNameJob                     string = "jobs"
	ResourceNameCronJob                 string = "cronjobs"
	ResourceNameNamespace               string = "namespaces"
	ResourceNameNode                    string = "nodes"
	ResourceNamePersistentVolumeClaim   string = "persistentvolumeclaims"
	ResourceNamePersistentVolume        string = "persistentvolumes"
	ResourceNamePod                     string = "pods"
	ResourceNameReplicaSet              string = "replicasets"
	ResourceNameSecret                  string = "secrets"
	ResourceNameService                 string = "services"
	ResourceNameStatefulSet             string = "statefulsets"
	ResourceNameEndpoint                string = "endpoints"
	ResourceNameStorageClass            string = "storageclasses"
	ResourceNameRole                    string = "roles"
	ResourceNameRoleBinding             string = "rolebindings"
	ResourceNameClusterRole             string = "clusterroles"
	ResourceNameClusterRoleBinding      string = "clusterrolebindings"
	ResourceNameServiceAccount          string = "serviceaccounts"
	ResourceNameLimitRange              string = "limitranges"
	ResourceNameResourceQuota           string = "resourcequotas"

	// onecloud service operator resource
	ResourceNameVirtualMachine          string = "virtualmachines"
	ResourceNameAnsiblePlaybook         string = "ansibleplaybooks"
	ResourceNameAnsiblePlaybookTemplate string = "ansibleplaybooktemplates"
)
View Source
const (
	ClusterCA        = "cluster-ca"
	EtcdCA           = "etcd-ca"
	FrontProxyCA     = "front-proxy-ca"
	ServiceAccountCA = "service-account"
)
View Source
const (
	ErrPublicCloudImageNotFound = errors.Error("Image not found")
)
View Source
const (
	FederatedResourceStatusNotBind = "not_bind"
)
View Source
const (
	MachineMetadataCreateParams = "create_params"
)
View Source
const (
	SecretTypeCephCSI v1.SecretType = "yunion.io/ceph-csi"
)
View Source
const (
	StorageClassProvisionerCephCSIRBD = "rbd.csi.ceph.com"
)

Variables

View Source
var (
	PublicHypervisors = []string{
		api.HYPERVISOR_ALIYUN,
	}

	OnPremiseHypervisors = []string{
		api.HYPERVISOR_KVM,
		api.HYPERVISOR_BAREMETAL,
		api.HYPERVISOR_ESXI,
	}
)

Functions

func AddObjectMetaDefaultLabel

func AddObjectMetaDefaultLabel(meta *metav1.ObjectMeta) *metav1.ObjectMeta

func AddObjectMetaRunLabel

func AddObjectMetaRunLabel(meta *metav1.ObjectMeta) *metav1.ObjectMeta

func GenerateName

func GenerateName(base string) string

func GeneratePortMappingName

func GeneratePortMappingName(portMapping PortMapping) string

func GetSelectorByObjectMeta

func GetSelectorByObjectMeta(meta *metav1.ObjectMeta) *metav1.LabelSelector

Types

type AnsiblePlaybook

type AnsiblePlaybook struct {
	ObjectTypeMeta

	PlaybookTemplateRef *LocalObjectReference `json:"playbookTemplateRef,omitempty"`

	MaxRetryTime *int32 `json:"maxRetryTimes,omitempty"`
	AnsiblePlaybookStatus
}

type AnsiblePlaybookInfo

type AnsiblePlaybookInfo struct {
	OnecloudExternalInfoBase
	// OUtput is ansible playbook result output
	Output string `json:"output,omitempty"`
}

type AnsiblePlaybookStatus

type AnsiblePlaybookStatus struct {
	Status       string              `json:"status"`
	ExternalInfo AnsiblePlaybookInfo `json:"externalInfo"`
	TryTimes     int32               `json:"tryTimes"`
}

type AnsiblePlaybookTemplate

type AnsiblePlaybookTemplate struct {
	ObjectTypeMeta
	AnsiblePlaybookTemplateSpec
}

type AnsiblePlaybookTemplateSpec

type AnsiblePlaybookTemplateSpec struct {
	// Playbook describe the main content of ansible playbook which should be in yaml format
	Playbook string `json:"playbook"`
	// Requirements describe the source of roles dependent on Playbook
	Requirements string `json:"requirements"`
	// Files describe the associated file tree and file content which should be in json format
	Files string `json:"files,omitempty"`
	// Vars describe the vars to apply this ansible playbook
	Vars []AnsiblePlaybookTemplateVar `json:"vars,omitempty"`
}

type AnsiblePlaybookTemplateVar

type AnsiblePlaybookTemplateVar struct {
	Name string `json:"name"`
	// Required indicates whether this variable is required
	Required *bool `json:"required"`
	// Default describe the default value of this variable
	Default interface{} `json:"default,omitempty"`
}

type CephCSIRBDStorageClassCreateInput

type CephCSIRBDStorageClassCreateInput struct {
	// String representing a Ceph cluster to provision storage from.
	ClusterId string `json:"clusterId"`
	Pool      string `json:"pool"`
	// RBD image features, CSI creates image with image-format 2
	// CSI RBD currently supports only `layering` feature.
	ImageFeatures string `json:"imageFeatures"`

	SecretName      string `json:"secretName"`
	SecretNamespace string `json:"secretNamespace"`

	// The secrets have to contain Ceph credentials with required access to the `pool`.
	/*CSIProvisionerSecretName string `json:"csiProvisionerSecretName"`
	CSIProvisionerSecretNamespace string `json:"csiProvisionerSecretNamespace"`
	CSIControllerExpandSecretName string `json:"csiControllerExpandSecretName"`
	CSIControllerExpandSecretNamespace string `json:"csiControllerExpandSecretNamespace"`
	CSINodeStageSecretName string `json:"csiNodeStageSecretName"`
	CSINodeStageSecretNamespace string `json:"csiNodeStageSecretNamespace"`*/
	CSIFsType string `json:"csiFsType"`
}

type CephCSISecretCreateInput

type CephCSISecretCreateInput struct {
	// required: true
	UserId string `json:"userId"`
	// required: true
	UserKey string `json:"userKey"`

	EncryptionPassphrase string `json:"encryptionPassphrase"`
}

type CephRBDStorageClassCreateInput

type CephRBDStorageClassCreateInput struct {
	// Ceph monitors, comma delimited. This parameter is required
	Monitors string `json:"monitors"`
	// Ceph client ID that is capable of creating images in the pool. Default is “admin”.
	AdminId string `json:"adminId"`
	// Secret Name for adminId. This parameter is required. The provided secret must have type “kubernetes.io/rbd”.
	AdminSecretName string `json:"adminSecretName"`
	// The namespace for adminSecretName. Default is “default”.
	AdminSecretNamespace string `json:"adminSecretNamespace"`
	// Ceph RBD pool. Default is “rbd”.
	Pool string `json:"pool"`
	// Ceph client ID that is used to map the RBD image. Default is the same as adminId.
	UserId string `json:"userId"`
	// The name of Ceph Secret for userId to map RBD image. It must exist in the same namespace as PVCs.
	UserSecretName string `json:"userSecretName"`
	// The namespace for userSecretName.
	UserSecretNamespace string `json:"userSecretNamespace"`
	// fsType that is supported by kubernetes. Default: "ext4".
	FsType string `json:"fsType"`
	// Ceph RBD image format, “1” or “2”. Default is “2”.
	ImageFormat string `json:"imageFormat"`
	// This parameter is optional and should only be used if you set imageFormat to “2”. Currently supported features are layering only. Default is “”, and no features are turned on.
	ImageFeatures string `json:"layering"`
}

type ChartDetail

type ChartDetail struct {
	*chart.Chart `json:"chart"`
	Name         string             `json:"name"`
	Repo         string             `json:"repo"`
	Readme       string             `json:"readme"`
	Options      []SpotguideOptions `json:"options"`
	Files        []*chart.File      `json:"files"`
}

type ChartListInput

type ChartListInput struct {
	Name       string `json:"name"`
	Repo       string `json:"repo"`
	AllVersion bool   `json:"all_version"`
	Keyword    string `json:"keyword"`
	Version    string `json:"version"`
}

type ChartResult

type ChartResult struct {
	*repo.ChartVersion `json:"chart"`
	*chart.Metadata
	Repo string   `json:"repo"`
	Type RepoType `json:"type"`
}

type CloudMachineInfo

type CloudMachineInfo struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	Hypervisor string `json:"hypervisor"`
	ZoneId     string `json:"zone_id"`
	NetworkId  string `json:"network_id"`
}

type ClusterAPIGroupResource

type ClusterAPIGroupResource struct {
	APIGroup    string             `json:"apiGroup,allowempty"`
	APIResource metav1.APIResource `json:"apiResource"`
}

func (ClusterAPIGroupResource) GetKey

func (r ClusterAPIGroupResource) GetKey() string

type ClusterAPIGroupResources

type ClusterAPIGroupResources []ClusterAPIGroupResource

func (ClusterAPIGroupResources) Append

func (ClusterAPIGroupResources) GetByIndx

func (ClusterAPIGroupResources) Intersection

func (ClusterAPIGroupResources) Len

func (rs ClusterAPIGroupResources) Len() int

func (ClusterAPIGroupResources) New

func (ClusterAPIGroupResources) Unionset

type ClusterAddonNetworkConfig

type ClusterAddonNetworkConfig struct {
	EnableNativeIPAlloc bool `json:"enable_native_ip_alloc"`
}

type ClusterAddonsManifestConfig

type ClusterAddonsManifestConfig struct {
	Network ClusterAddonNetworkConfig `json:"network"`
}

type ClusterCreateInput

type ClusterCreateInput struct {
	apis.StatusDomainLevelResourceCreateInput

	IsSystem               *bool                `json:"is_system"`
	ClusterType            ClusterType          `json:"cluster_type"`
	ResourceType           ClusterResourceType  `json:"resource_type"`
	Mode                   ModeType             `json:"mode"`
	Provider               ProviderType         `json:"provider"`
	ServiceCidr            string               `json:"service_cidr"`
	ServiceDomain          string               `json:"service_domain"`
	PodCidr                string               `json:"pod_cidr"`
	Version                string               `json:"version"`
	HA                     bool                 `json:"ha"`
	Machines               []*CreateMachineData `json:"machines"`
	ImageRepository        *ImageRepository     `json:"image_repository"`
	CloudregionId          string               `json:"cloudregion_id"`
	VpcId                  string               `json:"vpc_id"`
	ManagerId              string               `json:"manager_id"`
	ExternalClusterId      string               `json:"external_cluster_id"`
	ExternalCloudClusterId string               `json:"external_cloud_cluster_id"`

	// imported cluster data
	ImportData *ImportClusterData `json:"import_data"`

	// cluster addons config
	AddonsConfig *ClusterAddonsManifestConfig `json:"addons_config"`

	// cluster extra config
	ExtraConfig *ClusterExtraConfig `json:"extra_config"`
}

type ClusterDeployAction

type ClusterDeployAction string
const (
	ClusterDeployActionCreate              ClusterDeployAction = "create"
	ClusterDeployActionRun                 ClusterDeployAction = "run"
	ClusterDeployActionScale               ClusterDeployAction = "scale"
	ClusterDeployActionUpgradeMasterConfig ClusterDeployAction = "upgrade-master-config"
	ClusterDeployActionRemoveNode          ClusterDeployAction = "remove-node"
)

type ClusterDeployInput

type ClusterDeployInput struct {
	// Force deploy
	Force bool `json:"force"`
	// Action can be 'run' or 'upgrade'
	Action        ClusterDeployAction `json:"action"`
	SkipDownloads bool                `json:"skip_downloads"`
}

type ClusterDistributionInfo

type ClusterDistributionInfo struct {
	Version string `json:"version"`
}

type ClusterExtraConfig

type ClusterExtraConfig struct {
	DockerRegistryMirrors    []string `json:"docker_registry_mirrors"`
	DockerInsecureRegistries []string `json:"docker_insecure_registries"`
}

type ClusterGetAddonsInput

type ClusterGetAddonsInput struct {
	EnableNativeIPAlloc bool `json:"enable_native_ip_alloc"`
}

type ClusterK8SResourceMetaDetail

type ClusterK8SResourceMetaDetail struct {
	metav1.TypeMeta
	// An opaque value that represents the internal version of this object that can
	// be used by clients to determine when objects have changed. May be used for optimistic
	// concurrency, change detection, and the watch operation on a resource or set of resources.
	// Clients must treat these values as opaque and passed unmodified back to the server.
	// They may only be valid for a particular resource or set of resources.
	//
	// Populated by the system.
	// Read-only.
	// Value must be treated as opaque by clients and .
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
	// +optional
	ResourceVersion string `json:"resourceVersion,omitempty"`

	// A sequence number representing a specific generation of the desired state.
	// Populated by the system. Read-only.
	// +optional
	Generation int64 `json:"generation,omitempty"`

	// CreationTimestamp is a timestamp representing the server time when this object was
	// created. It is not guaranteed to be set in happens-before order across separate operations.
	// Clients may not set this value. It is represented in RFC3339 form and is in UTC.
	//
	// Populated by the system.
	// Read-only.
	// Null for lists.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +optional
	CreationTimestamp time.Time `json:"creationTimestamp"`

	// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This
	// field is set by the server when a graceful deletion is requested by the user, and is not
	// directly settable by a client. The resource is expected to be deleted (no longer visible
	// from resource lists, and not reachable by name) after the time in this field, once the
	// finalizers list is empty. As long as the finalizers list contains items, deletion is blocked.
	// Once the deletionTimestamp is set, this value may not be unset or be set further into the
	// future, although it may be shortened or the resource may be deleted prior to this time.
	// For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react
	// by sending a graceful termination signal to the containers in the pod. After that 30 seconds,
	// the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup,
	// remove the pod from the API. In the presence of network partitions, this object may still
	// exist after this timestamp, until an administrator or automated process can determine the
	// resource is fully terminated.
	// If not set, graceful deletion of the object has not been requested.
	//
	// Populated by the system when a graceful deletion is requested.
	// Read-only.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +optional
	DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`

	// Number of seconds allowed for this object to gracefully terminate before
	// it will be removed from the system. Only set when deletionTimestamp is also set.
	// May only be shortened.
	// Read-only.
	// +optional
	DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"`

	// Map of string keys and values that can be used to organize and categorize
	// (scope and select) objects. May match selectors of replication controllers
	// and services.
	// More info: http://kubernetes.io/docs/user-guide/labels
	// +optional
	Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"`

	// Annotations is an unstructured key value map stored with a resource that may be
	// set by external tools to store and retrieve arbitrary metadata. They are not
	// queryable and should be preserved when modifying objects.
	// More info: http://kubernetes.io/docs/user-guide/annotations
	// +optional
	Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"`

	// List of objects depended by this object. If ALL objects in the list have
	// been deleted, this object will be garbage collected. If this object is managed by a controller,
	// then an entry in this list will point to this controller, with the controller field set to true.
	// There cannot be more than one managing controller.
	// +optional
	// +patchMergeKey=uid
	// +patchStrategy=merge
	OwnerReferences []metav1.OwnerReference `json:"ownerReferences,omitempty" patchStrategy:"merge" patchMergeKey:"uid" protobuf:"bytes,13,rep,name=ownerReferences"`

	// Must be empty before the object is deleted from the registry. Each entry
	// is an identifier for the responsible component that will remove the entry
	// from the list. If the deletionTimestamp of the object is non-nil, entries
	// in this list can only be removed.
	// +optional
	// +patchStrategy=merge
	Finalizers []string `json:"finalizers,omitempty" patchStrategy:"merge" protobuf:"bytes,14,rep,name=finalizers"`
}

type ClusterKubesprayConfig

type ClusterKubesprayConfig struct {
	InventoryContent string               `json:"inventory_content"`
	PrivateKey       string               `json:"private_key"`
	Vars             jsonutils.JSONObject `json:"vars"`
}

type ClusterListInput

type ClusterListInput struct {
	apis.StatusDomainLevelResourceListInput
	FederatedResourceUsedInput

	ManagerId              []string `json:"manager_id"`
	Manager                []string `json:"manager" yunion-deprecated-by:"manager_id"`
	ExternalClusterId      string   `json:"external_cluster_id"`
	ExternalCloudClusterId string   `json:"external_cloud_cluster_id"`
	CloudregionId          string   `json:"cloudregion_id"`
	Provider               []string `json:"provider"`
	Mode                   ModeType `json:"mode"`
}

type ClusterMachineCommonInfo

type ClusterMachineCommonInfo struct {
	CloudregionId string
	VpcId         string
}

type ClusterMeta

type ClusterMeta struct {
	// Onecloud cluster data
	Cluster   string `json:"cluster"`
	ClusterId string `json:"clusterID"`
	// Deprecated
	TenantId  string `json:"tenant_id"`
	ProjectId string `json:"project_id"`
}

func NewClusterMeta

func NewClusterMeta(cluster ICluster) *ClusterMeta

type ClusterPreCheckResp

type ClusterPreCheckResp struct {
	Pass       bool   `json:"pass"`
	ImageError string `json:"image_error"`
}

type ClusterPurgeInput

type ClusterPurgeInput struct {
	apis.Meta
	Force bool `json:"force"`
}

type ClusterResourceCreateInput

type ClusterResourceCreateInput struct {
	K8sResourceCreateInput
	// 集群Id
	ClusterId string `json:"cluster_id"`

	// swagger:ignore
	// Deprecated
	Cluster string `json:"cluster" yunion-deprecated-by:"cluster_id"`
}

type ClusterResourceDetail

type ClusterResourceDetail struct {
	apis.StatusDomainLevelResourceDetails
	*ClusterK8SResourceMetaDetail

	ClusterId string `json:"cluster_id"`
	// clusterID is DEPRECATED, use cluster_id
	ClusterID string `json:"clusterID"`
	Cluster   string `json:"cluster"`

	Distribution string `json:"distribution"`
}

type ClusterResourceListInput

type ClusterResourceListInput struct {
	apis.StatusDomainLevelResourceListInput
	System *bool `json:"system"`

	// Deprecated
	Cluster string `json:"cluster" yunion-deprecated-by:"cluster_id"`
	// 集群名称
	ClusterId string `json:"cluster_id"`
	// Deprecated
	Account string `json:"account" yunion-deprecated-by:"cluster_id"`
	// Deprecated
	AccountId string `json:"account_id" yunion-deprecated-by:"cluster_id"`
}

type ClusterResourceType

type ClusterResourceType string

type ClusterResourceUpdateInput

type ClusterResourceUpdateInput struct {
	apis.StatusDomainLevelResourceBaseUpdateInput

	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

type ClusterRoleBindingCreateInput

type ClusterRoleBindingCreateInput struct {
	ClusterResourceCreateInput
	// Subjects holds references to the objects the role applies to.
	// +optional
	Subjects Subjects `json:"subjects,omitempty"`

	// RoleRef can only reference a ClusterRole in the global namespace.
	// If the RoleRef cannot be resolved, the Authorizer must return an error.
	RoleRef RoleRef `json:"roleRef"`
}

func (ClusterRoleBindingCreateInput) ToClusterRoleBinding

func (crb ClusterRoleBindingCreateInput) ToClusterRoleBinding() *rbac.ClusterRoleBinding

type ClusterRoleBindingDetail

type ClusterRoleBindingDetail struct {
	ClusterResourceDetail

	// Subjects holds references to the objects the role applies to.
	// +optional
	Subjects []rbac.Subject `json:"subjects,omitempty"`

	// RoleRef can only reference a ClusterRole in the global namespace.
	// If the RoleRef cannot be resolved, the Authorizer must return an error.
	RoleRef rbac.RoleRef `json:"roleRef"`
}

ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject.

type ClusterRoleBindingTemplate

type ClusterRoleBindingTemplate struct {
	Subjects []rbac.Subject `json:"subjects,omitempty"`
	// RoleRef can only reference a FederatedClusterRole in the global namespace.
	RoleRef rbac.RoleRef `json:"roleRef"`
}

type ClusterRoleBindingUpdateInput

type ClusterRoleBindingUpdateInput struct {
	ClusterResourceUpdateInput
	Subjects Subjects `json:"subjects,omitempty"`
	RoleRef  RoleRef  `json:"roleRef"`
}

type ClusterRoleCreateInput

type ClusterRoleCreateInput struct {
	ClusterResourceCreateInput
	Rules []rbac.PolicyRule `json:"rules"`
}

func (ClusterRoleCreateInput) ToClusterRole

func (input ClusterRoleCreateInput) ToClusterRole() *rbac.ClusterRole

type ClusterRoleDetail

type ClusterRoleDetail struct {
	ClusterResourceDetail
	Rules []rbac.PolicyRule `json:"rules"`

	AggregationRule *rbac.AggregationRule `json:"aggregationRule,omitempty"`
}

type ClusterRoleTemplate

type ClusterRoleTemplate struct {
	Rules []rbac.PolicyRule `json:"rules"`
}

type ClusterRoleUpdateInput

type ClusterRoleUpdateInput struct {
	ClusterResourceUpdateInput
	Rules []rbac.PolicyRule `json:"rules"`
}

type ClusterSetKubeconfig

type ClusterSetKubeconfig struct {
	Kubeconfig string `json:"kubeconfig"`
}

type ClusterSyncInput

type ClusterSyncInput struct {
	// Force sync
	Force bool `json:"force"`
}

type ClusterType

type ClusterType string

k8s cluster type

const (
	// common k8s cluster with nodes
	ClusterTypeDefault ClusterType = "default"
)

type ClusterUsage

type ClusterUsage struct {
	// node usage
	Node *NodeUsage `json:"node"`
	// cluster count
	Count int64 `json:"count"`
}

type ClusterUser

type ClusterUser struct {
	Name string `json:"name"`
	// FullName is the full name of user
	FullName string `json:"fullName"`
	// Identities are the identities associated with this user
	Identities []string `json:"identities"`
	// Groups specifies group names this user is a member of.
	// This field is deprecated and will be removed in a future release.
	// Instead, create a Group object containing the name of this User.
	Groups []string `json:"groups"`
}

func (ClusterUser) GetKey

func (user ClusterUser) GetKey() string

type ClusterUserGroup

type ClusterUserGroup struct {
	Name string `json:"name"`
	// Users is the list of users in this group.
	Users OptionalNames `json:"users"`
}

func (ClusterUserGroup) GetKey

func (g ClusterUserGroup) GetKey() string

type ClusterUserGroups

type ClusterUserGroups []ClusterUserGroup

func (ClusterUserGroups) Append

func (ClusterUserGroups) GetByIndx

func (rs ClusterUserGroups) GetByIndx(idx int) IClusterRemoteResource

func (ClusterUserGroups) Intersection

func (ClusterUserGroups) Len

func (rs ClusterUserGroups) Len() int

func (ClusterUserGroups) New

func (ClusterUserGroups) Unionset

type ClusterUsers

type ClusterUsers []ClusterUser

func (ClusterUsers) Append

func (ClusterUsers) GetByIndx

func (rs ClusterUsers) GetByIndx(idx int) IClusterRemoteResource

func (ClusterUsers) Intersection

func (ClusterUsers) Len

func (rs ClusterUsers) Len() int

func (ClusterUsers) New

func (ClusterUsers) Unionset

type ComponentCephCSIConfigCluster

type ComponentCephCSIConfigCluster struct {
	// 集群 Id
	// required: true
	// example: office-ceph-cluster
	ClsuterId string `json:"clusterId"`
	// ceph monitor 连接地址, 比如: 192.168.222.12:6239
	// required: true
	// example: ["192.168.222.12:6239", "192.168.222.13:6239", "192.168.222.14:6239"]
	Monitors []string `json:"monitors"`
}

type ComponentCreateInput

type ComponentCreateInput struct {
	apis.Meta

	Name string `json:"name"`
	Type string `json:"type"`

	Cluster string `json:"cluster"`
	ComponentSettings
}

type ComponentDeleteInput

type ComponentDeleteInput struct {
	apis.Meta

	Name string `json:"name"`
	Type string `json:"type"`
}

type ComponentMinoMode

type ComponentMinoMode string
const (
	ComponentMinoModeStandalone  ComponentMinoMode = "standalone"
	ComponentMinoModeDistributed ComponentMinoMode = "distributed"
)

type ComponentSettingCephCSI

type ComponentSettingCephCSI struct {
	// 集群配置
	// required: true
	Config []ComponentCephCSIConfigCluster `json:"config"`
}

type ComponentSettingFluentBit

type ComponentSettingFluentBit struct {
	Backend *ComponentSettingFluentBitBackend `json:"backend"`
}

type ComponentSettingFluentBitBackend

type ComponentSettingFluentBitBackend struct {
	// Elasticsearch 配置
	ES *ComponentSettingFluentBitBackendES `json:"es"`
	// Kafka 配置
	Kafka *ComponentSettingFluentBitBackendKafka `json:"kafka"`
}

type ComponentSettingFluentBitBackendCommon

type ComponentSettingFluentBitBackendCommon struct {
	// 是否启用该后端
	// required: true
	Enabled bool `json:"enabled"`
}

type ComponentSettingFluentBitBackendES

type ComponentSettingFluentBitBackendES struct {
	ComponentSettingFluentBitBackendCommon
	// Elastic 集群连接地址
	//
	// required: true
	// example: 10.168.26.182
	Host string `json:"host"`

	// Elastic 集群连接地址
	//
	// required: true
	// default: 9200
	// example: 9200
	Port int `json:"port"`

	// Elastic index 名称
	//
	// required: true
	// default: fluentbit
	Index string `json:"index"`

	// 类型
	//
	// required: true
	// default: flb_type
	Type string `json:"type"`

	LogstashPrefix string `json:"logstashPrefix"`
	LogstashFormat bool   `json:"logstashFormat"`
	ReplaceDots    bool   `json:"replaceDots"`
	// Optional username credential for Elastic X-Pack access
	HTTPUser string `json:"httpUser"`
	// Password for user defined in HTTPUser
	HTTPPassword string `json:"httpPassword"`
	ComponentSettingFluentBitBackendTLS
}

type ComponentSettingFluentBitBackendForward

type ComponentSettingFluentBitBackendForward struct {
	Host string `json:"host"`
	Port int    `json:"port"`
	ComponentSettingFluentBitBackendTLS
}

type ComponentSettingFluentBitBackendKafka

type ComponentSettingFluentBitBackendKafka struct {
	ComponentSettingFluentBitBackendCommon
	// 上报数据格式
	//
	// required: false
	// default: json
	// example: json|msgpack
	Format string `json:"format"`
	// Optional key to store the message
	MessageKey string `json:"messageKey"`
	// Set the key to store the record timestamp
	TimestampKey string `json:"timestampKey"`
	// kafka broker 地址
	//
	// required: true
	// example: ["192.168.222.10:9092", "192.168.222.11:9092", "192.168.222.13:9092"]
	Brokers []string `json:"brokers"`
	// kafka topic
	//
	// required: true
	// example: ["fluent-bit"]
	Topics []string `json:"topics"`
}

check: https://fluentbit.io/documentation/0.14/output/kafka.html

type ComponentSettingFluentBitBackendTLS

type ComponentSettingFluentBitBackendTLS struct {
	// 是否开启 TLS 连接
	//
	// required: false
	TLS bool `json:"tls"`

	// 是否开启 TLS 教研
	//
	// required: false
	TLSVerify bool   `json:"tlsVerify"`
	TLSDebug  bool   `json:"tlsDebug"`
	TLSCA     string `json:"tlsCA"`
}

type ComponentSettingMinio

type ComponentSettingMinio struct {
	Mode ComponentMinoMode `json:"mode"`
	// Number of MinIO containers running (aplicable only for MinIO distributed mode)
	Replicas      int `json:"replicas"`
	DrivesPerNode int `json:"drivesPerNode"`
	// Number of zones (aplicable only for MinIO distributed mode)
	Zones int `json:"zones"`
	// Number of drives per node (aplicable only for MinIO distributed mode)
	// Default MinIO admin accessKey
	AccessKey string `json:"accessKey"`
	// Default Minio admin secretKey
	SecretKey string `json:"secretKey"`
	// Default directory mount path, e.g. `/export`
	MountPath string           `json:"mountPath"`
	Storage   ComponentStorage `json:"storage"`
}

type ComponentSettingMonitor

type ComponentSettingMonitor struct {
	// Grafana 前端日志、监控展示服务
	//
	// required: true
	Grafana *ComponentSettingMonitorGrafana `json:"grafana"`
	// Loki 后端日志收集服务
	//
	// required: true
	Loki *ComponentSettingMonitorLoki `json:"loki"`
	// Prometheus 监控数据采集服务
	//
	// required: true
	Prometheus *ComponentSettingMonitorPrometheus `json:"prometheus"`
	// Promtail 日志收集 agent
	//
	// required: false
	Promtail *ComponentSettingMonitorPromtail `json:"promtail"`
}

type ComponentSettingMonitorGrafana

type ComponentSettingMonitorGrafana struct {
	Disable   bool                `json:"disable"`
	Resources *HelmValueResources `json:"resources"`

	// grafana 登录用户名
	// default: admin
	AdminUser string `json:"adminUser"`

	// grafana 登录用户密码
	// default: prom-operator
	AdminPassword string `json:"adminPassword"`
	// grafana 持久化存储配置
	Storage *ComponentStorage `json:"storage"`
	// grafana ingress public address
	PublicAddress string `json:"publicAddress"`
	// grafana ingress host
	Host          string `json:"host"`
	EnforceDomain bool   `json:"enforceDomain"`
	// Ingress expose https key pair
	TLSKeyPair *TLSKeyPair `json:"tlsKeyPair"`
	// Disable subpath /grafana
	DisableSubpath bool   `json:"disableSubpath"`
	Subpath        string `json:"subpath"`
	// Enable thanos query datasource
	EnableThanosQueryDataSource bool                                 `json:"enableThanosQueryDataSource"`
	OAuth                       *ComponentSettingMonitorGrafanaOAuth `json:"oauth"`
	DB                          *DBConfig                            `json:"db"`
}

type ComponentSettingMonitorGrafanaOAuth

type ComponentSettingMonitorGrafanaOAuth struct {
	Enabled           bool   `json:"enabled"`
	ClientId          string `json:"clientId"`
	ClientSecret      string `json:"clientSecret"`
	Scopes            string `json:"scopes"`
	AuthURL           string `json:"authURL"`
	TokenURL          string `json:"tokenURL"`
	APIURL            string `json:"apiURL"`
	AllowedDomains    string `json:"allowedDomains"`
	AllowSignUp       bool   `json:"allowSignUp"`
	RoleAttributePath string `json:"roleAttributePath"`
}

type ComponentSettingMonitorLoki

type ComponentSettingMonitorLoki struct {
	Disable   bool                `json:"disable"`
	Resources *HelmValueResources `json:"resources"`

	// loki 持久化存储配置
	Storage *ComponentStorage `json:"storage"`
	// loki s3 对象存储配置
	ObjectStoreConfig *ObjectStoreConfig `json:"objectStoreConfig"`
}

type ComponentSettingMonitorPrometheus

type ComponentSettingMonitorPrometheus struct {
	Disable   bool                `json:"disable"`
	Resources *HelmValueResources `json:"resources"`
	// prometheus 持久化存储配置
	Storage       *ComponentStorage                        `json:"storage"`
	ThanosSidecar *ComponentSettingMonitorPrometheusThanos `json:"thanosSidecar"`
}

type ComponentSettingMonitorPrometheusThanos

type ComponentSettingMonitorPrometheusThanos struct {
	// thanos sidecar base image, e.g. `thanosio/thanos`
	// BaseImage string `json:"baseImage"`
	// thanos sidecar image version, e.g. `v0.16.0`
	// Version string `json:"version"`
	// thanos sidecar s3 对象存储配置
	ObjectStoreConfig *ObjectStoreConfig `json:"objectStoreConfig"`
}

type ComponentSettingMonitorPromtail

type ComponentSettingMonitorPromtail struct {
	Disable           bool                    `json:"disable"`
	Resources         *HelmValueResources     `json:"resources"`
	DockerVolumeMount *ComponentSettingVolume `json:"dockerVolumeMount"`
	PodsVolumeMount   *ComponentSettingVolume `json:"podsVolumeMount"`
}

type ComponentSettingThanos

type ComponentSettingThanos struct {
	ClusterDomain     string                      `json:"clusterDomain"`
	ObjectStoreConfig ObjectStoreConfig           `json:"objectStoreConfig"`
	Query             ComponentThanosQuery        `json:"query"`
	Store             ComponentThanosStoregateway `json:"storegateway"`
	Compactor         ComponentThanosCompactor    `json:"compactor"`
}

type ComponentSettingVolume

type ComponentSettingVolume struct {
	HostPath  string `json:"hostPath"`
	MountPath string `json:"mountPath"`
}

type ComponentSettings

type ComponentSettings struct {
	Namespace                 string           `json:"namespace"`
	DisableResourceManagement bool             `json:"disableResourceManagement"`
	ImageRepository           *ImageRepository `json:"imageRepository"`
	// Ceph CSI 组件配置
	CephCSI *ComponentSettingCephCSI `json:"cephCSI"`
	// Monitor stack 组件配置
	Monitor *ComponentSettingMonitor `json:"monitor"`
	// Fluentbit 日志收集 agent 配置
	FluentBit *ComponentSettingFluentBit `json:"fluentbit"`
	// Thanos 组件配置
	Thanos *ComponentSettingThanos `json:"thanos"`
	// Minio 对象存储配置
	Minio *ComponentSettingMinio `json:"minio"`
	// Monitor Minio 对象存储配置
	MonitorMinio *ComponentSettingMinio `json:"monitorMinio"`
}

type ComponentStatus

type ComponentStatus struct {
	Id      string `json:"id"`
	Created bool   `json:"created"`
	Enabled bool   `json:"enabled"`
	Status  string `json:"status"`
}

type ComponentStatusCephCSI

type ComponentStatusCephCSI struct {
	ComponentStatus
}

type ComponentStatusFluentBit

type ComponentStatusFluentBit struct {
	ComponentStatus
}

type ComponentStatusMonitor

type ComponentStatusMonitor struct {
	ComponentStatus
}

type ComponentStorage

type ComponentStorage struct {
	// 是否启用持久化存储
	Enabled bool `json:"enabled"`
	// 存储大小, 单位 MB
	SizeMB int `json:"sizeMB"`
	// storageClass 名称
	//
	// required: true
	ClassName string `json:"storageClassName"`
}

func (ComponentStorage) GetAccessModes

func (s ComponentStorage) GetAccessModes() []string

type ComponentThanosCompactor

type ComponentThanosCompactor struct {
	Storage ComponentStorage `json:"storage"`
}

type ComponentThanosDnsDiscovery

type ComponentThanosDnsDiscovery struct {
	// Enabled bool `json:"enabled"`
	// Sidecars service name to discover them using DNS discovery
	// e.g. `prometheus-operated`
	SidecarsService string `json:"sidecarsService"`
	// Sidecars namespace to discover them using DNS discovery
	// e.g. `default`
	SidecarsNamespace string `json:"sidecarsNamespace"`
}

type ComponentThanosQuery

type ComponentThanosQuery struct {
	// LogLevel string `json:"logLevel"`
	// ReplicaLabel []string `json:"replicaLabel"`
	DnsDiscovery ComponentThanosDnsDiscovery `json:"dnsDiscovery"`
	// Statically configure store APIs to connect with Thanos
	Stores []string `json:"stores"`
}

type ComponentThanosStoregateway

type ComponentThanosStoregateway struct {
	Storage ComponentStorage `json:"storage"`
}

type ComponentUpdateInput

type ComponentUpdateInput struct {
	apis.Meta

	Type  string `json:"type"`
	Force bool   `json:"force"`

	ComponentSettings
}

type ComponentsStatus

type ComponentsStatus struct {
	apis.Meta

	CephCSI      *ComponentStatusCephCSI   `json:"cephCSI"`
	Monitor      *ComponentStatusMonitor   `json:"monitor"`
	FluentBit    *ComponentStatusFluentBit `json:"fluentbit"`
	Thanos       *ComponentStatus          `json:"thanos"`
	Minio        *ComponentStatus          `json:"minio"`
	MonitorMinio *ComponentStatus          `json:"monitorMinio"`
}

type Condition

type Condition struct {
	// Type of a condition.
	Type string `json:"type"`
	// Status of a condition.
	Status api.ConditionStatus `json:"status"`
	// Last probe time of a condition.
	LastProbeTime v1.Time `json:"lastProbeTime"`
	// Last transition time of a condition.
	LastTransitionTime v1.Time `json:"lastTransitionTime"`
	// Reason of a condition.
	Reason string `json:"reason"`
	// Message of a condition.
	Message string `json:"message"`
}

Condition represents a single condition of a pod or node.

type ConfigMap

type ConfigMap struct {
	ObjectMeta
	TypeMeta
}

type ConfigMapCreateInput

type ConfigMapCreateInput struct {
	NamespaceResourceCreateInput
	// required: true
	// Data contains the configuration data.
	// Each key must be a valid DNS_SUBDOMAIN with an optional leading dot.
	Data map[string]string `json:"data,omitempty"`
}

type ConfigMapDetail

type ConfigMapDetail struct {
	ConfigMap

	// Data contains the configuration data.
	// Each key must be a valid DNS_SUBDOMAIN with an optional leading dot.
	Data map[string]string `json:"data,omitempty"`

	// Pods use configmap
	Pods []*Pod `json:"pods,omitempty"`
}

type ConfigMapUpdateInput

type ConfigMapUpdateInput struct {
	// required: true
	// Data contains the configuration data.
	// Each key must be a valid DNS_SUBDOMAIN with an optional leading dot.
	Data map[string]string `json:"data,omitempty"`
}

type Container

type Container struct {
	// Name of the container.
	Name string `json:"name"`

	// Image URI of the container.
	Image string `json:"image"`

	// List of environment variables.
	Env []EnvVar `json:"env"`

	// Commands of the container
	Commands []string `json:"commands"`

	// Command arguments
	Args []string `json:"args"`
}

Container represents a docker/rkt/etc. container that lives in a pod.

type ContainerImage

type ContainerImage struct {
	Name  string `json:"name"`
	Image string `json:"image"`
}

type ContainerRegistryConfig

type ContainerRegistryConfig struct {
	Common *ContainerRegistryConfigCommon `json:"common`
	Harbor *ContainerRegistryConfigHarbor `json:"harbor"`
}

type ContainerRegistryConfigCommon

type ContainerRegistryConfigCommon struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type ContainerRegistryConfigHarbor

type ContainerRegistryConfigHarbor struct {
	ContainerRegistryConfigCommon
}

type ContainerRegistryCreateInput

type ContainerRegistryCreateInput struct {
	apis.StatusInfrasResourceBaseCreateInput

	// Repo type
	// required: true
	// enum: harbor
	Type ContainerRegistryType `json:"type"`

	// Repo URL
	// required: true
	// example: https://10.127.190.187
	Url string `json:"url"`

	// Configuration info
	Config ContainerRegistryConfig `json:"config"`
}

type ContainerRegistryDownloadImageInput

type ContainerRegistryDownloadImageInput struct {
	ImageName string `json:"image_name"`
	Tag       string `json:"tag"`
}

type ContainerRegistryGetImageTagsInput

type ContainerRegistryGetImageTagsInput struct {
	Repository string `json:"repository"`
}

type ContainerRegistryListImagesInput

type ContainerRegistryListImagesInput struct {
	Details        bool   `json:"details"`
	RepositoryName string `json:"repository_name"`
}

type ContainerRegistryListInput

type ContainerRegistryListInput struct {
	apis.StatusInfrasResourceBaseListInput

	Type string `json:"type"`
	Url  string `json:"url"`
}

type ContainerRegistryManagerDownloadImageInput

type ContainerRegistryManagerDownloadImageInput struct {
	Insecure bool   `json:"insecure"`
	Image    string `json:"image"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type ContainerRegistryType

type ContainerRegistryType string

type ContainerRegistryUploadImageInput

type ContainerRegistryUploadImageInput struct {
	// Repository is the path on server, e.g. 'yunion/influxdb'
	Repository string `json:"repository"`
	// Tag is image tag
	Tag string `json:"tag"`
}

type ContainerUpdateInput

type ContainerUpdateInput struct {
	// required: true
	Name  string `json:"name"`
	Image string `json:"image,omitempty"`
}

type CpuUsage

type CpuUsage struct {
	// cpu total capacity
	Capacity int64 `json:"capacity"`
	// cpu pods request millcore
	Request int64 `json:"request"`
	// cpu pods limit millcore
	Limit int64 `json:"limit"`
}

func (*CpuUsage) Add

func (u *CpuUsage) Add(ou *CpuUsage) *CpuUsage

type CreateMachineData

type CreateMachineData struct {
	Name          string               `json:"name"`
	ClusterId     string               `json:"cluster_id"`
	Role          string               `json:"role"`
	Provider      string               `json:"provider"`
	ResourceType  string               `json:"resource_type"`
	ResourceId    string               `json:"resource_id"`
	Address       string               `json:"address"`
	FirstNode     bool                 `json:"first_node"`
	Config        *MachineCreateConfig `json:"config"`
	K8sNodeConfig *K8sNodeConfig       `json:"k8s_node_config"`

	ZoneId    string `json:"zone_id"`
	NetworkId string `json:"network_id"`

	// CloudregionId will be inject by cluster
	CloudregionId string `json:"-"`
	VpcId         string `json:"-"`
	// ClusterDeployAction will be inject by background task
	ClusterDeployAction ClusterDeployAction `json:"cluster_deploy_action"`
}

type CronJob

type CronJob struct {
	ObjectMeta
	TypeMeta
	Schedule     string       `json:"schedule"`
	Suspend      *bool        `json:"suspend"`
	Active       int          `json:"active"`
	LastSchedule *metav1.Time `json:"lastSchedule"`
}

CronJob is a presentation layer view of Kubernetes Cron Job resource.

type CronJobCreateInput

type CronJobCreateInput struct {
	K8sNamespaceResourceCreateInput
	v1beta1.CronJobSpec
}

type CronJobCreateInputV2

type CronJobCreateInputV2 struct {
	NamespaceResourceCreateInput
	v1beta1.CronJobSpec
}

type CronJobDetail

type CronJobDetail struct {
	CronJob

	ConcurrencyPolicy       string   `json:"concurrencyPolicy"`
	StartingDeadLineSeconds *int64   `json:"startingDeadlineSeconds"`
	ActiveJobs              []*Job   `json:"activeJobs"`
	InactiveJobs            []*Job   `json:"inactiveJobs"`
	Events                  []*Event `json:"events"`
}

type CronJobDetailV2

type CronJobDetailV2 struct {
	NamespaceResourceDetail
	Schedule                interface{} `json:"schedule"`
	Suspend                 interface{} `json:"suspend"`
	Active                  interface{} `json:"active"`
	LastSchedule            interface{} `json:"lastSchedule"`
	ConcurrencyPolicy       interface{} `json:"concurrencyPolicy"`
	StartingDeadLineSeconds interface{} `json:"startingDeadlineSeconds"`
}

type DBConfig

type DBConfig struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Database string `json:"database"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type DaemonSet

type DaemonSet struct {
	ObjectMeta
	TypeMeta

	// Aggregate information about pods belonging to this deployment
	PodInfo PodInfo `json:"podsInfo"`

	ContainerImages     []ContainerImage  `json:"containerImages"`
	InitContainerImages []ContainerImage  `json:"initContainerImages"`
	Selector            *v1.LabelSelector `json:"labelSelector"`

	DaemonSetStatus
}

DaemonSet plus zero or more Kubernetes services that target the Daemon Set.

type DaemonSetCreateInput

type DaemonSetCreateInput struct {
	NamespaceResourceCreateInput

	apps.DaemonSetSpec
	Service *ServiceCreateOption `json:"service"`
}

func (DaemonSetCreateInput) ToDaemonset

func (input DaemonSetCreateInput) ToDaemonset(namespaceName string) (*apps.DaemonSet, error)

type DaemonSetDetail

type DaemonSetDetail struct {
	DaemonSet

	Events []*Event `json:"events"`
}

type DaemonSetDetailV2

type DaemonSetDetailV2 struct {
	NamespaceResourceDetail
	// Aggregate information about pods belonging to this deployment
	PodInfo             PodInfo           `json:"podsInfo"`
	ContainerImages     []ContainerImage  `json:"containerImages"`
	InitContainerImages []ContainerImage  `json:"initContainerImages"`
	LabelSelector       *v1.LabelSelector `json:"labelSelector"`
	Selector            map[string]string `json:"selector"`
	DaemonSetStatus
}

type DaemonSetStatus

type DaemonSetStatus struct {
	Status string `json:"status"`
}

type Deployment

type Deployment struct {
	ObjectMeta
	TypeMeta

	// Aggregate information about pods belonging to this deployment
	Pods PodInfo `json:"podsInfo"`

	Replicas *int32 `json:"replicas"`

	// Container images of the Deployment
	ContainerImages []ContainerImage `json:"containerImages"`

	// Init Container images of deployment
	InitContainerImages []ContainerImage `json:"initContainerImages"`

	Selector map[string]string `json:"selector"`

	DeploymentStatus
}

Deployment is a presentation layer view of kubernetes Deployment resource. This means it is Deployment plus additional augmented data we can get from other sources (like services that target the same pods)

type DeploymentCreateInput

type DeploymentCreateInput struct {
	// K8sNamespaceResourceCreateInput
	NamespaceResourceCreateInput

	apps.DeploymentSpec

	Service *ServiceCreateOption `json:"service"`
}

func (*DeploymentCreateInput) ToDeployment

func (input *DeploymentCreateInput) ToDeployment(namespaceName string) (*apps.Deployment, error)

type DeploymentDetail

type DeploymentDetail struct {
	Deployment
	// Detailed information about Pods belonging to this Deployment.
	Pods []*Pod `json:"pods"`

	Services []*Service `json:"services"`

	// Status information on the deployment
	StatusInfo `json:"statusInfo"`

	// The deployment strategy to use to replace existing pods with new ones.
	// Valid options: Recreate, RollingUpdate
	Strategy apps.DeploymentStrategyType `json:"strategy"`

	// Min ready seconds
	MinReadySeconds int32 `json:"minReadySeconds"`

	// Rolling update strategy containing maxSurge and maxUnavailable
	RollingUpdateStrategy *RollingUpdateStrategy `json:"rollingUpdateStrategy,omitempty"`

	// RepliaSets containing old replica sets from the deployment
	OldReplicaSets []*ReplicaSet `json:"oldReplicaSets"`

	// New replica set used by this deployment
	NewReplicaSet *ReplicaSet `json:"newReplicaSet"`

	// Optional field that specifies the number of old Replica Sets to retain to allow rollback.
	RevisionHistoryLimit *int32 `json:"revisionHistoryLimit"`

	// List of events related to this Deployment
	Events []*Event `json:"events"`
}

DeploymentDetail is a presentation layer view of Kubernetes Deployment resource.

type DeploymentDetailV2

type DeploymentDetailV2 struct {
	NamespaceResourceDetail
	// Aggregate information about pods belonging to this deployment
	Pods     PodInfo `json:"podsInfo"`
	Replicas *int32  `json:"replicas"`
	// Container images of the Deployment
	ContainerImages []ContainerImage `json:"containerImages"`
	// Init Container images of deployment
	InitContainerImages []ContainerImage  `json:"initContainerImages"`
	Selector            map[string]string `json:"selector"`
	DeploymentStatus
	// Rolling update strategy containing maxSurge and maxUnavailable
	RollingUpdateStrategy *RollingUpdateStrategy `json:"rollingUpdateStrategy,omitempty"`
	// The deployment strategy to use to replace existing pods with new ones.
	// Valid options: Recreate, RollingUpdate
	Strategy apps.DeploymentStrategyType `json:"strategy"`
	// Min ready seconds
	MinReadySeconds int32 `json:"minReadySeconds"`
	// Optional field that specifies the number of old Replica Sets to retain to allow rollback.
	RevisionHistoryLimit *int32 `json:"revisionHistoryLimit"`
}

type DeploymentListInput

type DeploymentListInput struct {
	NamespaceResourceListInput
}

type DeploymentStatus

type DeploymentStatus struct {
	Status string `json:"status"`

	// Number of the pod with ready state.
	ReadyReplicas int64 `json:"readyReplicas"`
	// Number of desired pods
	DesiredReplicas int64 `json:"desiredReplicas"`
	// Total number of non-terminated pods targeted by this deployment that have the desired template spec.
	UpdatedReplicas int64 `json:"updatedReplicas"`
	// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
	AvailableReplicas int64 `json:"availableReplicas"`
}

type DeploymentUpdateInput

type DeploymentUpdateInput struct {
	K8SNamespaceResourceUpdateInput
	Replicas *int32 `json:"replicas"`
	PodTemplateUpdateInput
}

type DockerConfig

type DockerConfig struct {
	Graph              string              `json:"graph"`
	RegistryMirrors    []string            `json:"registry-mirrors"`
	InsecureRegistries []string            `json:"insecure-registries"`
	Bridge             string              `json:"bridge"`
	Iptables           bool                `json:"iptables"`
	LiveRestore        bool                `json:"live-restore"`
	ExecOpts           []string            `json:"exec-opts"`
	LogDriver          string              `json:"log-driver"`
	LogOpts            DockerConfigLogOpts `json:"log-opts"`
	StorageDriver      string              `json:"storage-driver,omitempty"`
	StorageOpts        []string            `json:"storage-opts,omitempty"`
}

type DockerConfigJsonSecretCreateInput

type DockerConfigJsonSecretCreateInput struct {
	// required: true
	User string `json:"user"`
	// required: true
	Password string `json:"password"`
	// required: true
	Server string `json:"server"`
	Email  string `json:"email"`
}

type DockerConfigLogOpts

type DockerConfigLogOpts struct {
	MaxSize string `json:"max-size"`
}

type Endpoint

type Endpoint struct {
	// Hostname, either as a domain name or IP address
	Host string `json:"host"`

	// List of ports opened for this endpoint on the hostname
	Ports []ServicePort `json:"ports"`
}

Endpoint describes an endpoint that is host and a list of available ports for that host

type EndpointDetail

type EndpointDetail struct {
	NamespaceResourceDetail

	// Hostname, either as a domain name or IP address.
	Host string `json:"host"`

	// Name of the node the endpoint is located
	NodeName *string `json:"nodeName"`

	// Status of the endpoint
	Ready bool `json:"ready"`

	// Array of endpoint ports
	Ports []v1.EndpointPort `json:"ports"`
}

type EnvVar

type EnvVar struct {
	// Name of the variable.
	Name string `json:"name"`

	// Value of the variable. May be empty if value from is defined.
	Value string `json:"value"`

	// Defined for derived variables. If non-null, the value is get from the reference.
	// Note that this is an API struct. This is intentional, as EnvVarSources are plain struct
	// references.
	ValueFrom *v1.EnvVarSource `json:"valueFrom"`
}

EnvVar represents an environment variable of a container.

type Event

type Event struct {
	ObjectMeta
	TypeMeta

	// A human-readable description of the status of related object.
	Message string `json:"message"`

	// Component from which the event is generated.
	// Deprecated
	SourceComponent string `json:"sourceComponent"`

	// Host name on which the event is generated.
	// Deprecated
	SourceHost string `json:"sourceHost"`

	// Reference to a piece of an object, which triggered an event. For example
	// "spec.containers{name}" refers to container within pod with given name, if no container
	// name is specified, for example "spec.containers[2]", then it refers to container with
	// index 2 in this pod.
	// Deprecated
	SubObject string `json:"object"`

	// The number of times this event has occurred.
	Count int32 `json:"count"`

	// The time at which the event was first recorded.
	FirstSeen metav1.Time `json:"firstSeen"`

	// The time at which the most recent occurrence of this event was recorded.
	LastSeen metav1.Time `json:"lastSeen"`

	// Short, machine understandable string that gives the reason
	// for this event being generated.
	Reason string `json:"reason"`

	// Event type (at the moment only normal and warning are supported).
	Type string `json:"type"`

	// The object that this event is about.
	InvolvedObject v1.ObjectReference `json:"involvedObject"`

	// The component reporting this event. Should be a short machine understandable string.
	Source v1.EventSource `json:"source,omitempty"`

	// Data about the Event series this event represents or nil if it's a singleton Event.
	// +optional
	Series *v1.EventSeries `json:"series,omitempty"`

	// What action was taken/failed regarding to the Regarding object.
	// +optional
	Action string `json:"action,omitempty"`

	// Optional secondary object for more complex actions.
	// +optional
	Related *v1.ObjectReference `json:"related,omitempty"`

	// Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.
	// +optional
	ReportingController string `json:"reportingComponent"`

	// ID of the controller instance, e.g. `kubelet-xyzf`.
	// +optional
	ReportingInstance string `json:"reportingInstance"`
}

Event is a single event representation.

type EventListInput

type EventListInput struct {
	ListInputK8SNamespaceBase
	ListInputOwner
}

type FedClusterRoleBindingClusterListInput

type FedClusterRoleBindingClusterListInput struct {
	FedJointClusterListInput
}

type FedClusterRoleBindingUpdateInput

type FedClusterRoleBindingUpdateInput struct {
	FedResourceUpdateInput
	Spec *FederatedClusterRoleBindingSpec `json:"spec"`
}

func (FedClusterRoleBindingUpdateInput) ToClusterRoleBinding

func (input FedClusterRoleBindingUpdateInput) ToClusterRoleBinding(objMeta metav1.ObjectMeta) *rbac.ClusterRoleBinding

type FedClusterRoleUpdateInput

type FedClusterRoleUpdateInput struct {
	FedResourceUpdateInput
	Spec *FederatedClusterRoleSpec `json:"spec"`
}

func (FedClusterRoleUpdateInput) ToClusterRole

func (input FedClusterRoleUpdateInput) ToClusterRole(objMeta metav1.ObjectMeta) *rbac.ClusterRole

type FedJointClusterListInput

type FedJointClusterListInput struct {
	apis.JointResourceBaseListInput

	FederatedResourceId string `json:"federatedresource_id"`
	ClusterId           string `json:"cluster_id"`
	ClusterName         string `json:"cluster_name"`
	NamespaceId         string `json:"namespace_id"`
	ResourceId          string `json:"resource_id"`
	ResourceName        string `json:"resource_name"`
}

type FedJointClusterResourceDetails

type FedJointClusterResourceDetails struct {
	apis.JointResourceBaseDetails
	Cluster                  string `json:"cluster"`
	FederatedResource        string `json:"federatedresource"`
	FederatedResourceKeyword string `json:"federatedresource_keyword"`
	NamespaceId              string `json:"namespace_id"`
	Namespace                string `json:"namespace"`
	Resource                 string `json:"resource"`
	ResourceKeyword          string `json:"resource_keyword"`
	ResourceStatus           string `json:"resource_status"`
}

type FedNamespaceJointClusterListInput

type FedNamespaceJointClusterListInput struct {
	FedJointClusterListInput
	FederatedNamespaceId string `json:"federatednamespace_id"`
}

type FedNamespaceJointClusterResourceDetails

type FedNamespaceJointClusterResourceDetails struct {
	FedJointClusterResourceDetails
	FederatedNamespace string `json:"federatednamespace"`
}

type FedNamespaceResourceUpdateInput

type FedNamespaceResourceUpdateInput struct {
	FedResourceUpdateInput
}

type FedNamespaceUpdateInput

type FedNamespaceUpdateInput struct {
	FedResourceUpdateInput
	Spec FederatedNamespaceSpec `json:"spec"`
}

func (FedNamespaceUpdateInput) ToNamespace

func (input FedNamespaceUpdateInput) ToNamespace(objMeta metav1.ObjectMeta) *corev1.Namespace

type FedResourceUpdateInput

type FedResourceUpdateInput struct {
	apis.StatusDomainLevelResourceBaseUpdateInput
}

type FedRoleBindingUpdateInput

type FedRoleBindingUpdateInput struct {
	FedNamespaceResourceUpdateInput
	Spec *FederatedRoleBindingSpec `json:"spec"`
}

func (FedRoleBindingUpdateInput) ToRoleBinding

func (input FedRoleBindingUpdateInput) ToRoleBinding(objMeta metav1.ObjectMeta) *rbac.RoleBinding

type FedRoleCreateInput

type FedRoleCreateInput struct {
	FederatedNamespaceResourceCreateInput
	Spec *FederatedRoleSpec `json:"spec"`
}

func (FedRoleCreateInput) ToRole

func (input FedRoleCreateInput) ToRole(namespace string) *rbac.Role

type FedRoleUpdateInput

type FedRoleUpdateInput struct {
	FedNamespaceResourceUpdateInput
	Spec *FederatedRoleSpec `json:"spec"`
}

func (FedRoleUpdateInput) ToRole

func (input FedRoleUpdateInput) ToRole(objMeta metav1.ObjectMeta) *rbac.Role

type FederatedClusterRoleBindingCreateInput

type FederatedClusterRoleBindingCreateInput struct {
	FederatedResourceCreateInput
	Spec *FederatedClusterRoleBindingSpec `json:"spec"`
}

func (FederatedClusterRoleBindingCreateInput) ToClusterRoleBinding

func (input FederatedClusterRoleBindingCreateInput) ToClusterRoleBinding() *rbac.ClusterRoleBinding

type FederatedClusterRoleBindingSpec

type FederatedClusterRoleBindingSpec struct {
	Template ClusterRoleBindingTemplate `json:"template"`
}

func (*FederatedClusterRoleBindingSpec) IsZero

func (spec *FederatedClusterRoleBindingSpec) IsZero() bool

func (*FederatedClusterRoleBindingSpec) String

func (spec *FederatedClusterRoleBindingSpec) String() string

func (FederatedClusterRoleBindingSpec) ToClusterRoleBinding

func (spec FederatedClusterRoleBindingSpec) ToClusterRoleBinding(objMeta metav1.ObjectMeta) *rbac.ClusterRoleBinding

type FederatedClusterRoleClusterListInput

type FederatedClusterRoleClusterListInput struct {
	FedJointClusterListInput
}

type FederatedClusterRoleCreateInput

type FederatedClusterRoleCreateInput struct {
	FederatedResourceCreateInput
	Spec *FederatedClusterRoleSpec `json:"spec"`
}

func (FederatedClusterRoleCreateInput) ToClusterRole

func (input FederatedClusterRoleCreateInput) ToClusterRole() *rbac.ClusterRole

type FederatedClusterRoleSpec

type FederatedClusterRoleSpec struct {
	Template ClusterRoleTemplate `json:"template"`
}

func (*FederatedClusterRoleSpec) IsZero

func (spec *FederatedClusterRoleSpec) IsZero() bool

func (*FederatedClusterRoleSpec) String

func (spec *FederatedClusterRoleSpec) String() string

func (*FederatedClusterRoleSpec) ToClusterRole

func (spec *FederatedClusterRoleSpec) ToClusterRole(objMeta metav1.ObjectMeta) *rbac.ClusterRole

type FederatedJointCluster

type FederatedJointCluster struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type FederatedNamespaceAttachClusterInput

type FederatedNamespaceAttachClusterInput struct {
	FederatedResourceJointClusterInput
}

type FederatedNamespaceClusterDetails

type FederatedNamespaceClusterDetails struct {
	FedJointClusterResourceDetails
}

type FederatedNamespaceClusterListInput

type FederatedNamespaceClusterListInput struct {
	FedJointClusterListInput
}

type FederatedNamespaceCreateInput

type FederatedNamespaceCreateInput struct {
	FederatedResourceCreateInput
	Spec FederatedNamespaceSpec `json:"spec"`
}

func (FederatedNamespaceCreateInput) ToNamespace

func (input FederatedNamespaceCreateInput) ToNamespace() *corev1.Namespace

type FederatedNamespaceDetachClusterInput

type FederatedNamespaceDetachClusterInput struct {
	FederatedResourceJointClusterInput
}

type FederatedNamespaceDetails

type FederatedNamespaceDetails struct {
	FederatedResourceDetails
}

type FederatedNamespaceResourceCreateInput

type FederatedNamespaceResourceCreateInput struct {
	FederatedResourceCreateInput
	FederatednamespaceId string `json:"federatednamespace_id"`
	Federatednamespace   string `json:"-"`
}

func (FederatedNamespaceResourceCreateInput) ToObjectMeta

func (input FederatedNamespaceResourceCreateInput) ToObjectMeta(namespace string) metav1.ObjectMeta

type FederatedNamespaceResourceDetails

type FederatedNamespaceResourceDetails struct {
	FederatedResourceDetails

	Federatednamespace string `json:"federatednamespace"`
}

type FederatedNamespaceResourceListInput

type FederatedNamespaceResourceListInput struct {
	FederatedResourceListInput
	FederatednamespaceId string `json:"federatednamespace_id"`
	// swagger:ignore
	// Deprecated
	Federatednamespace string `json:"federatednamespace" yunion-deprecated-by:"federatednamespace_id"`
}

type FederatedNamespaceSpec

type FederatedNamespaceSpec struct {
	Template NamespaceTemplate `json:"template"`
}

func (*FederatedNamespaceSpec) IsZero

func (spec *FederatedNamespaceSpec) IsZero() bool

func (*FederatedNamespaceSpec) String

func (spec *FederatedNamespaceSpec) String() string

func (*FederatedNamespaceSpec) ToNamespace

func (spec *FederatedNamespaceSpec) ToNamespace(objMeta metav1.ObjectMeta) *corev1.Namespace

type FederatedPlacement

type FederatedPlacement struct {
	Clusters []FederatedJointCluster `json:"clusters"`
}

type FederatedResourceCreateInput

type FederatedResourceCreateInput struct {
	K8sResourceCreateInput
}

type FederatedResourceDetails

type FederatedResourceDetails struct {
	apis.StatusDomainLevelResourceDetails
	Placement    FederatedPlacement `json:"placement"`
	ClusterCount *int               `json:"cluster_count"`
}

type FederatedResourceJointClusterInput

type FederatedResourceJointClusterInput struct {
	apis.Meta
	ClusterId string `json:"cluster_id"`
}

type FederatedResourceListInput

type FederatedResourceListInput struct {
	apis.StatusDomainLevelResourceListInput
}

type FederatedResourceUsedInput

type FederatedResourceUsedInput struct {
	// federated resource keyword, e.g: federatednamespace
	FederatedKeyword    string `json:"federated_keyword"`
	FederatedResourceId string `json:"federatedresource_id"`
	// is used by specify federated resource
	FederatedUsed *bool `json:"federated_used"`
}

func (FederatedResourceUsedInput) ShouldDo

func (input FederatedResourceUsedInput) ShouldDo() bool

type FederatedRoleBindingCreateInput

type FederatedRoleBindingCreateInput struct {
	FederatedNamespaceResourceCreateInput
	Spec *FederatedRoleBindingSpec `json:"spec"`
}

func (FederatedRoleBindingCreateInput) ToRoleBinding

func (input FederatedRoleBindingCreateInput) ToRoleBinding(namespace string) *rbac.RoleBinding

type FederatedRoleBindingSpec

type FederatedRoleBindingSpec struct {
	Template RoleBindingTemplate `json:"template"`
}

func (*FederatedRoleBindingSpec) IsZero

func (spec *FederatedRoleBindingSpec) IsZero() bool

func (*FederatedRoleBindingSpec) String

func (spec *FederatedRoleBindingSpec) String() string

func (*FederatedRoleBindingSpec) ToRoleBinding

func (spec *FederatedRoleBindingSpec) ToRoleBinding(objMeta metav1.ObjectMeta) *rbac.RoleBinding

type FederatedRoleSpec

type FederatedRoleSpec struct {
	Template RoleTemplate `json:"template"`
}

func (*FederatedRoleSpec) IsZero

func (spec *FederatedRoleSpec) IsZero() bool

func (*FederatedRoleSpec) String

func (spec *FederatedRoleSpec) String() string

func (*FederatedRoleSpec) ToRole

func (spec *FederatedRoleSpec) ToRole(objMeta metav1.ObjectMeta) *rbac.Role

type GlobalUsage

type GlobalUsage struct {
	AllUsage     *UsageResult `json:"all"`
	DomainUsage  *UsageResult `json:"domain"`
	ProjectUsage *UsageResult `json:"project"`
}

type HelmValueResource

type HelmValueResource struct {
	CPU    string `json:"cpu"`
	Memory string `json:"memory"`
}

func NewHelmValueResource

func NewHelmValueResource(cpu string, memory string) *HelmValueResource

type HelmValueResources

type HelmValueResources struct {
	Limits   *HelmValueResource `json:"limits"`
	Requests *HelmValueResource `json:"requests"`
}

type HypervisorImage

type HypervisorImage struct {
	Id string
}

type ICluster

type ICluster interface {
	GetId() string
	GetName() string
}

type IClusterRemoteResource

type IClusterRemoteResource interface {
	GetKey() string
}

type INamespaceGetter

type INamespaceGetter interface {
	GetNamespaceName() (string, error)
}

type ImageRepository

type ImageRepository struct {
	// url define cluster image repository url, e.g: registry.hub.docker.com/yunion
	Url string `json:"url"`
	// if insecure, the /etc/docker/daemon.json insecure-registries will add this registry
	Insecure bool `json:"insecure"`
}

type ImportClusterData

type ImportClusterData struct {
	Kubeconfig   string `json:"kubeconfig"`
	ApiServer    string `json:"api_server"`
	Distribution string `json:"distribution"`
	// DistributionInfo should detect by import process
	DistributionInfo ClusterDistributionInfo
}

type Ingress

type Ingress struct {
	ObjectMeta
	TypeMeta

	// External endpoints of this ingress.
	Endpoints []Endpoint `json:"endpoints"`
}

type IngressCreateInputV2

type IngressCreateInputV2 struct {
	NamespaceResourceCreateInput
	extensions.IngressSpec
	StickySession *IngressStickySession `json:"stickySession"`
}

type IngressDetail

type IngressDetail struct {
	Ingress

	// TODO: replace this with UI specific fields.
	// Spec is the desired state of the Ingress.
	Spec extensions.IngressSpec `json:"spec"`

	// Status is the current state of the Ingress.
	Status extensions.IngressStatus `json:"status"`
}

IngressDetail API resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes

type IngressDetailV2

type IngressDetailV2 struct {
	NamespaceResourceDetail
	// External endpoints of this ingress.
	Endpoints []Endpoint `json:"endpoints,allowempty"`

	// TODO: replace this with UI specific fields.
	// Spec is the desired state of the Ingress.
	Spec interface{} `json:"spec"`

	// Status is the current state of the Ingress.
	Status interface{} `json:"status"`
}

type IngressStickySession

type IngressStickySession struct {
	Enabled       bool   `json:"enabled"`
	Name          string `json:"name"`
	CookieExpires uint   `json:"cookieExpires"`
}

type IngressTLS

type IngressTLS struct {
	SecretName string `json:"secretName"`
}

type Job

type Job struct {
	ObjectMeta
	TypeMeta

	// Aggregate information about pods belonging to this Job.
	Pods *PodInfo `json:"podsInfo"`

	// Container images of the Job.
	ContainerImages []ContainerImage `json:"containerImages"`

	// Init Container images of the Job.
	InitContainerImages []ContainerImage `json:"initContainerImages"`

	// number of parallel jobs defined.
	Parallelism *int32 `json:"parallelism"`

	// Completions specifies the desired number of successfully finished pods the job should be run with.
	Completions *int32 `json:"completions"`

	// JobStatus contains inferred job status based on job conditions
	JobStatus JobStatus `json:"jobStatus"`
	Status    string    `json:"status"`
}

Job is a presentation layer view of Kubernetes Job resource. This means it is Job plus additional augmented data we can get from other sources

type JobCreateInput

type JobCreateInput struct {
	K8sNamespaceResourceCreateInput
	batch.JobSpec
}

type JobCreateInputV2

type JobCreateInputV2 struct {
	NamespaceResourceCreateInput
	batch.JobSpec
}

type JobDetail

type JobDetail struct {
	Job

	// Detailed information about Pods belonging to this Job.
	PodList []*Pod `json:"pods"`

	// List of events related to this Job.
	EventList []*Event `json:"events"`
}

JobDetail is a presentation layer view of Kubernetes Job resource. This means it is Job plus additional augmented data we can get from other sources (like services that target the same pods).

type JobDetailV2

type JobDetailV2 struct {
	NamespaceResourceDetail

	// Aggregate information about pods belonging to this Job.
	Pods *PodInfo `json:"podsInfo"`

	// Container images of the Job.
	ContainerImages []ContainerImage `json:"containerImages"`

	// Init Container images of the Job.
	InitContainerImages []ContainerImage `json:"initContainerImages"`

	// number of parallel jobs defined.
	Parallelism *int32 `json:"parallelism"`

	// Completions specifies the desired number of successfully finished pods the job should be run with.
	Completions *int32 `json:"completions"`

	// JobStatus contains inferred job status based on job conditions
	JobStatus JobStatus `json:"jobStatus"`
	Status    string    `json:"status"`
}

type JobListInput

type JobListInput struct {
	ListInputK8SNamespaceBase
	ListInputOwner
	Active *bool `json:"active"`
}

type JobStatus

type JobStatus struct {
	// Short, machine understandable job status code.
	Status JobStatusType `json:"status"`
	// A human-readable description of the status of related job.
	Message string `json:"message"`
}

type JobStatusType

type JobStatusType string
const (
	// JobRunning means the job is still running.
	JobStatusRunning JobStatusType = "Running"
	// JobComplete means the job has completed its execution.
	JobStatusComplete JobStatusType = "Complete"
	// JobFailed means the job has failed its execution.
	JobStatusFailed JobStatusType = "Failed"
)

type K8SBaseResource

type K8SBaseResource struct {
	ObjectMeta `json:"objectMeta"`
	TypeMeta   `json:"typeMeta"`
}

type K8SNamespaceResourceUpdateInput

type K8SNamespaceResourceUpdateInput struct {
	K8sClusterResourceCreateInput
	// required: true
	Namespace string `json:"namespace"`
}

TODO: K8SNamespaceResourceUpdateInput shouldn't contains in body, fix them in url path

type K8sClusterResourceCreateInput

type K8sClusterResourceCreateInput struct {
	// required: true
	Cluster string `json:"cluster"`
	// required: true
	Name        string            `json:"name"`
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
}

func (K8sClusterResourceCreateInput) ToObjectMeta

func (input K8sClusterResourceCreateInput) ToObjectMeta() metav1.ObjectMeta

type K8sClusterResourceGetInput

type K8sClusterResourceGetInput struct {
	// required: true
	Cluster string `json:"cluster"`
}

type K8sLabel

type K8sLabel struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type K8sNamespaceResourceCreateInput

type K8sNamespaceResourceCreateInput struct {
	K8sClusterResourceCreateInput
	// required: true
	Namespace string `json:"namespace"`
}

func (K8sNamespaceResourceCreateInput) ToObjectMeta

func (input K8sNamespaceResourceCreateInput) ToObjectMeta() metav1.ObjectMeta

type K8sNamespaceResourceGetInput

type K8sNamespaceResourceGetInput struct {
	K8sClusterResourceGetInput
	// required: true
	Namespace string `json:"namespace"`
}

type K8sNodeConfig

type K8sNodeConfig struct {
	Labels []*K8sLabel `json:"labels"`
}

type K8sResourceCreateInput

type K8sResourceCreateInput struct {
	apis.StatusDomainLevelResourceCreateInput
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
}

func (K8sResourceCreateInput) ToObjectMeta

func (input K8sResourceCreateInput) ToObjectMeta() metav1.ObjectMeta

type K8sResourceUpdateInput

type K8sResourceUpdateInput struct {
	apis.StatusDomainLevelResourceBaseUpdateInput
}

type KeyPair

type KeyPair struct {
	// base64 encoded cert and key
	Cert []byte `json:"cert"`
	Key  []byte `json:"key"`
}

KeyPair is how operators can supply custom keypairs for kubeadm to use

func (*KeyPair) HasCertAndKey

func (kp *KeyPair) HasCertAndKey() bool

HasCertAndKey returns whether a keypair contains cert and key of non-zero length.

type KindName

type KindName = string
const (
	KindNameConfigMap               KindName = "ConfigMap"
	KindNameDaemonSet               KindName = "DaemonSet"
	KindNameDeployment              KindName = "Deployment"
	KindNameEvent                   KindName = "Event"
	KindNameHorizontalPodAutoscaler KindName = "HorizontalPodAutoscaler"
	KindNameIngress                 KindName = "Ingress"
	KindNameJob                     KindName = "Job"
	KindNameCronJob                 KindName = "CronJob"
	KindNameNamespace               KindName = "Namespace"
	KindNameNode                    KindName = "Node"
	KindNamePersistentVolumeClaim   KindName = "PersistentVolumeClaim"
	KindNamePersistentVolume        KindName = "PersistentVolume"
	KindNamePod                     KindName = "Pod"
	KindNameReplicaSet              KindName = "ReplicaSet"
	KindNameSecret                  KindName = "Secret"
	KindNameService                 KindName = "Service"
	KindNameStatefulSet             KindName = "StatefulSet"
	KindNameEndpoint                KindName = "Endpoints"
	KindNameStorageClass            KindName = "StorageClass"
	KindNameRole                    KindName = "Role"
	KindNameRoleBinding             KindName = "RoleBinding"
	KindNameClusterRole             KindName = "ClusterRole"
	KindNameClusterRoleBinding      KindName = "ClusterRoleBinding"
	KindNameServiceAccount          KindName = "ServiceAccount"
	KindNameLimitRange              KindName = "LimitRange"
	KindNameResourceQuota           KindName = "ResourceQuota"

	// onecloud service operator native kind
	KindNameVirtualMachine          KindName = "VirtualMachine"
	KindNameAnsiblePlaybook         KindName = "AnsiblePlaybook"
	KindNameAnsiblePlaybookTemplate KindName = "AnsiblePlaybookTemplate"
)

type LimitRange

type LimitRange struct {
	ObjectMeta
	TypeMeta
	// v1.LimitRangeSpec
	Limits []*LimitRangeItem `json:"limits"`
}

type LimitRangeDetail

type LimitRangeDetail struct {
	LimitRange
}

type LimitRangeDetailV2

type LimitRangeDetailV2 struct {
	NamespaceResourceDetail
	// v1.LimitRangeSpec
	Limits []*LimitRangeItem `json:"limits"`
}

type LimitRangeItem

type LimitRangeItem struct {
	// ResourceName usage constraints on this kind by resource name
	ResourceName string `json:"resourceName,omitempty"`
	// ResourceType of resource that this limit applies to
	ResourceType string `json:"resourceType,omitempty"`
	// Min usage constraints on this kind by resource name
	Min string `json:"min,omitempty"`
	// Max usage constraints on this kind by resource name
	Max string `json:"max,omitempty"`
	// Default resource requirement limit value by resource name.
	Default string `json:"default,omitempty"`
	// DefaultRequest resource requirement request value by resource name.
	DefaultRequest string `json:"defaultRequest,omitempty"`
	// MaxLimitRequestRatio represents the max burst value for the named resource
	MaxLimitRequestRatio string `json:"maxLimitRequestRatio,omitempty"`
}

LimitRange provides resource limit range values

type ListInputK8SBase

type ListInputK8SBase struct {
	Limit        int64  `json:"limit"`
	Offset       int64  `json:"offset"`
	PagingMarker string `json:"paging_marker"`

	// Name of the field to be ordered by
	OrderBy []string `json:"order_by"`
	// List order, choices 'desc|asc'
	Order string `json:"order"`
	// general filters
	Filter []string `json:"filter"`
	// If true, match if any of the filters matches; otherwise, match if all of the filters match
	FilterAny bool `json:"filter_any"`
}

type ListInputK8SClusterBase

type ListInputK8SClusterBase struct {
	ListInputK8SBase

	Name string `json:"name"`
}

type ListInputK8SNamespaceBase

type ListInputK8SNamespaceBase struct {
	ListInputK8SClusterBase

	Namespace string `json:"namespace"`
}

type ListInputNode

type ListInputNode struct {
	ListInputK8SClusterBase
}

type ListInputOwner

type ListInputOwner struct {
	OwnerKind string `json:"owner_kind"`
	OwnerName string `json:"owner_name"`
}

func (ListInputOwner) ShouldDo

func (input ListInputOwner) ShouldDo() bool

type LocalObjectReference

type LocalObjectReference struct {
	Name string `json:"name,omitempty"`
}

type MachineAttachNetworkAddressInput

type MachineAttachNetworkAddressInput struct {
	// ip_addr specify ip address, e.g. `192.168.0.2`
	IPAddr string `json:"ip_addr"`
}

type MachineCreateConfig

type MachineCreateConfig struct {
	ImageRepository *ImageRepository       `json:"image_repository"`
	DockerConfig    *DockerConfig          `json:"docker_config"`
	Vm              *MachineCreateVMConfig `json:"vm,omitempty"`
}

type MachineCreateVMConfig

type MachineCreateVMConfig struct {
	PreferRegion     string `json:"prefer_region_id"`
	PreferZone       string `json:"prefer_zone_id"`
	PreferWire       string `json:"prefer_wire_id"`
	PreferHost       string `json:"prefer_host_id"`
	PreferBackupHost string `json:"prefer_backup_host"`
	Description      string `json:"description"`

	Disks           []*api.DiskConfig           `json:"disks"`
	Networks        []*api.NetworkConfig        `json:"nets"`
	Schedtags       []*api.SchedtagConfig       `json:"schedtags"`
	IsolatedDevices []*api.IsolatedDeviceConfig `json:"isolated_devices"`

	Hypervisor   string `json:"hypervisor"`
	VmemSize     int    `json:"vmem_size"`
	VcpuCount    int    `json:"vcpu_count"`
	InstanceType string `json:"instance_type"`
	IsSystem     bool   `json:"is_system"`
}

type MachineListInput

type MachineListInput struct {
	apis.VirtualResourceListInput

	// Filter by cluster name or id
	Cluster string `json:"cluster"`
}

type MachinePrepareInput

type MachinePrepareInput struct {
	FirstNode bool   `json:"first_node"`
	Role      string `json:"role"`

	// CAKeyPair           *KeyPair `json:"ca_key_pair"`
	// EtcdCAKeyPair       *KeyPair `json:"etcd_ca_key_pair"`
	// FrontProxyCAKeyPair *KeyPair `json:"front_proxy_ca_key_pair"`
	// SAKeyPair           *KeyPair `json:"sa_key_pair"`
	// BootstrapToken string `json:"bootstrap_token"`
	ELBAddress string `json:"elb_address"`

	Config *MachineCreateConfig `json:"config"`

	InstanceId string `json:"-"`
	PrivateIP  string `json:"-"`
}

type MachineResourceType

type MachineResourceType string

type MemoryUsage

type MemoryUsage struct {
	// memory total capacity
	Capacity int64 `json:"capacity"`
	// memory pods request size
	Request int64 `json:"request"`
	// memory pods limit size
	Limit int64 `json:"limit"`
}

func (*MemoryUsage) Add

func (u *MemoryUsage) Add(ou *MemoryUsage) *MemoryUsage

type ModeType

type ModeType string
const (
	// self build k8s cluster
	ModeTypeSelfBuild ModeType = "customize"
	// public cloud managed k8s cluster
	// ModeTypeManaged ModeType = "managed"
	// imported already exists k8s cluster
	ModeTypeImport ModeType = "import"
)

type Namespace

type Namespace struct {
	ObjectMeta
	TypeMeta

	Phase v1.NamespacePhase `json:"status"`
}

Namespace is a presentation layer view of Kubernetes namespaces. This means it is namespace plus additional augmented data we can get from other sources.

type NamespaceCreateInput

type NamespaceCreateInput struct {
	K8sClusterResourceCreateInput
}

type NamespaceCreateInputV2

type NamespaceCreateInputV2 struct {
	ClusterResourceCreateInput
	Spec *NamespaceSpec `json:"spec"`
}

func (NamespaceCreateInputV2) ToNamespace

func (input NamespaceCreateInputV2) ToNamespace() *v1.Namespace

type NamespaceDetail

type NamespaceDetail struct {
	Namespace

	// Events is list of events associated to the namespace.
	Events []*Event `json:"events"`

	// ResourceQuotaList is list of resource quotas associated to the namespace
	ResourceQuotas []*ResourceQuotaDetail `json:"resourceQuotas"`

	// ResourceLimits is list of limit ranges associated to the namespace
	ResourceLimits []*LimitRange `json:"limitRanges"`
}

NamespaceDetail is a presentation layer view of Kubernetes Namespace resource. This means it is Namespace plus additional augmented data we can get from other sources.

type NamespaceDetailV2

type NamespaceDetailV2 struct {
	ClusterResourceDetail
}

type NamespaceListInput

type NamespaceListInput struct {
	ClusterResourceListInput
}

type NamespaceResourceCreateInput

type NamespaceResourceCreateInput struct {
	ClusterResourceCreateInput

	// required: true
	// 命名空间
	NamespaceId string `json:"namespace_id"`
	// Namespace should set by backend
	// swagger:ignore
	Namespace string `json:"namespace" yunion-deprecated-by:"namespace_id"`
}

func (NamespaceResourceCreateInput) ToObjectMeta

type NamespaceResourceDetail

type NamespaceResourceDetail struct {
	ClusterResourceDetail

	NamespaceId string `json:"namespace_id"`
	Namespace   string `json:"namespace"`

	NamespaceLabels map[string]string `json:"namespace_labels"`
}

type NamespaceResourceListInput

type NamespaceResourceListInput struct {
	ClusterResourceListInput
	// 命名空间
	Namespace string `json:"namespace"`
}

type NamespaceResourceUpdateInput

type NamespaceResourceUpdateInput struct {
	ClusterResourceUpdateInput
}

type NamespaceSpec

type NamespaceSpec struct {
	v1.NamespaceSpec
}

type NamespaceTemplate

type NamespaceTemplate struct {
	Spec corev1.NamespaceSpec `json:"spec"`
}

type NetworkConfig

type NetworkConfig struct {
	Network string `json:"network"`
	Address string `json:"address"`
}

func (NetworkConfig) ToPodAnnotation

func (n NetworkConfig) ToPodAnnotation() map[string]string

type Node

type Node struct {
	ObjectMeta
	TypeMeta
	Ready              bool                   `json:"ready"`
	AllocatedResources NodeAllocatedResources `json:"allocatedResources"`
	// Addresses is a list of addresses reachable to the node. Queried from cloud provider, if available.
	Address []v1.NodeAddress `json:"addresses,omitempty"`
	// Set of ids/uuids to uniquely identify the node.
	NodeInfo v1.NodeSystemInfo `json:"nodeInfo"`
	// Taints
	Taints []v1.Taint `json:"taints,omitempty"`
	// Unschedulable controls node schedulability of new pods. By default node is schedulable.
	Unschedulable bool `json:"unschedulable"`
}

Node is a presentation layer view of Kubernetes nodes. This means it is node plus additional augmented data we can get from other sources.

type NodeAllocatedResources

type NodeAllocatedResources struct {
	// CPURequests is number of allocated milicores.
	CPURequests int64 `json:"cpuRequests"`

	// CPURequestsFraction is a fraction of CPU, that is allocated.
	CPURequestsFraction float64 `json:"cpuRequestsFraction"`

	// CPULimits is defined CPU limit.
	CPULimits int64 `json:"cpuLimits"`

	// CPULimitsFraction is a fraction of defined CPU limit, can be over 100%, i.e.
	// overcommitted.
	CPULimitsFraction float64 `json:"cpuLimitsFraction"`

	// CPUCapacity is specified node CPU capacity in milicores.
	CPUCapacity int64 `json:"cpuCapacity"`

	// MemoryRequests is a fraction of memory, that is allocated.
	MemoryRequests int64 `json:"memoryRequests"`

	// MemoryRequestsFraction is a fraction of memory, that is allocated.
	MemoryRequestsFraction float64 `json:"memoryRequestsFraction"`

	// MemoryLimits is defined memory limit.
	MemoryLimits int64 `json:"memoryLimits"`

	// MemoryLimitsFraction is a fraction of defined memory limit, can be over 100%, i.e.
	// overcommitted.
	MemoryLimitsFraction float64 `json:"memoryLimitsFraction"`

	// MemoryCapacity is specified node memory capacity in bytes.
	MemoryCapacity int64 `json:"memoryCapacity"`

	// AllocatedPods in number of currently allocated pods on the node.
	AllocatedPods int `json:"allocatedPods"`

	// PodCapacity is maximum number of pods, that can be allocated on the node.
	PodCapacity int64 `json:"podCapacity"`

	// PodFraction is a fraction of pods, that can be allocated on given node.
	PodFraction float64 `json:"podFraction"`
}

NodeAllocatedResources describes node allocated resources.

type NodeCreateInput

type NodeCreateInput struct {
	ClusterResourceCreateInput
}

type NodeDetail

type NodeDetail struct {
	Node

	// NodePhase is the current lifecycle phase of the node.
	Phase v1.NodePhase `json:"status"`

	// PodCIDR represents the pod IP range assigned to the node.
	PodCIDR string `json:"podCIDR"`

	// ID of the node assigned by the cloud provider.
	ProviderID string `json:"providerID"`

	// Conditions is an array of current node conditions.
	Conditions []*Condition `json:"conditions"`

	// Container images of the node.
	ContainerImages []string `json:"containerImages"`

	// PodList contains information about pods belonging to this node.
	PodList []*Pod `json:"pods"`

	// Events is list of events associated to the node.
	EventList []*Event `json:"events"`
}

NodeDetail is a presentation layer view of Kubernetes Node resource. This means it is Node plus additional augmented data we can get from other sources.

type NodeDetailV2

type NodeDetailV2 struct {
	ClusterResourceDetail
	Ready              bool                   `json:"ready"`
	AllocatedResources NodeAllocatedResources `json:"allocatedResources"`
	// Addresses is a list of addresses reachable to the node. Queried from cloud provider, if available.
	Address []v1.NodeAddress `json:"addresses,omitempty"`
	// Set of ids/uuids to uniquely identify the node.
	NodeInfo v1.NodeSystemInfo `json:"nodeInfo"`
	// Taints
	Taints []v1.Taint `json:"taints,omitempty"`
	// Unschedulable controls node schedulability of new pods. By default node is schedulable.
	Unschedulable bool `json:"unschedulable"`

	// NodeDetail extra fields
	// NodePhase is the current lifecycle phase of the node.
	Phase v1.NodePhase `json:"status"`

	// PodCIDR represents the pod IP range assigned to the node.
	PodCIDR string `json:"podCIDR"`

	// ID of the node assigned by the cloud provider.
	ProviderID string `json:"providerID"`

	// Conditions is an array of current node conditions.
	Conditions []*Condition `json:"conditions"`

	// Container images of the node.
	ContainerImages []string `json:"containerImages"`

	// PodList contains information about pods belonging to this node.
	Pods []*Pod `json:"pods"`

	// Events is list of events associated to the node.
	Events []*Event `json:"events"`
}

type NodeListInput

type NodeListInput struct {
	ClusterResourceListInput
}

type NodeUsage

type NodeUsage struct {
	// node memory usage
	Memory *MemoryUsage `json:"memory"`
	// node cpu usage
	Cpu *CpuUsage `json:"cpu"`
	// node pod usage
	Pod *PodUsage `json:"pod"`
	// node count
	Count int64 `json:"count"`
	// node ready count
	ReadyCount int64 `json:"ready_count"`
	// node not ready count
	NotReadyCount int64 `json:"not_ready_count"`
}

func NewNodeUsage

func NewNodeUsage() *NodeUsage

func (*NodeUsage) Add

func (u *NodeUsage) Add(ou *NodeUsage) *NodeUsage

type ObjectMeta

type ObjectMeta struct {
	// kubernetes object meta
	metav1.ObjectMeta
	// onecloud cluster meta info
	*ClusterMeta
}

ObjectMeta is metadata about an instance of a resource.

func NewObjectMeta

func NewObjectMeta(k8SObjectMeta metav1.ObjectMeta, cluster ICluster) ObjectMeta

NewObjectMeta returns internal endpoint name for the given service properties, e.g., NewObjectMeta creates a new instance of ObjectMeta struct based on K8s object meta.

func (ObjectMeta) GetName

func (m ObjectMeta) GetName() string

type ObjectStoreConfig

type ObjectStoreConfig struct {
	// bucket name, e.g. `thanos`
	Bucket string `json:"bucket"`
	// s3 endpoint, e.g. `minio-test.default:9000`
	Endpoint string `json:"endpoint"`
	// access key to auth
	AccessKey string `json:"access_key"`
	// secret key to auth
	SecretKey string `json:"secret_key"`
	// is insecure connection
	Insecure bool `json:"insecure"`
}

type ObjectTypeMeta

type ObjectTypeMeta struct {
	ObjectMeta
	TypeMeta
}

func (*ObjectTypeMeta) SetObjectMeta

func (m *ObjectTypeMeta) SetObjectMeta(meta ObjectMeta) *ObjectTypeMeta

func (*ObjectTypeMeta) SetTypeMeta

func (m *ObjectTypeMeta) SetTypeMeta(meta TypeMeta) *ObjectTypeMeta

type OnecloudExternalInfoBase

type OnecloudExternalInfoBase struct {
	// Id is resource cloud resource id
	Id string `json:"id"`
	// Status is resource cloud status
	Status string `json:"status"`
	// Action indicate the latest action for external vm
	Action string `json:"action"`
	// Eip is elastic ip address
	Eip string `json:"eip,omitempty"`
}

type OptionalNames

type OptionalNames []string

func (OptionalNames) String

func (t OptionalNames) String() string

type PersistentVolume

type PersistentVolume struct {
	ObjectMeta
	TypeMeta
	Capacity      v1.ResourceList                  `json:"capacity"`
	AccessModes   []v1.PersistentVolumeAccessMode  `json:"accessModes"`
	ReclaimPolicy v1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy"`
	StorageClass  string                           `json:"storageClass"`
	Status        v1.PersistentVolumePhase         `json:"status"`
	Claim         string                           `json:"claim"`
	Reason        string                           `json:"reason"`
	Message       string                           `json:"message"`
}

PersistentVolume provides the simplified presentation layer view of Kubernetes Persistent Volume resource.

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	ObjectMeta
	TypeMeta
	Status       string                          `json:"status"`
	Volume       string                          `json:"volume"`
	Capacity     v1.ResourceList                 `json:"capacity"`
	AccessModes  []v1.PersistentVolumeAccessMode `json:"accessModes"`
	StorageClass *string                         `json:"storageClass"`
	// Deprecated
	MountedBy []string `json:"mountedBy"`
}

PersistentVolumeClaim provides the simplified presentation layer view of Kubernetes Persistent Volume Claim resource.

type PersistentVolumeClaimCreateInput

type PersistentVolumeClaimCreateInput struct {
	NamespaceResourceCreateInput
	Size         string `json:"size"`
	StorageClass string `json:"storageClass"`
}

type PersistentVolumeClaimDetail

type PersistentVolumeClaimDetail struct {
	NamespaceResourceDetail
	Status       string                          `json:"status"`
	Volume       string                          `json:"volume"`
	Capacity     v1.ResourceList                 `json:"capacity"`
	CapacityMb   int                             `json:"capacity_mb"`
	AccessModes  []v1.PersistentVolumeAccessMode `json:"accessModes"`
	StorageClass *string                         `json:"storageClass"`
	MountedBy    []string                        `json:"mountedBy"`
}

PersistentVolumeClaimDetail provides the presentation layer view of Kubernetes Persistent Volume Claim resource.

type PersistentVolumeClaimListInput

type PersistentVolumeClaimListInput struct {
	NamespaceResourceListInput

	Unused *bool `json:"unused"`
}

type PersistentVolumeDetail

type PersistentVolumeDetail struct {
	PersistentVolume
	PersistentVolumeSource v1.PersistentVolumeSource `json:"persistentVolumeSource"`
	PersistentVolumeClaim  *PersistentVolumeClaim    `json:"persistentVolumeClaim"`
}

PersistentVolumeDetail provides the presentation layer view of Kubernetes Persistent Volume resource.

type PersistentVolumeDetailV2

type PersistentVolumeDetailV2 struct {
	ClusterResourceDetail
	Capacity               v1.ResourceList                  `json:"capacity"`
	AccessModes            []v1.PersistentVolumeAccessMode  `json:"accessModes"`
	ReclaimPolicy          v1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy"`
	StorageClass           string                           `json:"storageClass"`
	Status                 v1.PersistentVolumePhase         `json:"status"`
	Claim                  string                           `json:"claim"`
	Reason                 string                           `json:"reason"`
	Message                string                           `json:"message"`
	PersistentVolumeSource v1.PersistentVolumeSource        `json:"persistentVolumeSource"`
}

type Pod

type Pod struct {
	ObjectMeta
	TypeMeta

	// More info on pod status
	PodStatus

	PodIP string `json:"podIP"`
	// Count of containers restarts
	RestartCount int32 `json:"restartCount"`

	// Pod warning events
	Warnings []*Event `json:"warnings"`

	QOSClass       string      `json:"qosClass"`
	Containers     []Container `json:"containers"`
	InitContainers []Container `json:"initContainers"`

	// Container images of the Deployment
	ContainerImages []ContainerImage `json:"containerImages"`
	// Init Container images of deployment
	InitContainerImages []ContainerImage `json:"initContainerImages"`
}

Pod is a presentation layer view of Pod resource. This means it is Pod plus additional augmented data we can get from other sources (like services that target it).

type PodDetail

type PodDetail struct {
	Pod
	Conditions             []*Condition             `json:"conditions"`
	Events                 []*Event                 `json:"events"`
	Persistentvolumeclaims []*PersistentVolumeClaim `json:"persistentVolumeClaims"`
	ConfigMaps             []*ConfigMap             `json:"configMaps"`
	Secrets                []*Secret                `json:"secrets"`
}

type PodDetailV2

type PodDetailV2 struct {
	NamespaceResourceDetail

	// More info on pod status
	PodStatus
	PodIP string `json:"podIP"`
	// Count of containers restarts
	RestartCount int32 `json:"restartCount"`
	// Pod warning events
	Warnings       []*Event    `json:"warnings"`
	QOSClass       string      `json:"qosClass"`
	Containers     []Container `json:"containers"`
	InitContainers []Container `json:"initContainers"`
	// Container images of the Deployment
	ContainerImages []ContainerImage `json:"containerImages"`
	// Init Container images of deployment
	InitContainerImages []ContainerImage `json:"initContainerImages"`
	Conditions          []*Condition     `json:"conditions"`
}

type PodInfo

type PodInfo struct {
	// Number of pods that are created.
	Current int32 `json:"current"`

	// Number of pods that are desired.
	Desired *int32 `json:"desired,omitempty"`

	// Number of pods that are currently running.
	Running int32 `json:"running"`

	// Number of pods that are currently waiting.
	Pending int32 `json:"pending"`

	// Number of pods that are failed.
	Failed int32 `json:"failed"`

	// Number of pods that are succeeded.
	Succeeded int32 `json:"succeeded"`

	// Unique warning messages related to pods in this resource.
	Warnings []Event `json:"warnings"`
}

PodInfo represents aggregate information about controller's pods.

func (PodInfo) GetStatus

func (info PodInfo) GetStatus() string

type PodListInput

type PodListInput struct {
	NamespaceResourceListInput
	ListInputOwner
}

type PodStatus

type PodStatus struct {
	PodStatusV2

	PodPhase        v1.PodPhase         `json:"podPhase"`
	ContainerStates []v1.ContainerState `json:"containerStates"`
}

type PodStatusV2

type PodStatusV2 struct {
	// The aggregate readiness state of this pod for accepting traffic.
	Ready string `json:"ready"`
	// The aggregate status of the containers in this pod.
	Status string `json:"status"`
	// The number of times the containers in this pod have been restarted.
	Restarts int64 `json:"restarts"`
	// Name of the Node this pod runs on
	NodeName string `json:"nodeName"`
	// NominatedNodeName is set only when this pod preempts other pods on the node,
	// but it cannot be scheduled right away as preemption victims receive their graceful termination periods.
	// This field does not guarantee that the pod will be scheduled on this node.
	// Scheduler may decide to place the pod elsewhere if other nodes become available sooner.
	// Scheduler may also decide to give the resources on this node to a higher priority pod that is created after preemption.
	// As a result, this field may be different than PodSpec.nodeName when the pod is scheduled.
	NominatedNodeName string `json:"nominatedNodeName"`
	// If specified, all readiness gates will be evaluated for pod readiness.
	// A pod is ready when all its containers are ready AND all conditions specified
	// in the readiness gates have status equal to \"True\"
	// More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md
	ReadinessGates string `json:"readinessGates"`
}

type PodTemplateUpdateInput

type PodTemplateUpdateInput struct {
	InitContainers []ContainerUpdateInput `json:"initContainers,omitempty"`
	Containers     []ContainerUpdateInput `json:"containers,omitempty"`
	RestartPolicy  v1.RestartPolicy       `json:"restartPolicy,omitempty"`
	DNSPolicy      v1.DNSPolicy           `json:"dnsPolicy,omitempty"`
}

type PodUsage

type PodUsage struct {
	// pod creatable count capacity
	Capacity int64 `json:"capacity"`
	// pod used total count
	Count int64 `json:"count"`
}

func (*PodUsage) Add

func (u *PodUsage) Add(ou *PodUsage) *PodUsage

type PortMapping

type PortMapping struct {
	// Port that will be exposed on the service.
	Port int32 `json:"port"`

	// Number of the port to access on the pods targeted by the service.
	// Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
	TargetPort int32 `json:"targetPort"`

	// The port on each node on which this service is exposed when type=NodePort or LoadBalancer.
	// Usually assigned by the system. If specified, it will be allocated to the service
	// if unused or else creation of the service will fail.
	// Default is to auto-allocate a port if the ServiceType of this Service requires one.
	// More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
	NodePort int32 `json:"nodePort"`

	// IP protocol for the mapping, e.g., "TCP" or "UDP".
	Protocol v1.Protocol `json:"protocol"`
}

PortMapping is a specification of port mapping for an application deployment.

func (PortMapping) ToServicePort

func (p PortMapping) ToServicePort() v1.ServicePort

type ProviderType

type ProviderType string
const (
	// system provider type means default v3 supervisor cluster
	ProviderTypeSystem ProviderType = "system"
	// default provider type by onecloud
	ProviderTypeOnecloud    ProviderType = "onecloud"
	ProviderTypeOnecloudKvm ProviderType = "kvm"
	// AWS provider
	ProviderTypeAws ProviderType = "aws"
	// Alibaba cloud provider
	ProviderTypeAliyun ProviderType = "aliyun"
	// Azure provider
	ProviderTypeAzure ProviderType = "azure"
	// Tencent cloud provider
	ProviderTypeQcloud ProviderType = "qcloud"
	// External provider type by import
	ProviderTypeExternal ProviderType = "external"
)

type Release

type Release struct {
	*release.Release
	*ClusterMeta
	Status     string            `json:"status"`
	PodsStatus map[string]string `json:"pods_status"`
}

type ReleaseCreateInput

type ReleaseCreateInput struct {
	NamespaceResourceCreateInput
	Repo string `json:"repo"`
	// Deprecated, use Chart and Repo
	ChartName string `json:"chart_name"`
	Chart     string `json:"chart"`
	// Deprecated, use name
	ReleaseName string `json:"release_name"`
	Version     string `json:"version"`
	// Values is yaml config content
	Values     string               `json:"values"`
	Sets       map[string]string    `json:"sets"`
	ValuesJson jsonutils.JSONObject `json:"values_json"`
	// Project only works for internal release
	Project string `json:"project"`
}

type ReleaseDetail

type ReleaseDetail struct {
	Release
	Resources map[string][]interface{} `json:"resources"`
	Files     []*chart.File            `json:"files"`
}

type ReleaseDetailV2

type ReleaseDetailV2 struct {
	ReleaseV2
	Type      RepoType                 `json:"type"`
	Resources map[string][]interface{} `json:"resources"`
	Files     []*chart.File            `json:"files"`
}

type ReleaseHistoryInfo

type ReleaseHistoryInfo struct {
	Revision    int       `json:"revision"`
	Updated     time.Time `json:"updated"`
	Status      string    `json:"status"`
	Chart       string    `json:"chart"`
	Description string    `json:"description"`
}

type ReleaseHistoryInput

type ReleaseHistoryInput struct {
	Max int `json:"max"`
}

type ReleaseListInputV2

type ReleaseListInputV2 struct {
	NamespaceResourceListInput
	// Release type
	// enum: internal, external
	Type string `json:"type"`
}

type ReleaseListQuery

type ReleaseListQuery struct {
	Filter       string `json:"filter"`
	All          bool   `json:"all"`
	AllNamespace bool   `json:"all_namespace"`
	Namespace    string `json:"namespace"`
	Admin        bool   `json:"admin"`
	Deployed     bool   `json:"deployed"`
	Deleted      bool   `json:"deleted"`
	Deleting     bool   `json:"deleting"`
	Failed       bool   `json:"failed"`
	Superseded   bool   `json:"superseded"`
	Pending      bool   `json:"pending"`
}

type ReleaseRollbackInput

type ReleaseRollbackInput struct {
	Revision    int    `json:"revision"`
	Description string `json:"description"`
	// will (if true) recreate pods after a rollback.
	Recreate bool `json:"recreate"`
	// will (if true) force resource upgrade through uninstall/recreate if needed
	Force bool `json:"force"`
}

type ReleaseUpdateInput

type ReleaseUpdateInput struct {
	ReleaseCreateInput
	RecreatePods bool `json:"recreate_pods"`
	// force resource updates through a replacement strategy
	Force bool `json:"force"`
	// when upgrading, reset the values to the ones built into the chart
	ResetValues bool `json:"reset_values"`
	// when upgrading, reuse the last release's values and merge in any overrides, if reset_values is specified, this is ignored
	ReUseValues bool `json:"reuse_values"`
}

type ReleaseV2

type ReleaseV2 struct {
	NamespaceResourceDetail
	// Info provides information about a release
	Info *release.Info `json:"info,omitempty"`
	// Chart is the chart that was released.
	Chart *chart.Chart `json:"chart,omitempty"`
	// Config is the set of extra Values added to the chart.
	// These values override the default values inside of the chart.
	Config map[string]interface{} `json:"config,omitempty"`
	// Manifest is the string representation of the rendered template.
	Manifest string `json:"manifest,omitempty"`
	// Hooks are all of the hooks declared for this release.
	Hooks []*release.Hook `json:"hooks,omitempty"`
	// Version is an int which represents the version of the release.
	Version int `json:"version,omitempty"`

	PodsStatus map[string]string `json:"pods_status,omitempty"`
}

type ReplicaSet

type ReplicaSet struct {
	ObjectMeta
	TypeMeta

	// Aggregate information about pods belonging to this Replica Set.
	Pods PodInfo `json:"pods"`

	// Container images of the Replica Set.
	ContainerImages []ContainerImage `json:"containerImages"`

	// Init Container images of the Replica Set.
	InitContainerImages []ContainerImage `json:"initContainerImages"`
}

ReplicaSet is a presentation layer view of Kubernetes Replica Set resource. This means it is Replica Set plus additional augmented data we can get from other sources (like services that target the same pods).

type ReplicaSetDetail

type ReplicaSetDetail struct {
	NamespaceResourceDetail

	// Aggregate information about pods belonging to this Replica Set.
	Pods PodInfo `json:"pods"`

	// Container images of the Replica Set.
	ContainerImages []ContainerImage `json:"containerImages"`

	// Init Container images of the Replica Set.
	InitContainerImages []ContainerImage `json:"initContainerImages"`
}

type RepoBackend

type RepoBackend string

type RepoCreateInput

type RepoCreateInput struct {
	apis.StatusInfrasResourceBaseCreateInput

	// Repo URL
	// required: true
	// example: http://mirror.azure.cn/kubernetes/charts
	Url string `json:"url"`

	// Repo username
	// required: false
	Username string `json:"username"`

	// Repo password
	Password string `json:"password"`

	// Repo type
	// enum: internal, external
	Type string `json:"type"`

	// Repo backend
	// enum: common, nexus
	Backend RepoBackend `json:"backend"`
}

type RepoDetail

type RepoDetail struct {
	apis.StatusInfrasResourceBaseDetails

	Url          string `json:"url"`
	Type         string `json:"type"`
	ReleaseCount int    `json:"release_count"`
}

type RepoDownloadChartInput

type RepoDownloadChartInput struct {
	ChartName string `json:"chart_name"`
	Version   string `json:"version"`
}

type RepoListInput

type RepoListInput struct {
	apis.StatusInfrasResourceBaseListInput

	Type string `json:"type"`
	Url  string `json:"url"`
}

type RepoType

type RepoType string
const (
	RepoTypeInternal RepoType = "internal"
	RepoTypeExternal RepoType = "external"
)

type ResourceQuota

type ResourceQuota struct {
	ObjectMeta
	TypeMeta

	v1.ResourceQuotaSpec
}

type ResourceQuotaDetail

type ResourceQuotaDetail struct {
	ResourceQuota

	// StatusList is a set of (resource name, Used, Hard) tuple.
	StatusList map[v1.ResourceName]ResourceStatus `json:"statuses,omitempty"`
}

ResourceQuotaDetail provides the presentation layer view of Kubernetes Resource Quotas resource.

type ResourceQuotaDetailV2

type ResourceQuotaDetailV2 struct {
	NamespaceResourceDetail
	v1.ResourceQuotaSpec

	// StatusList is a set of (resource name, Used, Hard) tuple.
	StatusList map[v1.ResourceName]ResourceStatus `json:"statuses,omitempty"`
}

type ResourceStatus

type ResourceStatus struct {
	Used string `json:"used,omitempty"`
	Hard string `json:"hard,omitempty"`
}

ResourceStatus provides the status of the resource defined by a resource quota.

type RoleBindingCreateInput

type RoleBindingCreateInput struct {
	NamespaceResourceCreateInput
	// Subjects holds references to the objects the role applies to.
	// +optional
	Subjects Subjects `json:"subjects,omitempty"`
	// RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace.
	// If the RoleRef cannot be resolved, the Authorizer must return an error.
	RoleRef RoleRef `json:"roleRef"`
}

func (RoleBindingCreateInput) ToRoleBinding

func (rb RoleBindingCreateInput) ToRoleBinding(namespaceName string) (*rbac.RoleBinding, error)

type RoleBindingDetail

type RoleBindingDetail struct {
	NamespaceResourceDetail

	Subjects []rbac.Subject `json:"subjects,omitempty"`

	RoleRef rbac.RoleRef `json:"roleRef"`
}

type RoleBindingTemplate

type RoleBindingTemplate struct {
	Subjects []rbac.Subject `json:"subjects,omitempty"`
	RoleRef  rbac.RoleRef   `json:"roleRef"`
}

type RoleBindingUpdateInput

type RoleBindingUpdateInput struct {
	NamespaceResourceUpdateInput
	Subjects Subjects `json:"subjects,omitempty"`
	RoleRef  RoleRef  `json:"roleRef"`
}

type RoleCreateInput

type RoleCreateInput struct {
	NamespaceResourceCreateInput
	Rules []rbac.PolicyRule `json:"rules"`
}

func (RoleCreateInput) ToRole

func (input RoleCreateInput) ToRole(namespaceName string) (*rbac.Role, error)

type RoleDetail

type RoleDetail struct {
	NamespaceResourceDetail
	Rules []rbac.PolicyRule `json:"rules"`
}

type RoleRef

type RoleRef rbac.RoleRef

func (*RoleRef) IsZero

func (rf *RoleRef) IsZero() bool

func (*RoleRef) String

func (rf *RoleRef) String() string

type RoleTemplate

type RoleTemplate struct {
	Rules []rbac.PolicyRule `json:"rules"`
}

type RoleType

type RoleType string

type RoleUpdateInput

type RoleUpdateInput struct {
	NamespaceResourceUpdateInput
	Rules []rbac.PolicyRule `json:"rules"`
}

type RollingUpdateStrategy

type RollingUpdateStrategy struct {
	MaxSurge       *intstr.IntOrString `json:"maxSurge"`
	MaxUnavailable *intstr.IntOrString `json:"maxUnavailable"`
}

RollingUpdateStrategy is behavior of a rolling update. See RollingUpdateDeployment K8s object.

type Secret

type Secret struct {
	ObjectMeta
	TypeMeta
	Type v1.SecretType `json:"type"`
}

Secret is a single secret returned to the frontend.

type SecretCreateInput

type SecretCreateInput struct {
	NamespaceResourceCreateInput
	Type             v1.SecretType                      `json:"type"`
	DockerConfigJson *DockerConfigJsonSecretCreateInput `json:"dockerConfigJson"`
	CephCSI          *CephCSISecretCreateInput          `json:"cephCSI"`
}

type SecretDetail

type SecretDetail struct {
	Secret

	// Data contains the secret data.  Each key must be a valid DNS_SUBDOMAIN
	// or leading dot followed by valid DNS_SUBDOMAIN.
	// The serialized form of the secret data is a base64 encoded string,
	// representing the arbitrary (possibly non-string) data value here.
	Data map[string][]byte `json:"data"`
}

SecretDetail API resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes

type SecretDetailV2

type SecretDetailV2 struct {
	NamespaceResourceDetail
	Type v1.SecretType `json:"type"`
	// Data contains the secret data.  Each key must be a valid DNS_SUBDOMAIN
	// or leading dot followed by valid DNS_SUBDOMAIN.
	// The serialized form of the secret data is a base64 encoded string,
	// representing the arbitrary (possibly non-string) data value here.
	Data map[string][]byte `json:"data"`
}

type SecretListInput

type SecretListInput struct {
	NamespaceResourceListInput
	Type string `json:"type"`
}

type Service

type Service struct {
	ObjectMeta
	TypeMeta

	// InternalEndpoint of all kubernetes services that have the same label selector as connected Replication
	// Controller. Endpoint is DNS name merged with ports
	InternalEndpoint Endpoint `json:"internalEndpoint"`

	// ExternalEndpoints of all kubernetes services that have the same label selector as connected Replication
	// Controller. Endpoint is DNS name merged with ports
	ExternalEndpoints []Endpoint `json:"externalEndpoints"`

	// Label selector of the service
	Selector map[string]string `json:"selector"`

	// Type determines how the service will be exposed. Valid options: ClusterIP, NodePort, LoadBalancer
	Type v1.ServiceType `json:"type"`

	// ClusterIP is usually assigned by the master. Valid values are None, empty string (""), or
	// a valid IP address. None can be specified for headless services when proxying is not required
	ClusterIP string `json:"clusterIP"`
}

type ServiceAccountDetail

type ServiceAccountDetail struct {
	NamespaceResourceDetail
	// Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount.
	// More info: https://kubernetes.io/docs/concepts/configuration/secret
	// +optional
	// +patchMergeKey=name
	// +patchStrategy=merge
	Secrets []v1.ObjectReference `json:"secrets,omitempty"`

	// ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images
	// in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets
	// can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet.
	// More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
	// +optional
	ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted.
	// Can be overridden at the pod level.
	// +optional
	AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`
}

type ServiceCreateInput

type ServiceCreateInput struct {
	NamespaceResourceCreateInput
	ServiceCreateOption
}

type ServiceCreateOption

type ServiceCreateOption struct {
	Type                string            `json:"type"`
	IsExternal          bool              `json:"isExternal"`
	PortMappings        []PortMapping     `json:"portMappings"`
	Selector            map[string]string `json:"selector"`
	LoadBalancerCluster string            `json:"loadBalancerCluster"`
	LoadBalancerNetwork string            `json:"loadBalancerNetwork"`
	LoadBalancerAddress string            `json:"loadBalancerAddress`
}

type ServiceDetail

type ServiceDetail struct {
	Service

	// List of Endpoint obj. that are endpoints of this Service.
	Endpoints []*EndpointDetail `json:"endpoints"`

	// List of events related to this Service
	Events []*Event `json:"events"`

	// Pods represents list of pods targeted by same label selector as this service.
	Pods []*Pod `json:"pods"`

	// Show the value of the SessionAffinity of the Service.
	SessionAffinity v1.ServiceAffinity `json:"sessionAffinity"`
}

type ServiceDetailV2

type ServiceDetailV2 struct {
	NamespaceResourceDetail

	// InternalEndpoint of all kubernetes services that have the same label selector as connected Replication
	// Controller. Endpoint is DNS name merged with ports
	InternalEndpoint Endpoint `json:"internalEndpoint"`

	// ExternalEndpoints of all kubernetes services that have the same label selector as connected Replication
	// Controller. Endpoint is DNS name merged with ports
	ExternalEndpoints []Endpoint `json:"externalEndpoints"`

	// Label selector of the service
	Selector map[string]string `json:"selector"`

	// Type determines how the service will be exposed. Valid options: ClusterIP, NodePort, LoadBalancer
	Type v1.ServiceType `json:"type"`

	// ClusterIP is usually assigned by the master. Valid values are None, empty string (""), or
	// a valid IP address. None can be specified for headless services when proxying is not required
	ClusterIP string `json:"clusterIP"`

	// Pods represents list of pods targeted by same label selector as this service.
	Pods []*PodDetailV2 `json:"pods"`

	// Show the value of the SessionAffinity of the Service.
	SessionAffinity v1.ServiceAffinity `json:"sessionAffinity"`
}

type ServiceListInput

type ServiceListInput struct {
	ListInputK8SNamespaceBase
	ListInputOwner
}

type ServicePort

type ServicePort struct {
	// Positive port number.
	Port int32 `json:"port"`

	// Protocol name, e.g., TCP or UDP.
	Protocol v1.Protocol `json:"protocol"`

	// The port on each node on which service is exposed.
	NodePort int32 `json:"nodePort"`
}

ServicePort is a pair of port and protocol, e.g. a service endpoint.

func GetServicePorts

func GetServicePorts(apiPorts []v1.ServicePort) []ServicePort

GetServicePorts returns human readable name for the given service ports list.

type SpotguideFile

type SpotguideFile struct {
	Options []SpotguideOptions `json:"options"`
}

type SpotguideOptions

type SpotguideOptions struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Default bool   `json:"default"`
	Info    string `json:"info"`
	Key     string `json:"key"`
}

type StatefulSet

type StatefulSet struct {
	ObjectMeta
	TypeMeta

	// Aggregate information about pods belonging to this Pet Set.
	Pods PodInfo `json:"podsInfo"`

	Replicas *int32 `json:"replicas"`

	// Container images of the Stateful Set.
	ContainerImages []ContainerImage `json:"containerImages"`

	// Init container images of the Stateful Set.
	InitContainerImages []ContainerImage  `json:"initContainerImages"`
	Selector            map[string]string `json:"selector"`

	StatefulSetStatus
}

StatefulSet is a presentation layer view of Kubernetes Stateful Set resource. This means it is Stateful Set plus additional augmented data we can get from other sources (like services that target the same pods).

type StatefulSetDetail

type StatefulSetDetail struct {
	StatefulSet
	PodList  []*Pod     `json:"pods"`
	Events   []*Event   `json:"events"`
	Services []*Service `json:"services"`
}

StatefulSetDetail is a presentation layer view of Kubernetes Stateful Set resource. This means it is Stateful Set plus additional augmented data we can get from other sources (like services that target the same pods).

type StatefulSetDetailV2

type StatefulSetDetailV2 struct {
	NamespaceResourceDetail

	// Aggregate information about pods belonging to this Pet Set.
	Pods     PodInfo `json:"podsInfo"`
	Replicas *int32  `json:"replicas"`
	// Container images of the Stateful Set.
	ContainerImages []ContainerImage `json:"containerImages"`
	// Init container images of the Stateful Set.
	InitContainerImages []ContainerImage  `json:"initContainerImages"`
	Selector            map[string]string `json:"selector"`
	StatefulSetStatus
}

type StatefulSetStatus

type StatefulSetStatus struct {
	Status string `json:"status"`
}

type StatefulsetCreateInput

type StatefulsetCreateInput struct {
	NamespaceResourceCreateInput
	apps.StatefulSetSpec

	Service *ServiceCreateOption `json:"service"`
}

func (StatefulsetCreateInput) ToStatefulset

func (input StatefulsetCreateInput) ToStatefulset(namespaceName string) (*apps.StatefulSet, error)

type StatefulsetUpdateInput

type StatefulsetUpdateInput struct {
	K8SNamespaceResourceUpdateInput
	Replicas *int32 `json:"replicas"`
	PodTemplateUpdateInput
}

type StatusInfo

type StatusInfo struct {
	// Total number of desired replicas on the deployment
	Replicas int32 `json:"replicas"`

	// Number of non-terminated pods that have the desired template spec
	Updated int32 `json:"updated"`

	// Number of available pods (ready for at least minReadySeconds)
	// targeted by this deployment
	Available int32 `json:"available"`

	// Total number of unavailable pods targeted by this deployment.
	Unavailable int32 `json:"unavailable"`
}

type StorageClass

type StorageClass struct {
	ObjectMeta
	TypeMeta

	// provisioner is the driver expected to handle this StorageClass.
	// This is an optionally-prefixed name, like a label key.
	// For example: "kubernetes.io/gce-pd" or "kubernetes.io/aws-ebs".
	// This value may not be empty.
	Provisioner string `json:"provisioner"`

	// parameters holds parameters for the provisioner.
	// These values are opaque to the  system and are passed directly
	// to the provisioner.  The only validation done on keys is that they are
	// not empty.  The maximum number of parameters is
	// 512, with a cumulative max size of 256K
	// +optional
	Parameters map[string]string `json:"parameters"`

	// Is default storage class
	IsDefault bool `json:"isDefault"`
}

StorageClass is a representation of a kubernetes StorageClass object.

type StorageClassCreateInput

type StorageClassCreateInput struct {
	ClusterResourceCreateInput

	// Provisioner indicates the type of the provisioner.
	Provisioner string `json:"provisioner"`

	// Dynamically provisioned PersistentVolumes of this storage class are
	// created with this reclaimPolicy. Defaults to Delete.
	// +optional
	ReclaimPolicy *v1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty"`

	// AllowVolumeExpansion shows whether the storage class allow volume expand
	// +optional
	AllowVolumeExpansion *bool `json:"allowVolumeExpansion,omitempty"`

	// Dynamically provisioned PersistentVolumes of this storage class are
	// created with these mountOptions, e.g. ["ro", "soft"]. Not validated -
	// mount of the PVs will simply fail if one is invalid.
	// +optional
	MountOptions []string `json:"mountOptions,omitempty"`

	// VolumeBindingMode indicates how PersistentVolumeClaims should be
	// provisioned and bound.  When unset, VolumeBindingImmediate is used.
	// This field is only honored by servers that enable the VolumeScheduling feature.
	// +optional
	VolumeBindingMode *storagev1.VolumeBindingMode `json:"volumeBindingMode,omitempty"`

	// Restrict the node topologies where volumes can be dynamically provisioned.
	// Each volume plugin defines its own supported topology specifications.
	// An empty TopologySelectorTerm list means there is no topology restriction.
	// This field is only honored by servers that enable the VolumeScheduling feature.
	// +optional
	AllowedTopologies []v1.TopologySelectorTerm `json:"allowedTopologies,omitempty"`

	// CephCSIRBD is ceph-csi rbd create params
	// More info: https://github.com/ceph/ceph-csi/blob/master/examples/rbd/storageclass.yaml
	CephCSIRBD *CephCSIRBDStorageClassCreateInput `json:"cephCSIRBD"`
}

type StorageClassDetail

type StorageClassDetail struct {
	StorageClass
	PersistentVolumes []*PersistentVolume `json:"persistentVolumes"`
}

StorageClassDetail provides the presentation layer view of Kubernetes StorageClass resource, It is StorageClassDetail plus PersistentVolumes associated with StorageClass.

type StorageClassDetailV2

type StorageClassDetailV2 struct {
	ClusterResourceDetail
	// provisioner is the driver expected to handle this StorageClass.
	// This is an optionally-prefixed name, like a label key.
	// For example: "kubernetes.io/gce-pd" or "kubernetes.io/aws-ebs".
	// This value may not be empty.
	Provisioner string `json:"provisioner"`

	// parameters holds parameters for the provisioner.
	// These values are opaque to the  system and are passed directly
	// to the provisioner.  The only validation done on keys is that they are
	// not empty.  The maximum number of parameters is
	// 512, with a cumulative max size of 256K
	// +optional
	Parameters map[string]string `json:"parameters"`

	// Is default storage class
	IsDefault bool `json:"isDefault"`
}

type StorageClassTestResult

type StorageClassTestResult struct {
	CephCSIRBD *StorageClassTestResultCephCSIRBD `json:"cephCSIRBD"`
}

type StorageClassTestResultCephCSIRBD

type StorageClassTestResultCephCSIRBD struct {
	Pools []string `json:"pools"`
}

type Subjects

type Subjects []rbac.Subject

func (*Subjects) IsZero

func (ss *Subjects) IsZero() bool

func (*Subjects) String

func (ss *Subjects) String() string

type SyncableK8sBaseResourceListInput

type SyncableK8sBaseResourceListInput struct {
	SyncStatus []string `json:"sync_status"`
}

type TLSKeyPair

type TLSKeyPair struct {
	Name        string `json:"name"`
	Certificate string `json:"certificate"`
	Key         string `json:"key"`
}

type TypeMeta

type TypeMeta struct {
	metav1.TypeMeta
}

func NewTypeMeta

func NewTypeMeta(typeMeta metav1.TypeMeta) TypeMeta

type UsableInstance

type UsableInstance struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

type UsageResult

type UsageResult struct {
	ClusterUsage *ClusterUsage `json:"cluster"`
}

type VirtualMachine

type VirtualMachine struct {
	ObjectTypeMeta

	// Hypervisor is virtual machine hypervisor
	Hypervisor string `json:"hypervisor"`
	// VcpuCount represents the number of CPUs of the virtual machine
	VcpuCount *int64 `json:"vcpuCount,omitempty"`
	// VmemSizeGB reprensents the size of memory
	VmemSizeGB *int64 `json:"vmemSizeGB,omitempty"`
	// InstanceType describes the specifications of the virtual machine
	InstanceType string `json:"instanceType,omitempty"`

	VirtualMachineStatus
}

type VirtualMachineInfo

type VirtualMachineInfo struct {
	OnecloudExternalInfoBase
	// Ips is internal attached ip addresses
	Ips []string `json:"ips"`
}

type VirtualMachineStatus

type VirtualMachineStatus struct {
	Status       string             `json:"status"`
	Reason       string             `json:"reason"`
	ExternalInfo VirtualMachineInfo `json:"externalInfo"`
	// TryTimes record the continuous creation try times
	TryTimes int32 `json:"tryTimes"`
}

type X509KeyPairCreateInput

type X509KeyPairCreateInput struct {
	Name        string `json:"name"`
	User        string `json:"user"`
	ClusterId   string `json:"cluster_id"`
	Certificate string `json:"certificate"`
	PrivateKey  string `json:"private_key"`
}

Jump to

Keyboard shortcuts

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