component

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: Apache-2.0 Imports: 54 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NotifySocketFileDir   = "/etc/yunion/socket"
	NotifyTemplateDir     = "/etc/yunion/template"
	NotifyPluginDingtalk  = "dingtalk"
	NotifyPluginConfig    = "plugin-config"
	NotifyPluginEmail     = "email"
	NotifyPluginSmsAliyun = "smsaliyun"
	NotifyPluginWebsocket = "websocket"
)
View Source
const (
	// LastAppliedConfigAnnotation is annotation key of last applied configuration
	LastAppliedConfigAnnotation = "onecloud.yunion.io/last-applied-configuration"
	// ImagePullBackOff is the pod state of image pull failed
	ImagePullBackOff = "ImagePullBackOff"
	// ErrImagePull is the pod state of image pull failed
	ErrImagePull = "ErrImagePull"
)
View Source
const (
	CEConfig = `` /* 216-byte string literal not displayed */

	EEConfig = `` /* 352-byte string literal not displayed */

	WebNginxConfigTemplate = `` /* 5025-byte string literal not displayed */

)
View Source
const (
	InfluxDBConfigTemplate = `` /* 759-byte string literal not displayed */

)
View Source
const (
	KapacitorConfigTemplate = `` /* 715-byte string literal not displayed */

)

documentation: check https://hub.docker.com/_/kapacitor

View Source
const (
	RegionDNSConfigTemplate = `` /* 443-byte string literal not displayed */

)

Variables

View Source
var (
	GetEdition          = v1alpha1.GetEdition
	IsEnterpriseEdition = v1alpha1.IsEnterpriseEdition
)

Functions

func CombineAnnotations

func CombineAnnotations(a, b map[string]string) map[string]string

CombineAnnotations merges two annotations maps

func CompileTemplateFromMap

func CompileTemplateFromMap(tmplt string, configMap interface{}) (string, error)

func CreateOrUpdateConfigMap

func CreateOrUpdateConfigMap(client clientset.Interface, cm *corev1.ConfigMap) error

func EnsureClusterDBUser

func EnsureClusterDBUser(oc *v1alpha1.OnecloudCluster, dbConfig v1alpha1.DBConfig) error

func EnsureDBUser

func EnsureDBUser(conn *mysql.Connection, dbName string, username string, password string) error

func EnsureServiceAccount

func EnsureServiceAccount(s *mcclient.ClientSession, account v1alpha1.CloudUser) error

func GetConfigVolumeMount

func GetConfigVolumeMount(volMounts []corev1.VolumeMount) *corev1.VolumeMount

func GetDBConnectionByCluster

func GetDBConnectionByCluster(oc *v1alpha1.OnecloudCluster) (*mysql.Connection, error)

func GetRCAdminEnv

func GetRCAdminEnv(oc *v1alpha1.OnecloudCluster) []corev1.EnvVar

func NewServiceNodePort

func NewServiceNodePort(name string, port int32) corev1.ServicePort

func SetConfigMapLastAppliedConfigAnnotation

func SetConfigMapLastAppliedConfigAnnotation(cfg *corev1.ConfigMap) error

func SetCronJobLastAppliedConfigAnnotation

func SetCronJobLastAppliedConfigAnnotation(cronJob *batchv1.CronJob) error

func SetDBOptions

func SetDBOptions(opt *options.DBOptions, mysql v1alpha1.Mysql, input v1alpha1.DBConfig)

func SetDaemonSetLastAppliedConfigAnnotation

func SetDaemonSetLastAppliedConfigAnnotation(ds *apps.DaemonSet) error

func SetDeploymentLastAppliedConfigAnnotation

func SetDeploymentLastAppliedConfigAnnotation(deploy *apps.Deployment) error

func SetIngressLastAppliedConfigAnnotation

func SetIngressLastAppliedConfigAnnotation(ing *extensions.Ingress) error

func SetOptionsDefault

func SetOptionsDefault(opt interface{}, serviceType string) error

func SetOptionsServiceTLS

func SetOptionsServiceTLS(config *options.BaseOptions)

func SetServiceBaseOptions

func SetServiceBaseOptions(opt *options.BaseOptions, region string, input v1alpha1.ServiceBaseConfig)

func SetServiceLastAppliedConfigAnnotation

func SetServiceLastAppliedConfigAnnotation(svc *corev1.Service) error

SetServiceLastAppliedConfigAnnotation set last applied config info to Service's annotation

Types

type ComponentManager

type ComponentManager struct {
	// contains filtered or unexported fields
}

func (*ComponentManager) APIGateway

func (m *ComponentManager) APIGateway() manager.Manager

func (*ComponentManager) AnsibleServer

func (m *ComponentManager) AnsibleServer() manager.Manager

func (*ComponentManager) AutoUpdate

func (m *ComponentManager) AutoUpdate() manager.Manager

func (*ComponentManager) Baremetal

func (m *ComponentManager) Baremetal() manager.Manager

func (*ComponentManager) Climc

func (m *ComponentManager) Climc() manager.Manager

func (*ComponentManager) Cloudevent

func (m *ComponentManager) Cloudevent() manager.Manager

func (*ComponentManager) CloudmonPing

