k8s

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RBACAPIGroup = "rbac.authorization.k8s.io"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddMachineOptions

type AddMachineOptions struct {
	Machine           []string `help:"Machine create desc, e.g. host01:baremetal:controlplane"`
	MachineNet        string   `help:"Machine net config"`
	MachineDisk       string   `help:"Machine root disk size, e.g. 100G"`
	MachineCpu        int      `help:"Machine cpu count"`
	MachineMemory     string   `help:"Machine memory size, e.g. 1G"`
	MachineSku        string   `help:"Machine sku, e.g. 'ecs.c6.large'"`
	MachineHypervisor string   `help:"Machine hypervisor, e.g. kvm, openstack"`
}

func (AddMachineOptions) Params

type AppBaseCreateOptions

type AppBaseCreateOptions struct {
	NamespaceWithClusterOptions
	ReleaseCreateUpdateOptions
	Name string `help:"Release name, If unspecified, it will autogenerate one for you"`
}

func (AppBaseCreateOptions) Params

type AppCreateOptions

type AppCreateOptions struct {
	AppBaseCreateOptions
	ChartName string `help:"Helm release app chart name, e.g yunion/meter, yunion/monitor-stack"`
}

func (AppCreateOptions) Params

func (o AppCreateOptions) Params() (*jsonutils.JSONDict, error)

type BaseListOptions

type BaseListOptions struct {
	options.BaseListOptions
	Name string `help:"List by name"`
}

func (BaseListOptions) Params

func (o BaseListOptions) Params() (*jsonutils.JSONDict, error)

type CephCSISecretCreateOptions

type CephCSISecretCreateOptions struct {
	SecretCreateOptions
	USERID  string `help:"User id"`
	USERKEY string `help:"User key"`
}

func (CephCSISecretCreateOptions) Params

type CertListOptions

type CertListOptions struct {
	options.BaseListOptions
	Cluster string `help:"Filter by cluster"`
}

func (CertListOptions) Params

func (o CertListOptions) Params() (jsonutils.JSONObject, error)

type ChartGetOptions

type ChartGetOptions struct {
	REPO    string `help:"Repo of the chart"`
	NAME    string `help:"Chart name"`
	Version string `help:"Chart version"`
}

func (ChartGetOptions) Params

func (o ChartGetOptions) Params() *jsonutils.JSONDict

type ChartListOptions

type ChartListOptions struct {
	BaseListOptions
	Repo       string `help:"Repository name"`
	RepoUrl    string `help:"Repository url"`
	AllVersion bool   `help:"Get Chart all history versions"`
	Keyword    string `help:"Chart keyword"`
	Version    string `help:"Chart semver version filter"`
	Type       string `help:"Chart type" choices:"internal|external"`
}

func (ChartListOptions) Params

func (o ChartListOptions) Params() (*jsonutils.JSONDict, error)

type ClusterBaseOptions

type ClusterBaseOptions struct {
	Cluster string `default:"$K8S_CLUSTER" help:"Kubernetes cluster name"`
}

func (ClusterBaseOptions) Params

type ClusterCheckOptions

type ClusterCheckOptions struct{}

type ClusterComponentFluentBitBackend

type ClusterComponentFluentBitBackend struct {
	Es    ClusterComponentFluentBitBackendES    `help:"Elasticsearch setting"`
	Kafka ClusterComponentFluentBitBackendKafka `help:"Kafka setting"`
}

func (ClusterComponentFluentBitBackend) Params

type ClusterComponentFluentBitBackendCommon

type ClusterComponentFluentBitBackendCommon struct {
	Enabled bool `help:"Enable this component"`
}

func (ClusterComponentFluentBitBackendCommon) Params

type ClusterComponentFluentBitBackendES

type ClusterComponentFluentBitBackendES struct {
	ClusterComponentFluentBitBackendCommon
	ClusterComponentFluentBitBackendTLS
	Host       string `help:"IP address or hostname of the target Elasticsearch instance"`
	Port       int    `help:"TCP port of the target Elasticsearch instance" default:"9200"`
	Index      string `help:"Elastic idnex name" default:"fluentbit"`
	Type       string `help:"Elastic type name" default:"flb_type"`
	HTTPUser   string `help:"Optional username credential for Elastic X-Pack access"`
	HTTPPasswd string `help:"Password for user defined in HTTPUser"`
}

func (ClusterComponentFluentBitBackendES) Params

type ClusterComponentFluentBitBackendKafka

type ClusterComponentFluentBitBackendKafka struct {
	ClusterComponentFluentBitBackendCommon
	Brokers  string `help:"Single of multiple list of Kafka Brokers, e.g: 192.168.1.3:9092, 192.168.1.4:9092"`
	Topics   string `` /* 132-byte string literal not displayed */
	TopicKey string `help:"If multiple Topics exists, the value of TopicKey in the record will indicate the topic to use."`
}

func (ClusterComponentFluentBitBackendKafka) Params

type ClusterComponentFluentBitBackendTLS

type ClusterComponentFluentBitBackendTLS struct {
	Tls       bool `help:"Enable TLS support"`
	TlsVerify bool `help:"Enable TLS validation"`
}

func (ClusterComponentFluentBitBackendTLS) Params

type ClusterComponentFluentBitSetting

type ClusterComponentFluentBitSetting struct {
	Backend ClusterComponentFluentBitBackend
}

func (ClusterComponentFluentBitSetting) Params

type ClusterComponentMinioSetting

type ClusterComponentMinioSetting struct {
	Mode          string                  `help:"MinIO mode" choices:"standalone|distributed" json:"mode"`
	Replicas      int                     `help:"MinIO replicas" default:"1" json:"replicas"`
	DrivesPerNode int                     `help:"MinIO drives per node" default:"1" json:"drivesPerNode"`
	AccessKey     string                  `help:"MinIO admin access key" json:"accessKey"`
	SecretKey     string                  `help:"MinIO admin secret key" json:"secretKey"`
	MountPath     string                  `help:"MinIO export mount path" json:"mountPath"`
	Storage       ClusterComponentStorage `help:"Storage setting" json:"storage"`
}

