Documentation ¶
Index ¶
- Constants
- Variables
- func AnnProm(port int32) map[string]string
- func ClusterConfigMapName(oc *v1alpha1.OnecloudCluster) string
- func ClustercertSecretName(oc *v1alpha1.OnecloudCluster) string
- func ComponentConfigMapName(oc *v1alpha1.OnecloudCluster, component v1alpha1.ComponentType) string
- func GetAuthURL(oc *v1alpha1.OnecloudCluster) string
- func GetOwnerRef(oc *v1alpha1.OnecloudCluster) metav1.OwnerReference
- func GetServiceType(services []v1alpha1.Service, serviceName string) corev1.ServiceType
- func IsRequeueError(err error) bool
- func KeystoneComponentName(clusterName string) string
- func NewCACertAndKey(certSpec *certutil.Config) (*x509.Certificate, crypto.Signer, error)
- func NewClusterComponentName(clusterName string, componentName v1alpha1.ComponentType) string
- func NewOnecloudClientSession(oc *v1alpha1.OnecloudCluster) (*mcclient.ClientSession, error)
- func NewOnecloudClientToken(oc *v1alpha1.OnecloudCluster) (*mcclient.Client, mcclient.TokenCredential, error)
- func NewOnecloudSessionByToken(cli *mcclient.Client, region string, token mcclient.TokenCredential) (*mcclient.ClientSession, error)
- func NewOnecloudSimpleClientSession(oc *v1alpha1.OnecloudCluster) (*mcclient.ClientSession, error)
- func PoliciesPublic(s *mcclient.ClientSession, types []string) error
- func PolicyCreate(s *mcclient.ClientSession, policyType string, content string, enable bool) (jsonutils.JSONObject, error)
- func RequeueErrorf(format string, a ...interface{}) error
- func RolesPublic(s *mcclient.ClientSession, roles []string) error
- type ClusterControlInterface
- type ComponentManager
- type ConfigMapControlInterface
- type CronJobControlInterface
- type DaemonSetControlInterface
- type DeploymentControlInterface
- type IngressControlInterface
- type Object
- type OnecloudCert
- func (k *OnecloudCert) CreateAsCA(oc *v1alpha1.OnecloudCluster) (*x509.Certificate, crypto.Signer, error)
- func (k *OnecloudCert) CreateFromCA(oc *v1alpha1.OnecloudCluster, caCert *x509.Certificate, caKey crypto.Signer) (*x509.Certificate, crypto.Signer, error)
- func (k *OnecloudCert) GetConfig(oc *v1alpha1.OnecloudCluster) (*certutil.Config, error)
- type OnecloudCertControlInterface
- type OnecloudControl
- func (w *OnecloudControl) Components(oc *v1alpha1.OnecloudCluster) ComponentManager
- func (w *OnecloudControl) GetSession(oc *v1alpha1.OnecloudCluster) (*mcclient.ClientSession, error)
- func (w *OnecloudControl) GetSessionNoEndpoints(oc *v1alpha1.OnecloudCluster) (*mcclient.ClientSession, error)
- func (w *OnecloudControl) NewWaiter(oc *v1alpha1.OnecloudCluster) onecloud.Waiter
- type OnecloudRCAdminConfig
- type PVCControlInterface
- type PhaseControl
- type Policies
- type RequeueError
- type ServiceControlInterface
Constants ¶
const ( PolicyDomainAdmin = ` # project owner, allow do any with her project resources roles: - domainadmin scope: domain policy: '*': allow ` PolicyMember = `` /* 223-byte string literal not displayed */ PolicyProjectFA = ` # project finance administrator, allow any operation in meter roles: - fa scope: project policy: meter: allow ` PolicyProjectOwner = `` /* 231-byte string literal not displayed */ PolicyProjectSA = `` /* 260-byte string literal not displayed */ PolicySysAdmin = `` /* 141-byte string literal not displayed */ PolicySysFA = `` /* 149-byte string literal not displayed */ PolicySysSA = `` /* 174-byte string literal not displayed */ )
Variables ¶
var DefaultRoles map[string]string
var (
SessionDebug bool
)
Functions ¶
func ClusterConfigMapName ¶
func ClusterConfigMapName(oc *v1alpha1.OnecloudCluster) string
ClusterConfigMapName returns the default OnecloudClusterConfig ConfigMap name
func ClustercertSecretName ¶
func ClustercertSecretName(oc *v1alpha1.OnecloudCluster) string
ClusterCertSecretName returns the default cluster certs name
func ComponentConfigMapName ¶
func ComponentConfigMapName(oc *v1alpha1.OnecloudCluster, component v1alpha1.ComponentType) string
ComponentConfigMapName returns the default ConfigMap name of the specified component type
func GetAuthURL ¶
func GetAuthURL(oc *v1alpha1.OnecloudCluster) string
func GetOwnerRef ¶
func GetOwnerRef(oc *v1alpha1.OnecloudCluster) metav1.OwnerReference
GetOwnerRef returns OnecloudCluster's OwnerReference
func GetServiceType ¶
func GetServiceType(services []v1alpha1.Service, serviceName string) corev1.ServiceType
GetServiceType returns component's service type
func IsRequeueError ¶
IsRequeueError returns whether err is a RequeueError
func KeystoneComponentName ¶
KeystoneComponentName return keystone component name
func NewCACertAndKey ¶
NewCACertAndKey will generate a self signed CA.
func NewClusterComponentName ¶
func NewClusterComponentName(clusterName string, componentName v1alpha1.ComponentType) string
func NewOnecloudClientSession ¶
func NewOnecloudClientSession(oc *v1alpha1.OnecloudCluster) (*mcclient.ClientSession, error)
func NewOnecloudClientToken ¶
func NewOnecloudClientToken(oc *v1alpha1.OnecloudCluster) (*mcclient.Client, mcclient.TokenCredential, error)
func NewOnecloudSessionByToken ¶
func NewOnecloudSessionByToken(cli *mcclient.Client, region string, token mcclient.TokenCredential) (*mcclient.ClientSession, error)
func NewOnecloudSimpleClientSession ¶
func NewOnecloudSimpleClientSession(oc *v1alpha1.OnecloudCluster) (*mcclient.ClientSession, error)
func PoliciesPublic ¶
func PoliciesPublic(s *mcclient.ClientSession, types []string) error
func PolicyCreate ¶
func PolicyCreate(s *mcclient.ClientSession, policyType string, content string, enable bool) (jsonutils.JSONObject, error)
func RequeueErrorf ¶
RequeueErrorf returns a RequeueError
func RolesPublic ¶
func RolesPublic(s *mcclient.ClientSession, roles []string) error
Types ¶
type ClusterControlInterface ¶
type ClusterControlInterface interface {
UpdateCluster(cluster *v1alpha1.OnecloudCluster, newStatus *v1alpha1.OnecloudClusterStatus, oldStatus *v1alpha1.OnecloudClusterStatus) (*v1alpha1.OnecloudCluster, error)
}
ClusterControlInterface manages Onecloud clusters
func NewClusterControl ¶
func NewClusterControl( cli versioned.Interface, ocLister listers.OnecloudClusterLister, recorder record.EventRecorder) ClusterControlInterface
NewClusterControl creates a new ClsuterControlInterface
type ComponentManager ¶
type ComponentManager interface { GetSession() (*mcclient.ClientSession, error) GetSessionNoEndpoints() (*mcclient.ClientSession, error) GetController() *OnecloudControl GetCluster() *v1alpha1.OnecloudCluster Keystone() PhaseControl Region() PhaseControl Glance() PhaseControl YunionAgent() PhaseControl Devtool() PhaseControl }
type ConfigMapControlInterface ¶
type ConfigMapControlInterface interface { CreateConfigMap(*v1alpha1.OnecloudCluster, *corev1.ConfigMap) error UpdateConfigMap(*v1alpha1.OnecloudCluster, *corev1.ConfigMap) (*corev1.ConfigMap, error) DeleteConfigMap(*v1alpha1.OnecloudCluster, *corev1.ConfigMap) error }
func NewConfigMapControl ¶
func NewConfigMapControl(kubeCli kubernetes.Interface, cfgLister corelisters.ConfigMapLister, recorder record.EventRecorder) ConfigMapControlInterface
type CronJobControlInterface ¶
type CronJobControlInterface interface { CreateCronJob(*v1alpha1.OnecloudCluster, *batchv1.CronJob) error UpdateCronJob(*v1alpha1.OnecloudCluster, *batchv1.CronJob) (*batchv1.CronJob, error) DeleteCronJob(*v1alpha1.OnecloudCluster, *batchv1.CronJob) error }
func NewCronJobControl ¶
func NewCronJobControl( kubeCli kubernetes.Interface, cronJobLister v1beta1.CronJobLister, recorder record.EventRecorder, ) CronJobControlInterface
type DaemonSetControlInterface ¶
type DaemonSetControlInterface interface { CreateDaemonSet(*v1alpha1.OnecloudCluster, *apps.DaemonSet) error UpdateDaemonSet(*v1alpha1.OnecloudCluster, *apps.DaemonSet) (*apps.DaemonSet, error) DeleteDaemonSet(*v1alpha1.OnecloudCluster, *apps.DaemonSet) error }
func NewDaemonSetControl ¶
func NewDaemonSetControl( kubeCli kubernetes.Interface, daemonSetLister appslisters.DaemonSetLister, recorder record.EventRecorder, ) DaemonSetControlInterface
type DeploymentControlInterface ¶
type DeploymentControlInterface interface { // CreateDeployment creates deployment in a OnecloudCluster. CreateDeployment(*v1alpha1.OnecloudCluster, *apps.Deployment) error // UpdateDeployment updates a deployment in a OnecloudCluster. UpdateDeployment(*v1alpha1.OnecloudCluster, *apps.Deployment) (*apps.Deployment, error) // DeleteDeployment deletes a deployment in a OnecloudCluster. DeleteDeployment(*v1alpha1.OnecloudCluster, *apps.Deployment) error }
DeploymentControlInterface defines the interface that uses to create, update, and delete Deployment
func NewDeploymentControl ¶
func NewDeploymentControl(kubeCli kubernetes.Interface, deployLister appslisters.DeploymentLister, recorder record.EventRecorder) DeploymentControlInterface
NewDeploymentControl returns a DeploymentControlInterface
type IngressControlInterface ¶
type IngressControlInterface interface { CreateIngress(*v1alpha1.OnecloudCluster, *extensions.Ingress) error UpdateIngress(*v1alpha1.OnecloudCluster, *extensions.Ingress) (*extensions.Ingress, error) DeleteIngress(*v1alpha1.OnecloudCluster, *extensions.Ingress) error }
IngressControlInterface defines the interface that uses to create, update and delete Ingress
func NewIngressControl ¶
func NewIngressControl(kubeCli kubernetes.Interface, ingressLister listers.IngressLister, recorder record.EventRecorder) IngressControlInterface
type OnecloudCert ¶
type OnecloudCert struct { Name string LongName string BaseName string CAName string // contains filtered or unexported fields }
func NewClusterCACert ¶
func NewClusterCACert() *OnecloudCert
func NewServiceCert ¶
func NewServiceCert(caName string, serviceName string, certName string) *OnecloudCert
func (*OnecloudCert) CreateAsCA ¶
func (k *OnecloudCert) CreateAsCA(oc *v1alpha1.OnecloudCluster) (*x509.Certificate, crypto.Signer, error)
func (*OnecloudCert) CreateFromCA ¶
func (k *OnecloudCert) CreateFromCA(oc *v1alpha1.OnecloudCluster, caCert *x509.Certificate, caKey crypto.Signer) (*x509.Certificate, crypto.Signer, error)
CreateFromCA makes and writes a certificate using the given CA cert and key.
func (*OnecloudCert) GetConfig ¶
func (k *OnecloudCert) GetConfig(oc *v1alpha1.OnecloudCluster) (*certutil.Config, error)
type OnecloudCertControlInterface ¶
type OnecloudCertControlInterface interface { // CreateCert CreateCert(oc *v1alpha1.OnecloudCluster) error }
func NewOnecloudCertControl ¶
func NewOnecloudCertControl(kubeCli kubernetes.Interface, secretLister corelisters.SecretLister, recorder record.EventRecorder) OnecloudCertControlInterface
type OnecloudControl ¶
type OnecloudControl struct {
// contains filtered or unexported fields
}
func NewOnecloudControl ¶
func NewOnecloudControl(kubeCli clientset.Interface) *OnecloudControl
func (*OnecloudControl) Components ¶
func (w *OnecloudControl) Components(oc *v1alpha1.OnecloudCluster) ComponentManager
func (*OnecloudControl) GetSession ¶
func (w *OnecloudControl) GetSession(oc *v1alpha1.OnecloudCluster) (*mcclient.ClientSession, error)
func (*OnecloudControl) GetSessionNoEndpoints ¶
func (w *OnecloudControl) GetSessionNoEndpoints(oc *v1alpha1.OnecloudCluster) (*mcclient.ClientSession, error)
func (*OnecloudControl) NewWaiter ¶
func (w *OnecloudControl) NewWaiter(oc *v1alpha1.OnecloudCluster) onecloud.Waiter
type OnecloudRCAdminConfig ¶
type OnecloudRCAdminConfig struct { AuthURL string Region string Username string Password string DomainName string ProjectName string ProjectDomain string Insecure bool Debug bool Timeout int CertFile string KeyFile string }
func NewOnecloudRCAdminConfig ¶
func NewOnecloudRCAdminConfig(oc *v1alpha1.OnecloudCluster, debug bool) *OnecloudRCAdminConfig
type PVCControlInterface ¶
type PVCControlInterface interface { CreatePVC(*v1alpha1.OnecloudCluster, *corev1.PersistentVolumeClaim) error UpdatePVC(*v1alpha1.OnecloudCluster, *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error) DeletePVC(*v1alpha1.OnecloudCluster, *corev1.PersistentVolumeClaim) error }
func NewPVCControl ¶
func NewPVCControl(kubeCli kubernetes.Interface, pvcLister corelisters.PersistentVolumeClaimLister, recorder record.EventRecorder) PVCControlInterface
type PhaseControl ¶
func NewRegisterEndpointComponent ¶
func NewRegisterEndpointComponent( man ComponentManager, ctype v1alpha1.ComponentType, serviceName string, serviceType string, port int, prefix string, ) PhaseControl
func NewRegisterServiceComponent ¶
func NewRegisterServiceComponent( man ComponentManager, serviceName string, serviceType string, ) PhaseControl
type RequeueError ¶
type RequeueError struct {
// contains filtered or unexported fields
}
RequeueError is used to requeue the item, this error type should't be considered as a real error
func (*RequeueError) Error ¶
func (re *RequeueError) Error() string
type ServiceControlInterface ¶
type ServiceControlInterface interface { CreateService(*v1alpha1.OnecloudCluster, *corev1.Service) error UpdateService(*v1alpha1.OnecloudCluster, *corev1.Service) (*corev1.Service, error) DeleteService(*v1alpha1.OnecloudCluster, *corev1.Service) error }
ServiceControlInterface manages Services used in OnecloudCluster
func NewServiceControl ¶
func NewServiceControl(kubeCli kubernetes.Interface, svcLister corelisters.ServiceLister, recorder record.EventRecorder) ServiceControlInterface
NewServiceControl creates a new ServiceControlInterface