github.com/codeready-toolchain/api@v0.0.0-20240507023248-73662d6db2c5/api/v1alpha1/memberoperatorconfig_types.go (about) 1 package v1alpha1 2 3 import ( 4 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 ) 6 7 // MemberOperatorConfigSpec contains all configuration parameters of the member operator 8 // +k8s:openapi-gen=true 9 type MemberOperatorConfigSpec struct { 10 // Keeps parameters concerned with authentication 11 // +optional 12 Auth AuthConfig `json:"auth,omitempty"` 13 14 // Keeps parameters concerned with the autoscaler 15 // +optional 16 Autoscaler AutoscalerConfig `json:"autoscaler,omitempty"` 17 18 // Keeps parameters concerned with Che/CRW 19 // +optional 20 Che CheConfig `json:"che,omitempty"` 21 22 // Keeps parameters concerned with the console 23 // +optional 24 Console ConsoleConfig `json:"console,omitempty"` 25 26 // Environment specifies the member-operator environment such as prod, stage, unit-tests, e2e-tests, dev, etc 27 // +optional 28 Environment *string `json:"environment,omitempty"` 29 30 // Defines the flag that determines whether User and Identity resources should be created for a UserAccount 31 // +optional 32 SkipUserCreation *bool `json:"skipUserCreation,omitempty"` 33 34 // Keeps parameters concerned with member status 35 // +optional 36 MemberStatus MemberStatusConfig `json:"memberStatus,omitempty"` 37 38 // Keeps parameters concerned with the toolchaincluster 39 // +optional 40 ToolchainCluster ToolchainClusterConfig `json:"toolchainCluster,omitempty"` 41 42 // Keeps parameters concerned with the webhook 43 // +optional 44 Webhook WebhookConfig `json:"webhook,omitempty"` 45 46 // WebConsolePlugin is used to configure the Web Console Plugin parameters 47 // +optional 48 WebConsolePlugin WebConsolePlugin `json:"webConsolePlugin,omitempty"` 49 } 50 51 // Defines all parameters concerned with the autoscaler 52 // +k8s:openapi-gen=true 53 type AuthConfig struct { 54 // Represents the configured identity provider 55 // +optional 56 Idp *string `json:"idp,omitempty"` 57 } 58 59 // Defines all parameters concerned with the autoscaler 60 // +k8s:openapi-gen=true 61 type AutoscalerConfig struct { 62 // Defines the flag that determines whether to deploy the autoscaler buffer 63 // +optional 64 Deploy *bool `json:"deploy,omitempty"` 65 66 // Represents how much memory should be required by the autoscaler buffer 67 // +optional 68 BufferMemory *string `json:"bufferMemory,omitempty"` 69 70 // Represents the number of autoscaler buffer replicas to request 71 // +optional 72 BufferReplicas *int `json:"bufferReplicas,omitempty"` 73 } 74 75 // Defines all parameters concerned with Che 76 // +k8s:openapi-gen=true 77 type CheConfig struct { 78 // Defines the Che/CRW Keycloak route name 79 // +optional 80 KeycloakRouteName *string `json:"keycloakRouteName,omitempty"` 81 82 // Defines the Che/CRW route name 83 // +optional 84 RouteName *string `json:"routeName,omitempty"` 85 86 // Defines the Che/CRW operator namespace 87 // +optional 88 Namespace *string `json:"namespace,omitempty"` 89 90 // Defines a flag that indicates whether the Che/CRW operator is required to be installed on the cluster. May be used in monitoring. 91 // +optional 92 Required *bool `json:"required,omitempty"` 93 94 // Defines a flag to turn the Che user deletion logic on/off 95 // +optional 96 UserDeletionEnabled *bool `json:"userDeletionEnabled,omitempty"` 97 98 // Defines all secrets related to Che configuration 99 // +optional 100 Secret CheSecret `json:"secret,omitempty"` 101 } 102 103 // Defines all secrets related to Che configuration 104 // +k8s:openapi-gen=true 105 type CheSecret struct { 106 // The reference to the secret that is expected to contain the keys below 107 // +optional 108 ToolchainSecret `json:",inline"` 109 110 // The key for the Che admin username in the secret values map 111 // +optional 112 CheAdminUsernameKey *string `json:"cheAdminUsernameKey,omitempty"` 113 114 // The key for the Che admin password in the secret values map 115 // +optional 116 CheAdminPasswordKey *string `json:"cheAdminPasswordKey,omitempty"` 117 } 118 119 // Defines all parameters concerned with the console 120 // +k8s:openapi-gen=true 121 type ConsoleConfig struct { 122 // Defines the console route namespace 123 // +optional 124 Namespace *string `json:"namespace,omitempty"` 125 126 // Defines the console route name 127 // +optional 128 RouteName *string `json:"routeName,omitempty"` 129 } 130 131 // GitHubSecret defines all secrets related to GitHub authentication/integration 132 // +k8s:openapi-gen=true 133 type GitHubSecret struct { 134 // The reference to the secret that is expected to contain the keys below 135 // +optional 136 ToolchainSecret `json:",inline"` 137 138 // The key for the GitHub Access token in the secret values map 139 // +optional 140 AccessTokenKey *string `json:"accessTokenKey,omitempty"` 141 } 142 143 // Defines all parameters concerned with the toolchaincluster resource 144 // +k8s:openapi-gen=true 145 type ToolchainClusterConfig struct { 146 // Defines the period in between health checks 147 // +optional 148 HealthCheckPeriod *string `json:"healthCheckPeriod,omitempty"` 149 150 // Defines the timeout for each health check 151 // +optional 152 HealthCheckTimeout *string `json:"healthCheckTimeout,omitempty"` 153 } 154 155 // Defines all parameters concerned with the Webhook 156 // +k8s:openapi-gen=true 157 type WebhookConfig struct { 158 // Defines the flag that determines whether to deploy the Webhook 159 // +optional 160 Deploy *bool `json:"deploy,omitempty"` 161 162 // Defines all secrets related to webhook configuration 163 // +optional 164 Secret *WebhookSecret `json:"secret,omitempty"` 165 } 166 167 // WebhookSecret defines all secrets related to webhook configuration 168 // +k8s:openapi-gen=true 169 type WebhookSecret struct { 170 // The reference to the secret that is expected to contain the keys below 171 // +optional 172 ToolchainSecret `json:",inline"` 173 174 // The key in the secret values map that contains a comma-separated list of SSH keys 175 // +optional 176 VirtualMachineAccessKey *string `json:"virtualMachineAccessKey,omitempty"` 177 } 178 179 // WebConsolePlugin defines the configuration parameters relating to the Web Console Plugin 180 type WebConsolePlugin struct { 181 // Deploy determines whether the plugin will be deployed or not 182 Deploy *bool `json:"deploy,omitempty"` 183 184 // PendoKey is the key value used to interact with the Pendo API 185 // +optional 186 PendoKey *string `json:"pendoKey,omitempty"` 187 188 // PendoHost allows a host URL to be configured instead of communicating directly with the Pendo domain 189 // +optional 190 PendoHost *string `json:"pendoHost,omitempty"` 191 } 192 193 // Defines all parameters concerned with member status 194 // +k8s:openapi-gen=true 195 type MemberStatusConfig struct { 196 // Defines the period between refreshes of the member status 197 // +optional 198 RefreshPeriod *string `json:"refreshPeriod,omitempty"` 199 200 // Defines all secrets related to GitHub authentication/integration 201 // +optional 202 GitHubSecret GitHubSecret `json:"gitHubSecret,omitempty"` 203 } 204 205 // MemberOperatorConfigStatus defines the observed state of MemberOperatorConfig 206 // +k8s:openapi-gen=true 207 type MemberOperatorConfigStatus struct { 208 } 209 210 //+kubebuilder:object:root=true 211 //+kubebuilder:subresource:status 212 213 // MemberOperatorConfig keeps all configuration parameters needed in member operator 214 // +kubebuilder:subresource:status 215 // +kubebuilder:resource:path=memberoperatorconfigs,scope=Namespaced 216 // +kubebuilder:validation:XPreserveUnknownFields 217 // +operator-sdk:gen-csv:customresourcedefinitions.displayName="Member Operator Config" 218 type MemberOperatorConfig struct { 219 metav1.TypeMeta `json:",inline"` 220 metav1.ObjectMeta `json:"metadata,omitempty"` 221 222 Spec MemberOperatorConfigSpec `json:"spec,omitempty"` 223 Status MemberOperatorConfigStatus `json:"status,omitempty"` 224 } 225 226 //+kubebuilder:object:root=true 227 228 // MemberOperatorConfigList contains a list of MemberOperatorConfig 229 type MemberOperatorConfigList struct { 230 metav1.TypeMeta `json:",inline"` 231 metav1.ListMeta `json:"metadata,omitempty"` 232 Items []MemberOperatorConfig `json:"items"` 233 } 234 235 func init() { 236 SchemeBuilder.Register(&MemberOperatorConfig{}, &MemberOperatorConfigList{}) 237 }