type ClusterComponentMonitorGrafana

type ClusterComponentMonitorGrafana struct {
	Disable           bool                                 `help:"Disable grafana component" json:"disable"`
	AdminUser         string                               `help:"Grafana admin user" default:"admin" json:"adminUser"`
	AdminPassword     string                               `help:"Grafana admin user password" json:"adminPassword"`
	Storage           ClusterComponentStorage              `help:"Storage setting"`
	PublicAddress     string                               `help:"Grafana expose public IP address or domain hostname" json:"publicAddress"`
	Host              string                               `help:"Grafana ingress host domain name" json:"host"`
	EnforceDomain     bool                                 `help:"Enforce use domain" json:"enforceDomain"`
	Tls               ClusterComponentMonitorGrafanaTlsOpt `help:"TLS setting"`
	DisableSubpath    bool                                 `help:"Disable grafana subpath" json:"disableSubpath"`
	Subpath           string                               `help:"Grafana subpath" default:"grafana" json:"subpath"`
	EnableThanosQuery bool                                 `help:"Enable thanos query datasource" json:"enableThanosQueryDataSource"`
	Oauth             ClusterComponentMonitorGrafanaOAuth  `help:"OAuth config" json:"oauth"`
	Db                ClusterComponentMonitorGrafanaDB     `help:"db config" json:"db"`
}

type ClusterComponentMonitorGrafanaDB

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

type ClusterComponentMonitorGrafanaOAuth

type ClusterComponentMonitorGrafanaOAuth struct {
	Enabled           bool   `help:"Enable oauth setting" json:"enabled"`
	ClientId          string `help:"Client id" json:"clientId"`
	ClientSecret      string `help:"Client secret" json:"clientSecret"`
	Scopes            string `help:"Client scopes" json:"scopes"`
	AuthURL           string `help:"Auth url" json:"authURL"`
	TokenURL          string `help:"Token url" json:"tokenURL"`
	ApiURL            string `help:"API URL" json:"apiURL"`
	AllowedDomains    string `help:"Allowed domains" json:"allowedDomains"`
	AllowSignUp       bool   `help:"Allow sign up" json:"allowSignUp"`
	RoleAttributePath string `help:"Role attribute path" json:"roleAttributePath"`
}

type ClusterComponentMonitorGrafanaTlsOpt

type ClusterComponentMonitorGrafanaTlsOpt struct {
	CertificateFile string `help:"TLS certificate file" json:"-"`
	KeyFile         string `help:"TLS key file" json:"-"`
}

type ClusterComponentMonitorLoki

type ClusterComponentMonitorLoki struct {
	Disable           bool                    `help:"Disable loki component" json:"disable"`
	Storage           ClusterComponentStorage `help:"Storage setting" json:"storage"`
	ObjectStoreConfig ObjectStoreConfig       `json:"objectStoreConfig"`
}

type ClusterComponentMonitorPrometheus

type ClusterComponentMonitorPrometheus struct {
	Disable bool                           `help:"Disable prometheus component" json:"disable"`
	Storage ClusterComponentStorage        `help:"Storage setting" json:"storage"`
	Thanos  MonitorPrometheusThanosSidecar `json:"thanosSidecar"`
}

type ClusterComponentMonitorPromtail

type ClusterComponentMonitorPromtail struct {
	Disable bool `help:"Disable promtail component" json:"disable"`
}

type ClusterComponentMonitorSetting

type ClusterComponentMonitorSetting struct {
	Grafana    ClusterComponentMonitorGrafana    `help:"Grafana setting" json:"grafana"`
	Loki       ClusterComponentMonitorLoki       `help:"Loki setting" json:"loki"`
	Prometheus ClusterComponentMonitorPrometheus `help:"Prometheus setting" json:"prometheus"`
	Promtail   ClusterComponentMonitorPromtail   `help:"Promtail setting" json:"promtail"`
}

type ClusterComponentOptions

type ClusterComponentOptions struct {
	IdentOptions
}

func (ClusterComponentOptions) Params

type ClusterComponentStorage

type ClusterComponentStorage struct {
	Enabled   bool   `help:"Enable this storage" json:"enabled"`
	SizeMB    int    `help:"Persistent storage size MB" json:"sizeMB"`
	ClassName string `help:"Storage class name" json:"storageClassName"`
}

type ClusterComponentThanosSetting

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

type ClusterComponentType

type ClusterComponentType struct {
	ClusterComponentOptions
	TYPE string `help:"Component type"`
}

type ClusterComponentTypeOptions

type ClusterComponentTypeOptions struct {
	ClusterComponentType
	AsHelmValues bool `help:"As helm values config" json:"as_helm_values"`
}

type ClusterDeleteOptions

type ClusterDeleteOptions struct {
	IdentsOptions
}

type ClusterDeployOptions

type ClusterDeployOptions struct {
	IdentOptions
	Force bool `help:"force deploy"`
}

func (ClusterDeployOptions) Params

type ClusterDisableComponent

type ClusterDisableComponent struct {
	ClusterComponentOptions
	TYPE string `help:"component type"`
}

func (ClusterDisableComponent) Params

type ClusterEnableComponentCephCSIOpt

type ClusterEnableComponentCephCSIOpt struct {
	ClusterComponentOptions
	ClusterId string   `help:"Ceph cluster id"`
	Monitor   []string `help:"Ceph monitor, format is 'ip:port'"`
}

func (ClusterEnableComponentCephCSIOpt) Params

type ClusterEnableComponentFluentBitOpt

type ClusterEnableComponentFluentBitOpt struct {
	ClusterComponentOptions
	ClusterComponentFluentBitSetting
}

