Documentation ¶
Index ¶
- Constants
- func DetermineServiceManagerRegion(skrRegion *string, log logrus.FieldLogger) string
- func EncryptOverrides(secretKey string, overrides *OverrideParams) (string, error)
- func FindCredentials(config *ServiceManagerConfig, region string) (*servicemanager.Credentials, error)
- func GetExtraConfTemplate() (*template.Template, error)
- func IsKymaVersionAtLeast_1_20(runTimeVersion string) (bool, error)
- func IsKymaVersionAtLeast_1_21(runTimeVersion string) (bool, error)
- func NewProvisioner(storage ProvisionerStorage, creator InstanceCreator) *provisioner
- func NewStatusChecker(storage ProvisionerStorage) *checker
- func RenderOverrides(data interface{}, tmp *template.Template) (string, error)
- type BindingRequest
- type Client
- func (c *Client) CreateBinding(smClient servicemanager.Client, request *BindingRequest) (*OverrideParams, error)
- func (c *Client) CreateInstance(smClient servicemanager.Client, instance servicemanager.InstanceKey) error
- func (c *Client) RemoveInstance(smClient servicemanager.Client, instance servicemanager.InstanceKey) error
- type Config
- type DeprovisionRequest
- type DeprovisionResult
- type Deprovisioner
- type DeprovisionerStorage
- type InstanceCreator
- type InstanceRemover
- type OverrideParams
- type ProvisionRequest
- type ProvisionResult
- type ProvisionStatus
- type ProvisionerStorage
- type SAMLConfig
- type SAMLIdpConfig
- type SAMLSpConfig
- type ServiceManagerConfig
- type ServiceManagerCredentials
Constants ¶
const ( RegionEurope = "eu" RegionUS = "us" )
Supported SAP Cloud Platform regions, where a CLS instance can be provisioned
Variables ¶
This section is empty.
Functions ¶
func DetermineServiceManagerRegion ¶
func DetermineServiceManagerRegion(skrRegion *string, log logrus.FieldLogger) string
DetermineServiceManagerRegion maps a hyperscaler-specific region (currently, Azure only) to a region where a CLS instance is to be provisioned. Returns eu as a fallback regions.
func EncryptOverrides ¶
func EncryptOverrides(secretKey string, overrides *OverrideParams) (string, error)
func FindCredentials ¶
func FindCredentials(config *ServiceManagerConfig, region string) (*servicemanager.Credentials, error)
FindCredentials searches for Service Manager credentials for a given region
func GetExtraConfTemplate ¶
func NewProvisioner ¶
func NewProvisioner(storage ProvisionerStorage, creator InstanceCreator) *provisioner
func NewStatusChecker ¶
func NewStatusChecker(storage ProvisionerStorage) *checker
Types ¶
type BindingRequest ¶
type BindingRequest struct { InstanceKey servicemanager.InstanceKey BindingID string }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps a generic servicemanager.Client an performs CLS specific calls
func (*Client) CreateBinding ¶
func (c *Client) CreateBinding(smClient servicemanager.Client, request *BindingRequest) (*OverrideParams, error)
func (*Client) CreateInstance ¶
func (c *Client) CreateInstance(smClient servicemanager.Client, instance servicemanager.InstanceKey) error
CreateInstance sends a request to Service Manager to create a CLS Instance
func (*Client) RemoveInstance ¶
func (c *Client) RemoveInstance(smClient servicemanager.Client, instance servicemanager.InstanceKey) error
RemoveInstance sends a request to Service Manager to remove a CLS Instance
type Config ¶
type Config struct { //Log retention period specified in days RetentionPeriod int `yaml:"retentionPeriod"` //Number of Elasticsearch data nodes to be provisioned MaxDataInstances int `yaml:"maxDataInstances"` //Number of FluentD instances to be provisioned MaxIngestInstances int `yaml:"maxIngestInstances"` SAML *SAMLConfig `yaml:"saml"` ServiceManager *ServiceManagerConfig `yaml:"serviceManager"` }
Config is the top-level CLS provisioning configuration
type DeprovisionRequest ¶
type DeprovisionRequest struct { SKRInstanceID string Instance servicemanager.InstanceKey }
type DeprovisionResult ¶
type DeprovisionResult struct {
IsLastReference bool
}
type Deprovisioner ¶
type Deprovisioner struct {
// contains filtered or unexported fields
}
func NewDeprovisioner ¶
func NewDeprovisioner(storage DeprovisionerStorage, remover InstanceRemover) *Deprovisioner
func (*Deprovisioner) Deprovision ¶
func (d *Deprovisioner) Deprovision(smClient servicemanager.Client, request *DeprovisionRequest, log logrus.FieldLogger) (*DeprovisionResult, error)
type DeprovisionerStorage ¶
type DeprovisionerStorage interface { FindByID(clsInstanceID string) (*internal.CLSInstance, bool, error) Update(instance internal.CLSInstance) error Delete(clsInstanceID string) error }
type InstanceCreator ¶
type InstanceCreator interface {
CreateInstance(smClient servicemanager.Client, instance servicemanager.InstanceKey) error
}
type InstanceRemover ¶
type InstanceRemover interface {
RemoveInstance(smClient servicemanager.Client, instance servicemanager.InstanceKey) error
}
type OverrideParams ¶
type OverrideParams struct { FluentdEndPoint string `json:"Fluentd-endpoint"` FluentdPassword string `json:"Fluentd-password"` FluentdUsername string `json:"Fluentd-username"` KibanaURL string `json:"Kibana-endpoint"` }
func DecryptOverrides ¶
func DecryptOverrides(secretKey string, encryptedOverrides string) (*OverrideParams, error)
type ProvisionRequest ¶
type ProvisionRequest struct { GlobalAccountID string Region string SKRInstanceID string Instance servicemanager.InstanceKey }
type ProvisionResult ¶
type ProvisionStatus ¶
type ProvisionStatus string
const ( InProgress ProvisionStatus = "in progress" Succeeded ProvisionStatus = "succeeded" Retry ProvisionStatus = "retry" Failed ProvisionStatus = "failed" )
type ProvisionerStorage ¶
type ProvisionerStorage interface { FindActiveByGlobalAccountID(globalAccountID string) (*internal.CLSInstance, bool, error) Insert(instance internal.CLSInstance) error Update(instance internal.CLSInstance) error Delete(clsInstanceID string) error }
type SAMLConfig ¶
type SAMLConfig struct { //New admin backend role that maps to any of your SAML group. It will have the right to modify the security module AdminGroup string `yaml:"admin_group"` //Set to true to use IdP-initiated SSO Initiated bool `yaml:"initiated"` //The key to sign tokens ExchangeKey string `yaml:"exchange_key"` //The list of backend_roles will be read from this attribute RolesKey string `yaml:"roles_key"` Idp *SAMLIdpConfig `yaml:"idp"` Sp *SAMLSpConfig `yaml:"sp"` }
SAMLConfig to be used by Kibana
type SAMLIdpConfig ¶
type SAMLIdpConfig struct { //URL to get the SAML metadata MetadataURL string `yaml:"metadata_url"` //SAML entity id EntityID string `yaml:"entity_id"` }
SAMLIdpConfig contains SAML identity provider configuration
type SAMLSpConfig ¶
type SAMLSpConfig struct { //Entity ID of the service provider EntityID string `yaml:"entity_id"` //The private key used to sign the requests (base64 encoded) SignaturePrivateKey string `yaml:"signature_private_key"` }
SAMLSpConfig contains SAML service provider configuration
type ServiceManagerConfig ¶
type ServiceManagerConfig struct {
Credentials []*ServiceManagerCredentials `yaml:"credentials"`
}
ServiceManagerConfig contains service manager credentials per region
type ServiceManagerCredentials ¶
type ServiceManagerCredentials struct { Region string `yaml:"region"` URL string `yaml:"url"` Username string `yaml:"username"` Password string `yaml:"password"` }
ServiceManagerCredentials contains basic auth credentials for a ServiceManager tenant in a particular region