func (m *ComponentManager) CloudmonPing() manager.Manager

func (*ComponentManager) CloudmonReportUsage

func (m *ComponentManager) CloudmonReportUsage() manager.Manager

func (*ComponentManager) Cloudnet

func (m *ComponentManager) Cloudnet() manager.Manager

func (*ComponentManager) Devtool

func (m *ComponentManager) Devtool() manager.Manager

func (*ComponentManager) EsxiAgent

func (m *ComponentManager) EsxiAgent() manager.Manager

func (*ComponentManager) Glance

func (m *ComponentManager) Glance() manager.Manager

func (*ComponentManager) Host

func (m *ComponentManager) Host() manager.Manager

func (*ComponentManager) HostDeployer

func (m *ComponentManager) HostDeployer() manager.Manager

func (*ComponentManager) Influxdb

func (m *ComponentManager) Influxdb() manager.Manager

func (*ComponentManager) Kapacitor

func (m *ComponentManager) Kapacitor() manager.Manager

func (*ComponentManager) Keystone

func (m *ComponentManager) Keystone() manager.Manager

func (*ComponentManager) KubeServer

func (m *ComponentManager) KubeServer() manager.Manager

func (*ComponentManager) Logger

func (m *ComponentManager) Logger() manager.Manager

func (*ComponentManager) Meter

func (m *ComponentManager) Meter() manager.Manager

func (*ComponentManager) Notify

func (m *ComponentManager) Notify() manager.Manager

func (*ComponentManager) Region

func (m *ComponentManager) Region() manager.Manager

func (*ComponentManager) S3gateway

func (m *ComponentManager) S3gateway() manager.Manager

func (*ComponentManager) Scheduler

func (m *ComponentManager) Scheduler() manager.Manager

func (*ComponentManager) Web

func (m *ComponentManager) Web() manager.Manager

func (*ComponentManager) Webconsole

func (m *ComponentManager) Webconsole() manager.Manager

func (*ComponentManager) Yunionagent

func (m *ComponentManager) Yunionagent() manager.Manager

func (*ComponentManager) Yunionconf

func (m *ComponentManager) Yunionconf() manager.Manager

type Configer

type Configer interface {
	GetClusterConfig(cluster *v1alpha1.OnecloudCluster) (*v1alpha1.OnecloudClusterConfig, error)
	CreateOrUpdateConfigMap(cluster *v1alpha1.OnecloudCluster, newCfgMap *corev1.ConfigMap) error
	Lister() corelisters.ConfigMapLister
}

Configer implements the logic to get cluster config.

type InfluxdbConfig

type InfluxdbConfig struct {
	Port     int
	CertPath string
	KeyPath  string
}

func (InfluxdbConfig) GetContent

func (c InfluxdbConfig) GetContent() (string, error)

type KapacitorConfig

type KapacitorConfig struct {
	Port        int
	CertPath    string
	KeyPath     string
	InfluxdbURL string
}

func (KapacitorConfig) GetContent

func (c KapacitorConfig) GetContent() (string, error)

type NotifyPluginBaseConfig

type NotifyPluginBaseConfig struct {
	SockFileDir string `default:"/etc/yunion/socket"`
	SenderNum   int    `default:"5"`
	TemplateDir string `default:"/etc/yunion/template"`
	LogLevel    string `default:"info"`
}

type NotifyPluginEmailConfig

type NotifyPluginEmailConfig struct {
	NotifyPluginBaseConfig
	ChannelSize int `default:"100"`
}

type NotifyPluginWebsocketConfig

type NotifyPluginWebsocketConfig struct {
	NotifyPluginBaseConfig
	Region string
}

type PVCVolumePair

type PVCVolumePair struct {
	// contains filtered or unexported fields
}

func NewPVCVolumePair

func NewPVCVolumePair(name, mountPath string, oc *v1alpha1.OnecloudCluster, comp v1alpha1.ComponentType) *PVCVolumePair

func (PVCVolumePair) GetVolume

func (p PVCVolumePair) GetVolume() corev1.Volume

func (PVCVolumePair) GetVolumeMount

func (p PVCVolumePair) GetVolumeMount() corev1.VolumeMount

type VolumeHelper

type VolumeHelper struct {
	// contains filtered or unexported fields
}

func NewHostVolume

func NewHostVolume(
	cType v1alpha1.ComponentType,
	oc *v1alpha1.OnecloudCluster,
	configMap string,
) *VolumeHelper

func NewVolumeHelper

func NewVolumeHelper(oc *v1alpha1.OnecloudCluster, optCfgMap string, component v1alpha1.ComponentType) *VolumeHelper

func (*VolumeHelper) GetVolumeMounts

func (h *VolumeHelper) GetVolumeMounts() []corev1.VolumeMount

func (*VolumeHelper) GetVolumes

func (h *VolumeHelper) GetVolumes() []corev1.Volume

type WebNginxConfig

type WebNginxConfig struct {
	EditionConfig   string
	WebconsoleURL   string
	APIGatewayWsURL string
	APIGatewayURL   string
}

func (WebNginxConfig) GetContent

func (c WebNginxConfig) GetContent() (string, error)

Jump to

Keyboard shortcuts

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