func (ClusterEnableComponentFluentBitOpt) Params

type ClusterEnableComponentMinioBaseOpt

type ClusterEnableComponentMinioBaseOpt struct {
	ClusterComponentOptions
	ClusterComponentMinioSetting
}

func (ClusterEnableComponentMinioBaseOpt) Params

type ClusterEnableComponentMinioOpt

type ClusterEnableComponentMinioOpt struct {
	ClusterEnableComponentMinioBaseOpt
}

func (ClusterEnableComponentMinioOpt) Params

type ClusterEnableComponentMonitorMinioOpt

type ClusterEnableComponentMonitorMinioOpt struct {
	ClusterEnableComponentMinioBaseOpt
}

func (ClusterEnableComponentMonitorMinioOpt) Params

type ClusterEnableComponentMonitorOpt

type ClusterEnableComponentMonitorOpt struct {
	ClusterComponentOptions
	ClusterComponentMonitorSetting
}

func (ClusterEnableComponentMonitorOpt) Params

type ClusterEnableComponentThanosOpt

type ClusterEnableComponentThanosOpt struct {
	ClusterComponentOptions
	ClusterComponentThanosSetting
}

func (ClusterEnableComponentThanosOpt) Params

type ClusterGCOpts

type ClusterGCOpts struct{}

func (ClusterGCOpts) Params

func (o ClusterGCOpts) Params() (jsonutils.JSONObject, error)

type ClusterGetAddonsOpt

type ClusterGetAddonsOpt struct {
	IdentOptions
	EnableNativeIPAlloc bool `json:"enable_native_ip_alloc"`
}

func (ClusterGetAddonsOpt) Params

type ClusterK8sVersions

type ClusterK8sVersions struct {
	PROVIDER string `help:"cluster provider" choices:"system|onecloud"`
}

type ClusterListOptions

type ClusterListOptions struct {
	options.BaseListOptions
	// federated resource keyword, e.g: federatednamespace
	FederatedKeyword    string `json:"federated_keyword"`
	FederatedResourceId string `json:"federated_resource_id"`
	FederatedUsed       *bool  `json:"-"`
	FederatedUnused     *bool  `json:"-"`
}

func (*ClusterListOptions) Params

type ClusterPurgeOptions

type ClusterPurgeOptions struct {
	IdentOptions
	Force bool `help:"force purge"`
}

func (ClusterPurgeOptions) Params

type ClusterResourceBaseOptions

type ClusterResourceBaseOptions struct {
	Cluster string `default:"$K8S_CLUSTER" help:"Kubernetes cluster name"`
	NAME    string `help:"Name of resource"`
}

func (ClusterResourceBaseOptions) GetId

func (ClusterResourceBaseOptions) Params

type ClusterResourceCreateOptions

type ClusterResourceCreateOptions struct {
	CLUSTER string `default:"$K8S_CLUSTER" help:"Kubernetes cluster name"`
	NAME    string `help:"Name of resource"`
}

func (ClusterResourceCreateOptions) Params

type ClusterResourceUpdateOptions

type ClusterResourceUpdateOptions struct {
	ID string `help:"Id of resource"`
}

func (ClusterResourceUpdateOptions) GetId

type ClusterRoleTemplate

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

type ClusterSetExtraConfigOpt

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

func (ClusterSetExtraConfigOpt) Params

type ClusterSyncOptions

type ClusterSyncOptions struct {
	IdentOptions
	Force bool `help:"force sync"`
}

func (ClusterSyncOptions) Params

type ClusterUpdateComponentCephCSIOpt

type ClusterUpdateComponentCephCSIOpt struct {
	ClusterComponentOptions
	ClusterId string   `help:"Ceph cluster id"`
	Monitor   []string `help:"Ceph monitor, format is 'ip:port'"`
}

func (ClusterUpdateComponentCephCSIOpt) Params

type ComponentThanosCompactor

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

type ComponentThanosDnsDiscovery

type ComponentThanosDnsDiscovery struct {
	SidecarsService   string `help:"Sidecars service name to discover them using DNS discovery" default:"prometheus-operated" json:"sidecarsService"`
	SidecarsNamespace string `help:"Sidecars namespace to discover them using DNS discovery" default:"onecloud-monitoring" json:"sidecarsNamespace"`
}

type ComponentThanosQuery

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

type ComponentThanosStoregateway

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

type ConfigMapCreateOptions

type ConfigMapCreateOptions struct {
	NamespaceResourceCreateOptions
	DataKey   []string `help:"configmap data key"`
	DataValue []string `help:"configmap data value"`
}

func (*ConfigMapCreateOptions) Params

type CronJobCreateOptions

type CronJobCreateOptions struct {
	JobTemplateOptions
	NamespaceWithClusterOptions
	NAME     string `help:"Name of cronjob"`
	Schedule string `help:"The chedule in Cron format, e.g. '*/10 * * * *'" required:"true"`
}

func (CronJobCreateOptions) Params

type DeploymentCreateOptions

type DeploymentCreateOptions struct {
	NamespaceWithClusterOptions

	K8sLabelOptions
	K8sPodTemplateOptions
	ServiceSpecOptions

	NAME     string `help:"Name of deployment"`
	Replicas int64  `help:"Number of replicas for pods in this deployment"`
}

func (DeploymentCreateOptions) Params

type DeploymentUpdateOptions

type DeploymentUpdateOptions struct {
	NamespaceWithClusterOptions
	NAME  string   `help:"Name of deployment"`
	Image []string `help:"Image of container to set, e.g. 'default=nginx:latest'"`
}

func (DeploymentUpdateOptions) GetId

func (o DeploymentUpdateOptions) GetId() string

func (DeploymentUpdateOptions) Params

type FedApiResourecesOptions

type FedApiResourecesOptions struct{}

func (*FedApiResourecesOptions) GetId

func (opts *FedApiResourecesOptions) GetId() string

