Documentation
¶
Index ¶
- Constants
- func GetEnvVar(name string) (string, error)
- func GetSetupStateConfigMap(client kubernetes.Interface, namespace string) (*corev1.ConfigMap, error)
- type Config
- type CustomKeyValue
- type DoguRegistrySecret
- type Dogus
- type Naming
- type SetupConfiguration
- type SetupContext
- type SetupContextBuilder
- type User
- type UserBackend
Constants ¶
const ( SecretDoguRegistry = "k8s-dogu-operator-dogu-registry" SecretDoguRegistryDevPath = "k8s/dev-resources/dogu-registry-secret.yaml" SecretDockerRegistry = "k8s-dogu-operator-docker-registry" SetupConfigConfigmap = "k8s-ces-setup-config" SetupConfigConfigmapDevPath = "k8s/dev-resources/k8s-ces-setup.yaml" SetupStartUpConfigMap = "k8s-ces-setup-json" SetupStartUpConfigMapDevPath = "k8s/dev-resources/setup.json" SetupStateConfigMap = "k8s-setup-config" SetupStateKey = "state" SetupStateInstalled = "installed" SetupStateInstalling = "installing" EnvironmentVariableStage = "STAGE" StageDevelopment = "development" EnvironmentVariableTargetNamespace = "POD_NAMESPACE" )
Variables ¶
This section is empty.
Functions ¶
func GetEnvVar ¶ added in v0.5.0
GetEnvVar returns an arbitrary environment variable; otherwise it returns an error
func GetSetupStateConfigMap ¶ added in v0.5.0
func GetSetupStateConfigMap(client kubernetes.Interface, namespace string) (*corev1.ConfigMap, error)
GetSetupStateConfigMap returns or creates if it does not exist the configmap map for presenting the state of the setup process
Types ¶
type Config ¶
type Config struct { // LogLevel sets the log level for the app LogLevel logrus.Level `yaml:"log_level"` // TargetNamespace represents the namespace that is created for the ecosystem TargetNamespace string `yaml:"target_namespace"` // DoguOperatorResourceURL sets the K8s resource URL which controls the installation of the operator into the current cluster. DoguOperatorURL string `yaml:"dogu_operator_url"` // ServiceDiscoveryURL sets the K8s resource URL which controls the installation of the service discovery into the current cluster. ServiceDiscoveryURL string `yaml:"service_discovery_url"` // EtcdServerResourceURL sets the K8s resource URL which controls the installation of the etcd server into the current cluster. EtcdServerResourceURL string `yaml:"etcd_server_url"` // EtcdServerResourceURL sets the K8s resource URL which controls the installation of the etcd server into the current cluster. EtcdClientImageRepo string `yaml:"etcd_client_image_repo"` // KeyProvider sets the key provider used to encrypt etcd values KeyProvider string `yaml:"key_provider"` }
Config contains the common configuration for the setup
func ReadConfigFromCluster ¶ added in v0.5.0
func ReadConfigFromCluster(client kubernetes.Interface, namespace string) (*Config, error)
ReadConfigFromCluster reads the setup config from the cluster state
func ReadConfigFromFile ¶ added in v0.5.0
ReadConfigFromFile reads the application configuration from a configuration file.
type CustomKeyValue ¶ added in v0.4.0
CustomKeyValue is a map of string -> map pairs.
type DoguRegistrySecret ¶ added in v0.8.0
type DoguRegistrySecret struct { Endpoint string `yaml:"endpoint"` Username string `yaml:"username"` Password string `yaml:"password"` URLSchema string `yaml:"urlschema"` }
DoguRegistrySecret defines the credentials and the endpoint for the dogu registry.
func ReadDoguRegistrySecretFromCluster ¶ added in v0.8.0
func ReadDoguRegistrySecretFromCluster(client kubernetes.Interface, namespace string) (*DoguRegistrySecret, error)
ReadDoguRegistrySecretFromCluster reads the dogu registry credentials from the kubernetes secret.
func ReadDoguRegistrySecretFromFile ¶ added in v0.8.0
func ReadDoguRegistrySecretFromFile(path string) (*DoguRegistrySecret, error)
ReadDoguRegistrySecretFromFile reads the dogu registry credentials from a yaml file.
type Dogus ¶ added in v0.4.0
type Dogus struct { DefaultDogu string `json:"defaultDogu"` Install []string `json:"install"` Completed bool `json:"completed"` }
Dogus struct defines which dogus are installed and which one is the default.
type Naming ¶ added in v0.4.0
type Naming struct { Fqdn string `json:"fqdn"` Domain string `json:"domain"` CertificateType string `json:"certificateType"` Certificate string `json:"certificate"` CertificateKey string `json:"certificateKey"` RelayHost string `json:"relayHost"` MailAddress string `json:"mailAddress"` Completed bool `json:"completed"` UseInternalIp bool `json:"useInternalIp"` //todo look at this InternalIp string `json:"internalIp"` }
Naming settings such as fqdn, hostname and domain.
type SetupConfiguration ¶ added in v0.4.0
type SetupConfiguration struct { Naming Naming `json:"naming"` Dogus Dogus `json:"dogus"` Admin User `json:"admin"` UserBackend UserBackend `json:"userBackend"` RegistryConfig CustomKeyValue `json:"registryConfig"` RegistryConfigEncrypted CustomKeyValue `json:"registryConfigEncrypted"` }
SetupConfiguration is the main struct for the configuration of the setup.
func ReadSetupConfigFromCluster ¶ added in v0.5.0
func ReadSetupConfigFromCluster(client kubernetes.Interface, namespace string) (*SetupConfiguration, error)
ReadSetupConfigFromCluster reads the setup configuration from the configmap
func ReadSetupConfigFromFile ¶ added in v0.5.0
func ReadSetupConfigFromFile(path string) (*SetupConfiguration, error)
ReadSetupConfigFromFile reads the setup configuration from a setup json file.
func (*SetupConfiguration) IsCompleted ¶ added in v0.4.0
func (conf *SetupConfiguration) IsCompleted() bool
IsCompleted checks if a SetupConfiguration is completed.
type SetupContext ¶
type SetupContext struct { AppVersion string `yaml:"app_version"` AppConfig *Config `yaml:"app_config"` StartupConfiguration *SetupConfiguration `json:"startup_configuration"` DoguRegistryConfiguration *DoguRegistrySecret }
SetupContext contains all context information provided by the setup.
type SetupContextBuilder ¶ added in v0.5.0
type SetupContextBuilder struct { DevSetupConfigPath string DevStartupConfigPath string DevDoguRegistrySecretPath string // contains filtered or unexported fields }
SetupContextBuilder contains information to create a setup context
func NewSetupContextBuilder ¶ added in v0.5.0
func NewSetupContextBuilder(version string) *SetupContextBuilder
NewSetupContextBuilder creates a new builder to create a setup context. Default dev resources paths are used.
func (*SetupContextBuilder) NewSetupContext ¶ added in v0.5.0
func (scb *SetupContextBuilder) NewSetupContext(clientSet kubernetes.Interface) (*SetupContext, error)
NewSetupContext creates a new setup context.
type User ¶ added in v0.4.0
type User struct { Username string `json:"username"` Mail string `json:"mail"` Password string `json:"password"` AdminGroup string `json:"adminGroup"` Completed bool `json:"completed"` AdminMember bool `json:"adminMember"` SendWelcomeMail bool `json:"sendWelcomeMail"` }
User account for a ces instance.
type UserBackend ¶ added in v0.4.0
type UserBackend struct { DsType string `json:"dsType"` Server string `json:"server"` AttributeID string `json:"attributeID"` AttributeGivenName string `json:"attributeGivenName"` AttributeSurname string `json:"attributeSurname"` AttributeFullname string `json:"attributeFullname"` AttributeMail string `json:"attributeMail"` AttributeGroup string `json:"attributeGroup"` BaseDN string `json:"baseDN"` SearchFilter string `json:"searchFilter"` ConnectionDN string `json:"connectionDN"` Password string `json:"password"` Host string `json:"host"` Port string `json:"port"` LoginID string `json:"loginID"` LoginPassword string `json:"loginPassword"` Encryption string `json:"encryption"` Completed bool `json:"completed"` GroupBaseDN string `json:"groupBaseDN"` GroupSearchFilter string `json:"groupSearchFilter"` GroupAttributeName string `json:"groupAttributeName"` GroupAttributeDescription string `json:"groupAttributeDescription"` GroupAttributeMember string `json:"groupAttributeMember"` }
UserBackend contains configuration for the directory service.