func (*FedApiResourecesOptions) Params

type FedClusterRoleBindingCreatOpt

type FedClusterRoleBindingCreatOpt struct {
	FedResourceCreateOptions
	RoleRef RoleRef `json:"roleRef"`
	Subject Subject `help:"Subject is role bind subject, e.g: User=jane"`
}

func (*FedClusterRoleBindingCreatOpt) Params

func (*FedClusterRoleBindingCreatOpt) ToInput

type FedClusterRoleBindingCreateInput

type FedClusterRoleBindingCreateInput struct {
	FedResourceCreateOptions
	Spec FedClusterRoleBindingSpec `json:"spec"`
}

type FedClusterRoleBindingSpec

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

type FedClusterRoleCreateInput

type FedClusterRoleCreateInput struct {
	FedResourceCreateOptions
	Spec FedClusterRoleSpec `json:"spec"`
}

type FedClusterRoleCreateOptions

type FedClusterRoleCreateOptions struct {
	FedResourceCreateOptions
	// Spec FedClusterRoleSpec `json:"spec"`
	Rule []string `help:"role rule, e.g: 'apps/v1:deployments:get,watch,list'"`
}

func (*FedClusterRoleCreateOptions) Params

type FedClusterRoleSpec

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

type FedClusterUserGroupsOptions

type FedClusterUserGroupsOptions struct{}

func (*FedClusterUserGroupsOptions) GetId

func (opts *FedClusterUserGroupsOptions) GetId() string

func (*FedClusterUserGroupsOptions) Params

type FedClusterUsersOptions

type FedClusterUsersOptions struct{}

func (*FedClusterUsersOptions) GetId

func (opts *FedClusterUsersOptions) GetId() string

func (*FedClusterUsersOptions) Params

type FedJointClusterBaseListOptions

type FedJointClusterBaseListOptions struct {
	options.BaseListOptions
	FederatedResourceId string `help:"ID or Name of federated resource" json:"federatedresource_id"`
	ClusterId           string `help:"ID or Name of cluster"`
	NamespaceId         string `help:"ID or Name of namespace"`
	ResourceId          string `help:"ID or Name of resource"`
}

func (*FedJointClusterBaseListOptions) GetMasterOpt

func (o *FedJointClusterBaseListOptions) GetMasterOpt() string

func (*FedJointClusterBaseListOptions) GetSlaveOpt

func (o *FedJointClusterBaseListOptions) GetSlaveOpt() string

func (*FedJointClusterBaseListOptions) Params

type FedNamespaceClusterListOptions

type FedNamespaceClusterListOptions struct {
	FedJointClusterBaseListOptions
}

type FedNamespaceCreateOptions

type FedNamespaceCreateOptions struct {
	FedResourceCreateOptions
	Spec FedNamespaceSpec `json:"spec,allowempty"`
}

func (*FedNamespaceCreateOptions) Params

type FedNamespaceIdOptions

type FedNamespaceIdOptions struct {
	NAMESPACE string `help:"ID or Name of federated namespace"`
}

type FedNamespaceJointClusterListOpt

type FedNamespaceJointClusterListOpt struct {
	FedJointClusterBaseListOptions
	FederatednamespaceId string `help:"ID or Name of federatednamespace"`
}

func (*FedNamespaceJointClusterListOpt) Params

type FedNamespaceListOptions

type FedNamespaceListOptions struct {
	FedResourceListOptions
}

type FedNamespaceResourceCreateInput

type FedNamespaceResourceCreateInput struct {
	FedResourceCreateOptions
	FederatednamespaceId string `json:"federatednamespace_id"`
}

type FedNamespaceResourceCreateOptions

type FedNamespaceResourceCreateOptions struct {
	FEDNAMESPACE string `help:"Federatednamespace id or name"`
	FedResourceCreateOptions
}

func (FedNamespaceResourceCreateOptions) Params

func (FedNamespaceResourceCreateOptions) ToInput

type FedNamespaceResourceListOptions

type FedNamespaceResourceListOptions struct {
	FedResourceListOptions
	Federatednamespace string `json:"federatednamespace"`
}

func (*FedNamespaceResourceListOptions) Params

type FedNamespaceSpec

type FedNamespaceSpec struct {
	Template NamespaceTemplate `json:"template,allowempty"`
}

type FedResourceClusterJointOptions

type FedResourceClusterJointOptions struct {
	ClusterId string `json:"cluster_id" positional:"true" required:"true" help:"ID or name of cluster"`
}

func (FedResourceClusterJointOptions) Params

type FedResourceClusterShowOptions

type FedResourceClusterShowOptions struct {
	CLUSTER string `help:"ID or Name of cluster"`
}

func (FedResourceClusterShowOptions) GetSlaveId

func (o FedResourceClusterShowOptions) GetSlaveId() string

type FedResourceCreateOptions

type FedResourceCreateOptions struct {
	apis.DomainLevelResourceCreateInput
}

type FedResourceIdOptions

type FedResourceIdOptions struct {
	FEDRESOURCE string `help:"ID or Name of federated resource"`
}

func (FedResourceIdOptions) GetId

func (o FedResourceIdOptions) GetId() string

func (FedResourceIdOptions) Params

type FedResourceJointClusterAttachOptions

type FedResourceJointClusterAttachOptions struct {
	FedResourceIdOptions
	FedResourceClusterJointOptions
}

func (*FedResourceJointClusterAttachOptions) GetId

func (*FedResourceJointClusterAttachOptions) Params

type FedResourceJointClusterDetachOptions

type FedResourceJointClusterDetachOptions struct {
	FedResourceIdOptions
	FedResourceClusterJointOptions
}

func (*FedResourceJointClusterDetachOptions) GetId

func (*FedResourceJointClusterDetachOptions) Params

type FedResourceJointClusterShowOptions

type FedResourceJointClusterShowOptions struct {
	FedResourceIdOptions
	FedResourceClusterShowOptions
}

func (FedResourceJointClusterShowOptions) GetMasterId

func (FedResourceJointClusterShowOptions) Params

type FedResourceListOptions

type FedResourceListOptions struct {
	options.BaseListOptions
}

func (*FedResourceListOptions) Params

type FedResourceUpdateOptions

type FedResourceUpdateOptions struct {
	FedResourceIdOptions
}

func (FedResourceUpdateOptions) GetUpdateFields

func (o FedResourceUpdateOptions) GetUpdateFields() []string

type FedRoleBindingCreateInput

type FedRoleBindingCreateInput struct {
	FedNamespaceResourceCreateOptions
	Spec FedRoleBindingSpec `json:"spec"`
}

type FedRoleBindingCreateOpt

type FedRoleBindingCreateOpt struct {
	FedNamespaceResourceCreateOptions
	RoleRef RoleRef `json:"roleRef"`
	Subject Subject `help:"Subject is role bind subject, e.g: User=jane"`
}

func (*FedRoleBindingCreateOpt) Params

func (*FedRoleBindingCreateOpt) ToInput

type FedRoleBindingSpec

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

type FedRoleCreateInput

type FedRoleCreateInput struct {
	FedNamespaceResourceCreateInput
	Spec FedRoleSpec `json:"spec"`
}

type FedRoleCreateOptions

type FedRoleCreateOptions struct {
	FedNamespaceResourceCreateOptions
	Rule []string `help:"role rule, e.g: 'apps/v1:deployments:get,watch,list'"`
}

func (*FedRoleCreateOptions) Params

type FedRoleListOptions

type FedRoleListOptions struct {
	FedNamespaceResourceListOptions
}

type FedRoleSpec

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

type IOption

type IOption interface {
	Params() (*jsonutils.JSONDict, error)
}

type IdentOptions

type IdentOptions struct {
	ID string `help:"ID or name of the model"`
}

func (IdentOptions) GetId

func (o IdentOptions) GetId() string

func (IdentOptions) Params

func (o IdentOptions) Params() (jsonutils.JSONObject, error)

type IdentsOptions

type IdentsOptions struct {
	ID []string `help:"ID of models to operate"`
}

func (IdentsOptions) GetIds

func (o IdentsOptions) GetIds() []string

func (IdentsOptions) Params

func (o IdentsOptions) Params() (jsonutils.JSONObject, error)

type IngressCreateOptions

type IngressCreateOptions struct {
	NamespaceWithClusterOptions
	NAME    string `help:"Name of ingress"`
	SERVICE string `help:"Service name"`
	PORT    int    `help:"Service port"`
	Path    string `help:"HTTP path"`
	Host    string `help:"Fuly qualified domain name of a network host" required:"true"`
}

func (IngressCreateOptions) Params

type JobCreateOptions

type JobCreateOptions struct {
	NamespaceWithClusterOptions
	JobTemplateOptions

	NAME string `help:"Name of job"`
}

func (JobCreateOptions) Params

type JobTemplateOptions

type JobTemplateOptions struct {
	K8sLabelOptions
	K8sPodTemplateOptions
	Parallelism int64 `help:"Specifies the maximum desired number of pods the job should run at any given time"`
}

func (JobTemplateOptions) Attach

func (o JobTemplateOptions) Attach(params *jsonutils.JSONDict, name string, key ...string) error

func (JobTemplateOptions) Params

func (o JobTemplateOptions) Params(name string) (*jsonutils.JSONDict, error)

type K8SClusterAddonConfig

type K8SClusterAddonConfig struct {
	Network K8SClusterAddonNetworkConfig `json:"network"`
}

type K8SClusterAddonNetworkConfig

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

type K8SClusterCreateOptions

type K8SClusterCreateOptions struct {
	NAME string `help:"Name of cluster"`
	// ClusterType  string `help:"Cluster cluster type" choices:"default|serverless"`
	ResourceType string `help:"Cluster cluster type" choices:"host|guest"`
	// CloudType         string `help:"Cluster cloud type" choices:"private|public|hybrid"`
	Mode              string `help:"Cluster mode type" choices:"customize|import"`
	Provider          string `help:"Cluster provider" choices:"onecloud|system"`
	ServiceCidr       string `help:"Cluster service CIDR, e.g. 10.43.0.0/16"`
	ServiceDomain     string `help:"Cluster service domain, e.g. cluster.local"`
	Vip               string `help:"Cluster api server static loadbalancer vip"`
	Version           string `help:"Cluster kubernetes version"`
	ImageRepo         string `help:"Image repository, e.g. registry-1.docker.io/yunion"`
	ImageRepoInsecure bool   `help:"Image repostiory is insecure"`
	Vpc               string `help:"Cluster nodes network vpc"`

	// AddMachineOptions include create machine options
	AddMachineOptions
	// Addons options
	EnableNativeIPAlloc bool `help:"Calico CNI plugin enable native ip allocation"`
}

func (K8SClusterCreateOptions) Params

type K8sAppBaseCreateOptions

type K8sAppBaseCreateOptions struct {
	NamespaceWithClusterOptions
	ServiceSpecOptions
}

func (K8sAppBaseCreateOptions) Params

type K8sAppCreateFromFileOptions

type K8sAppCreateFromFileOptions struct {
	NamespaceResourceGetOptions
	FILE string `help:"K8s resource YAML or JSON file"`
}

func (K8sAppCreateFromFileOptions) Params

type K8sLabelOptions

type K8sLabelOptions struct {
	Label []string `help:"Labels to apply to the pod(s), e.g. 'env=prod'"`
}

func (K8sLabelOptions) Attach

func (o K8sLabelOptions) Attach(data *jsonutils.JSONDict) error

func (K8sLabelOptions) Params

func (o K8sLabelOptions) Params() (*jsonutils.JSONDict, error)

type K8sPVCTemplateOptions

type K8sPVCTemplateOptions struct {
	PvcTemplate []string `help:"PVC volume desc, format is <pvc_name>:<size>:<mount_point>"`
}

func (K8sPVCTemplateOptions) Attach

func (o K8sPVCTemplateOptions) Attach(
	data *jsonutils.JSONDict,
	pvcs []*pvcTemplate,
	podTemplate *K8sPodTemplateOptions,
)

PVCTemplateOptions Attach must invoke before podTemplate Attach

func (K8sPVCTemplateOptions) Parse

func (o K8sPVCTemplateOptions) Parse() ([]*pvcTemplate, error)

type K8sPodTemplateOptions

type K8sPodTemplateOptions struct {
	Image           string   `help:"The image for the container to run" required:"true"`
	Command         string   `help:"Container start command"`
	Args            string   `help:"Container start command args"`
	Env             []string `help:"Environment variables to set in container"`
	Mem             int      `help:"Memory request MB size"`
	Cpu             float64  `help:"Cpu request cores"`
	Pvc             []string `help:"PVC volume desc, format is <pvc_name>:<mount_point>"`
	RunAsPrivileged bool     `help:"Whether to run the container as privileged user"`

	// pod option
	RestartPolicy  string   `help:"Pod restart policy" choices:"Always|OnFailure|Never"`
	RegistrySecret []string `help:"Docker registry secret"`
	// contains filtered or unexported fields
}

only support one container now

func (K8sPodTemplateOptions) Attach

func (K8sPodTemplateOptions) Params

type KubeClusterAddMachinesOptions

type KubeClusterAddMachinesOptions struct {
	IdentOptions
	AddMachineOptions
}

func (KubeClusterAddMachinesOptions) Params

type KubeClusterDeleteMachinesOptions

type KubeClusterDeleteMachinesOptions struct {
	IdentOptions
	Machines []string `help:"Machine id or name"`
}

func (KubeClusterDeleteMachinesOptions) Params

type KubeClusterImportOptions

type KubeClusterImportOptions struct {
	NAME             string `help:"Name of cluster"`
	KUBECONFIG       string `help:"Cluster kubeconfig file path"`
	Distro           string `help:"Kubernetes distribution, e.g. openshift"`
	Provider         string `help:"Provider type" choices:"external|aliyun|qcloud|azure"`
	ResourceType     string `help:"Node resource type" choices:"unknown|guest"`
	CloudKubeCluster string `help:"Cloud kube cluster id or name"`
}

func (KubeClusterImportOptions) Params

type MachineAttachNetworkAddressOptions

type MachineAttachNetworkAddressOptions struct {
	IdentOptions
	IPAddr string `help:"preferred ip address"`
}

func (MachineAttachNetworkAddressOptions) Params

type MachineCreateOptions

type MachineCreateOptions struct {
	CLUSTER    string `help:"Cluster id"`
	ROLE       string `help:"Machine role" choices:"node|controlplane"`
	Type       string `help:"Resource type" choices:"vm|baremetal" json:"resource_type"`
	Instance   string `help:"VM or host instance id" json:"resource_id"`
	Name       string `help:"Name of node"`
	Disk       string `help:"VM root disk size, e.g. 100G"`
	Net        string `help:"VM network config"`
	Cpu        int    `help:"VM cpu count"`
	Memory     string `help:"VM memory size, e.g. 1G"`
	Hypervisor string `help:"VM hypervisor"`
	Sku        string `help:"VM sku (instance type), e.g. 'ecs.c6.large'"`
}

func (MachineCreateOptions) Params

type MachineListNetworkAddressOptions

type MachineListNetworkAddressOptions struct {
	IdentOptions
}

type MachineListOptions

type MachineListOptions struct {
	options.BaseListOptions
	Cluster string `help:"Filter by cluster"`
}

func (MachineListOptions) Params

type MonitorPrometheusThanosSidecar

type MonitorPrometheusThanosSidecar struct {
	ObjectStoreConfig ObjectStoreConfig `json:"objectStoreConfig"`
}

type NamespaceCreateOptions

type NamespaceCreateOptions struct {
	ClusterResourceCreateOptions
}

func (NamespaceCreateOptions) Params

type NamespaceOptions

type NamespaceOptions struct {
	Namespace string `help:"Namespace of this resource"`
}

func (NamespaceOptions) Params

func (o NamespaceOptions) Params() *jsonutils.JSONDict

type NamespaceResourceCreateOptions

type NamespaceResourceCreateOptions struct {
	apis.DomainLevelResourceCreateInput
	CLUSTER   string `default:"$K8S_CLUSTER" help:"Kubernetes cluster name"`
	NAMESPACE string `help:"Namespace of resource"`
}

func (NamespaceResourceCreateOptions) Params

type NamespaceResourceDeleteOptions

type NamespaceResourceDeleteOptions struct {
	ResourceDeleteOptions
	NamespaceOptions
}

func (NamespaceResourceDeleteOptions) Params

func (NamespaceResourceDeleteOptions) QueryParams

type NamespaceResourceGetOptions

type NamespaceResourceGetOptions struct {
	ResourceGetOptions
	NamespaceOptions
}

func (NamespaceResourceGetOptions) Params

type NamespaceResourceListOptions

type NamespaceResourceListOptions struct {
	ResourceListOptions
	Namespace string `help:"Namespace of this resource"`
}

func (NamespaceResourceListOptions) Params

type NamespaceResourceUpdateOptions

type NamespaceResourceUpdateOptions struct {
	ClusterResourceUpdateOptions
}

type NamespaceTemplate

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

type NamespaceWithClusterOptions

type NamespaceWithClusterOptions struct {
	NamespaceOptions
	ClusterBaseOptions
}

func (NamespaceWithClusterOptions) Params

type ObjectStoreConfig

type ObjectStoreConfig struct {
	Bucket    string `json:"bucket"`
	Endpoint  string `json:"endpoint"`
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
	Insecure  bool   `json:"insecure"`
}

type PVCCreateOptions

type PVCCreateOptions struct {
	NamespaceWithClusterOptions
	NAME         string `help:"Name of PVC"`
	SIZE         string `help:"Storage size, e.g. 10Gi"`
	StorageClass string `help:"PVC StorageClassName"`
}

func (PVCCreateOptions) Params

type PVCListOptions

type PVCListOptions struct {
	NamespaceResourceListOptions
	Unused bool `help:"Filter unused pvc"`
}

func (PVCListOptions) Params

func (o PVCListOptions) Params() (jsonutils.JSONObject, error)

type PolicyRule

type PolicyRule struct {
	APIGroups []string `json:"apiGroups"`
	Resources []string `json:"resources"`
	Verbs     []string `json:"verbs"`
}

type RegistrySecretCreateOptions

type RegistrySecretCreateOptions struct {
	SecretCreateOptions
	Server   string `help:"Docker registry server, e.g. 'https://index.docker.io/v1/'" required:"true"`
	User     string `help:"Docker registry user" required:"true"`
	Password string `help:"Docker registry password" required:"true"`
	Email    string `help:"Docker registry user email"`
}

func (RegistrySecretCreateOptions) Params

type ReleaseCreateOptions

type ReleaseCreateOptions struct {
	AppBaseCreateOptions
	CHARTNAME string `help:"Helm chart name, e.g stable/etcd"`
}

func (ReleaseCreateOptions) Params

type ReleaseCreateUpdateOptions

type ReleaseCreateUpdateOptions struct {
	Values  string `help:"Specify values in a YAML file (can specify multiple)" short-token:"f"`
	Version string `help:"Specify the exact chart version to install. If not specified, latest version installed"`
	//Set     []string `help:"set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)"`
	DryRun  bool  `help:"Simulate an install"`
	Details bool  `help:"Show release deploy details, include kubernetes created resources"`
	Timeout int64 `help:"Time in seconds to wait for any individual kubernetes operation (like Jobs for hooks)" default:"600"`
}

func (ReleaseCreateUpdateOptions) Params

type ReleaseDeleteOptions

type ReleaseDeleteOptions struct {
	NamespaceWithClusterOptions
	NAME string `help:"Release instance name"`
}

func (*ReleaseDeleteOptions) GetId

func (o *ReleaseDeleteOptions) GetId() string

func (*ReleaseDeleteOptions) Params

type ReleaseHistoryOptions

type ReleaseHistoryOptions struct {
	NamespaceWithClusterOptions
	NAME string `help:"Release instance name"`
	Max  int64  `help:"History limit size"`
}

func (ReleaseHistoryOptions) Params

type ReleaseListOptions

type ReleaseListOptions struct {
	NamespaceResourceListOptions
	Deployed   bool   `help:"Show deployed status releases"`
	Deleted    bool   `help:"Show deleted status releases"`
	Deleting   bool   `help:"Show deleting status releases"`
	Failed     bool   `help:"Show failed status releases"`
	Superseded bool   `help:"Show superseded status releases"`
	Pending    bool   `help:"Show pending status releases"`
	Type       string `help:"Release type" choices:"internal|external"`
}

func (ReleaseListOptions) Params

type ReleaseRollbackOptions

type ReleaseRollbackOptions struct {
	NamespaceWithClusterOptions
	NAME        string `help:"Release instance name"`
	REVISION    int64  `help:"Release history revision number"`
	Description string `help:"Release rollback description string"`
}

func (ReleaseRollbackOptions) Params

type ReleaseUpgradeOptions

type ReleaseUpgradeOptions struct {
	NamespaceWithClusterOptions
	ReleaseCreateUpdateOptions
	NAME        string `help:"Release instance name"`
	CHARTNAME   string `help:"Helm chart name, e.g stable/etcd"`
	ReuseValues bool   `` /* 134-byte string literal not displayed */
	ResetValues bool   `help:"When upgrading, reset the values to the ones built into the chart"`
}

func (ReleaseUpgradeOptions) Params

type RepoCreateOptions

type RepoCreateOptions struct {
	RepoGetOptions
	Type   string `help:"Repository type" choices:"internal|external"`
	URL    string `help:"Repository url"`
	Public bool   `help:"Make repostitory public"`
}

func (RepoCreateOptions) Params

type RepoGetOptions

type RepoGetOptions struct {
	NAME string `help:"ID or name of the repo"`
}

func (*RepoGetOptions) GetId

func (o *RepoGetOptions) GetId() string

func (*RepoGetOptions) Params

func (o *RepoGetOptions) Params() (jsonutils.JSONObject, error)

type RepoListOptions

type RepoListOptions struct {
	options.BaseListOptions
	Type string `help:"Helm repostitory type" json:"type" choices:"internal|external"`
}

func (*RepoListOptions) Params

func (o *RepoListOptions) Params() (jsonutils.JSONObject, error)

type RepoPublicOptions

type RepoPublicOptions struct {
	ID            string   `help:"ID or name of repo" json:"-"`
	Scope         string   `help:"sharing scope" choices:"system|domain"`
	SharedDomains []string `help:"share to domains"`
}

func (*RepoPublicOptions) GetId

func (o *RepoPublicOptions) GetId() string

func (*RepoPublicOptions) Params

type RepoUpdateOptions

type RepoUpdateOptions struct {
	RepoGetOptions
	Name string `help:"Repository name to change"`
	Url  string `help:"Repository url to change"`
}

func (RepoUpdateOptions) GetId

func (o RepoUpdateOptions) GetId() string

func (RepoUpdateOptions) Params

type ResourceDeleteOptions

type ResourceDeleteOptions struct {
	ClusterBaseOptions
	NAME []string `help:"Name ident of the resources"`
}

func (ResourceDeleteOptions) GetIds

func (o ResourceDeleteOptions) GetIds() []string

func (ResourceDeleteOptions) Params

func (ResourceDeleteOptions) QueryParams

func (o ResourceDeleteOptions) QueryParams() (jsonutils.JSONObject, error)

type ResourceGetOptions

type ResourceGetOptions struct {
	ClusterBaseOptions
	NAME string `help:"Name ident of the resource"`
}

func (ResourceGetOptions) GetId

func (o ResourceGetOptions) GetId() string

func (ResourceGetOptions) Params

type ResourceIdsOptions

type ResourceIdsOptions struct {
	ID []string `help:"Resource id"`
}

func (ResourceIdsOptions) GetIds

func (o ResourceIdsOptions) GetIds() []string

func (ResourceIdsOptions) Params

type ResourceListOptions

type ResourceListOptions struct {
	ClusterBaseOptions
	BaseListOptions
}

func (ResourceListOptions) Params

type RoleBindingTemplate

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

type RoleCreateOpt

type RoleCreateOpt struct {
	NamespaceResourceCreateOptions

	Rule []string `help:"role rule, e.g: 'apps/v1:deployments:get,watch,list'"`
}

func (*RoleCreateOpt) Params

func (o *RoleCreateOpt) Params() (jsonutils.JSONObject, error)

type RoleRef

type RoleRef struct {
	Kind     string `help:"Role kind" choices:"ClusterRole|Role" json:"kind"`
	Name     string `help:"Name is the name of role" json:"name"`
	APIGroup string `json:"apiGroup"`
}

type RoleTemplate

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

type RoleUpdateOpt

type RoleUpdateOpt struct {
	NamespaceResourceUpdateOptions

	Rule []string `help:"role rule, e.g: 'apps/v1:deployments:get,watch,list'"`
}

func (*RoleUpdateOpt) Params

func (o *RoleUpdateOpt) Params() (jsonutils.JSONObject, error)

type SecretCreateOptions

type SecretCreateOptions struct {
	NamespaceWithClusterOptions
	NAME string `help:"Name of secret"`
}

func (SecretCreateOptions) Params

type SecretListOptions

type SecretListOptions struct {
	NamespaceResourceListOptions
	Type string `help:"Secret type"`
}

func (SecretListOptions) Params

type ServiceCreateOptions

type ServiceCreateOptions struct {
	NamespaceWithClusterOptions
	ServiceSpecOptions
	NAME     string   `help:"Name of deployment"`
	Selector []string `help:"Selectors are backends pods labels, e.g. 'run=app'"`
}

func (ServiceCreateOptions) Params

type ServiceListOptions

type ServiceListOptions struct {
	NamespaceResourceListOptions
	Type string `help:"Service type" choices:"ClusterIP|LoadBalancer|NodePort|ExternalName"`
}

func (ServiceListOptions) Params

type ServiceSpecOptions

type ServiceSpecOptions struct {
	Port       []string `help:"Port for the service that is created, format is <protocol>:<service_port>:<container_port> e.g. tcp:80:3000"`
	IsExternal bool     `help:"Created service is external loadbalance"`
	LbNetwork  string   `help:"LoadBalancer service network id"`
}

func (ServiceSpecOptions) Attach

func (o ServiceSpecOptions) Attach(data *jsonutils.JSONDict) error

func (ServiceSpecOptions) Params

func (o ServiceSpecOptions) Params() (*jsonutils.JSONDict, error)

type StatefulSetCreateOptions

type StatefulSetCreateOptions struct {
	NamespaceWithClusterOptions

	K8sLabelOptions
	K8sPodTemplateOptions
	ServiceSpecOptions

	NAME     string `help:"Name of deployment"`
	Replicas int64  `help:"Number of replicas for pods in this deployment"`

	K8sPVCTemplateOptions
}

func (StatefulSetCreateOptions) Params

type StorageClassCephCSIRBDCreateOptions

type StorageClassCephCSIRBDCreateOptions struct {
	StorageClassCephCSIRBDTestOptions
	POOL          string `help:"Ceph RBD pool"`
	ImageFeatures string `help:"RBD image features" default:"layering"`
	FsType        string `help:"CSI default volume filesystem type" default:"ext4"`
}

func (*StorageClassCephCSIRBDCreateOptions) Params

type StorageClassCephCSIRBDTestOptions

type StorageClassCephCSIRBDTestOptions struct {
	StorageClassCreateOptions
	CLUSTERID       string `help:"Ceph cluster id"`
	SecretName      string `help:"Ceph credentials with required access to the pool"`
	SecretNamespace string `help:"Ceph credentials secret namespace"`
}

func (*StorageClassCephCSIRBDTestOptions) Params

type StorageClassCreateOptions

type StorageClassCreateOptions struct {
	ClusterResourceCreateOptions
}

func (*StorageClassCreateOptions) Params

func (o *StorageClassCreateOptions) Params(provisioner string) *jsonutils.JSONDict

type Subject

type Subject struct {
	Kind      string `json:"kind"`
	APIGroup  string `json:"apiGroup"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type TillerCreateOptions

type TillerCreateOptions struct {
	ClusterBaseOptions
	KubeContext string `json:"kube_context"`
	Namespace   string `json:"namespace" default:"kube-system"`
	// Upgrade if Tiller is already installed
	Upgrade bool `json:"upgrade"`
	// Name of service account
	ServiceAccount string `json:"service_account" default:"tiller"`
	// Use the canary Tiller image
	Canary bool `json:"canary_image"`

	// Override Tiller image
	Image string `json:"tiller_image" default:"yunion/tiller:v2.9.1"`
	// Limit the maximum number of revisions saved per release. Use 0 for no limit.
	MaxHistory int `json:"history_max"`
}

func (TillerCreateOptions) Params

Jump to

Keyboard shortcuts

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