add missing fields to OperatorConfiguration CRD validation
This commit is contained in:
		
							parent
							
								
									97e0d6d388
								
							
						
					
					
						commit
						f9fc55cfe0
					
				|  | @ -121,6 +121,8 @@ spec: | |||
|                   type: array | ||||
|                   items: | ||||
|                     type: string | ||||
|                 master_pod_move_timeout: | ||||
|                   type: string | ||||
|                 node_readiness_label: | ||||
|                   type: object | ||||
|                   additionalProperties: | ||||
|  | @ -138,10 +140,16 @@ spec: | |||
|                   enum: | ||||
|                     - "ordered_ready" | ||||
|                     - "parallel" | ||||
|                 pod_priority_class_name: | ||||
|                   type: string | ||||
|                 pod_role_label: | ||||
|                   type: string | ||||
|                 pod_service_account_definition: | ||||
|                   type: string | ||||
|                 pod_service_account_name: | ||||
|                   type: string | ||||
|                 pod_service_account_role_binding_definition: | ||||
|                   type: string | ||||
|                 pod_terminate_grace_period: | ||||
|                   type: string | ||||
|                 secret_name_template: | ||||
|  | @ -189,16 +197,16 @@ spec: | |||
|             load_balancer: | ||||
|               type: object | ||||
|               properties: | ||||
|                 custom_service_annotations: | ||||
|                   type: object | ||||
|                   additionalProperties: | ||||
|                     type: string | ||||
|                 db_hosted_zone: | ||||
|                   type: string | ||||
|                 enable_master_load_balancer: | ||||
|                   type: boolean | ||||
|                 enable_replica_load_balancer: | ||||
|                   type: boolean | ||||
|                 custom_service_annotations: | ||||
|                   type: object | ||||
|                   additionalProperties: | ||||
|                     type: string | ||||
|                 master_dns_name_format: | ||||
|                   type: string | ||||
|                 replica_dns_name_format: | ||||
|  | @ -221,21 +229,21 @@ spec: | |||
|             logical_backup: | ||||
|               type: object | ||||
|               properties: | ||||
|                 logical_backup_schedule: | ||||
|                   type: string | ||||
|                   pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$' | ||||
|                 logical_backup_docker_image: | ||||
|                   type: string | ||||
|                 logical_backup_s3_access_key_id: | ||||
|                   type: string | ||||
|                 logical_backup_s3_bucket: | ||||
|                   type: string | ||||
|                 logical_backup_s3_endpoint: | ||||
|                   type: string | ||||
|                 logical_backup_s3_sse: | ||||
|                   type: string | ||||
|                 logical_backup_s3_access_key_id: | ||||
|                   type: string | ||||
|                 logical_backup_s3_secret_access_key: | ||||
|                   type: string | ||||
|                 logical_backup_s3_sse: | ||||
|                   type: string | ||||
|                 logical_backup_schedule: | ||||
|                   type: string | ||||
|                   pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$' | ||||
|             debug: | ||||
|               type: object | ||||
|               properties: | ||||
|  |  | |||
|  | @ -6,10 +6,6 @@ metadata: | |||
| #    environment: demo | ||||
| spec: | ||||
|   dockerImage: registry.opensource.zalan.do/acid/spilo-11:1.6-p1 | ||||
|   initContainers: | ||||
|   - name: date | ||||
|     image: busybox | ||||
|     command: [ "/bin/date" ] | ||||
|   teamId: "acid" | ||||
|   volume: | ||||
|     size: 1Gi | ||||
|  | @ -25,18 +21,22 @@ spec: | |||
|   - 127.0.0.1/32 | ||||
|   databases: | ||||
|     foo: zalando | ||||
| # podAnnotations: | ||||
| #   annotation.key: value | ||||
| # Expert section | ||||
| 
 | ||||
|   enableShmVolume: true | ||||
| #  spiloFSGroup: 103 | ||||
|   postgresql: | ||||
|     version: "11" | ||||
|     parameters: | ||||
|     parameters: # Expert section | ||||
|       shared_buffers: "32MB" | ||||
|       max_connections: "10" | ||||
|       log_statement: "all" | ||||
| 
 | ||||
|   enableShmVolume: true | ||||
| #  spiloFSGroup: 103 | ||||
| #  podAnnotations: | ||||
| #    annotation.key: value | ||||
| #  podPriorityClassName: "spilo-pod-priority" | ||||
| #  tolerations: | ||||
| #  - key: postgres | ||||
| #    operator: Exists | ||||
| #    effect: NoSchedule | ||||
|   resources: | ||||
|     requests: | ||||
|       cpu: 10m | ||||
|  | @ -63,6 +63,7 @@ spec: | |||
|     loop_wait: &loop_wait 10 | ||||
|     retry_timeout: 10 | ||||
|     maximum_lag_on_failover: 33554432 | ||||
| 
 | ||||
| # restore a Postgres DB with point-in-time-recovery | ||||
| # with a non-empty timestamp, clone from an S3 bucket using the latest backup before the timestamp | ||||
| # with an empty/absent timestamp, clone from an existing alive cluster using pg_basebackup | ||||
|  | @ -75,9 +76,15 @@ spec: | |||
| # run periodic backups with k8s cron jobs | ||||
| #  enableLogicalBackup: true | ||||
| #  logicalBackupSchedule: "30 00 * * *" | ||||
|   maintenanceWindows: | ||||
|   - 01:00-06:00  #UTC | ||||
|   - Sat:00:00-04:00 | ||||
| 
 | ||||
| #  maintenanceWindows: | ||||
| #  - 01:00-06:00  #UTC | ||||
| #  - Sat:00:00-04:00 | ||||
| 
 | ||||
|   initContainers: | ||||
|   - name: date | ||||
|     image: busybox | ||||
|     command: [ "/bin/date" ] | ||||
| #  sidecars: | ||||
| #    - name: "telegraf-sidecar" | ||||
| #      image: "telegraf:latest" | ||||
|  |  | |||
|  | @ -97,6 +97,8 @@ spec: | |||
|                   type: array | ||||
|                   items: | ||||
|                     type: string | ||||
|                 master_pod_move_timeout: | ||||
|                   type: string | ||||
|                 node_readiness_label: | ||||
|                   type: object | ||||
|                   additionalProperties: | ||||
|  | @ -114,10 +116,16 @@ spec: | |||
|                   enum: | ||||
|                     - "ordered_ready" | ||||
|                     - "parallel" | ||||
|                 pod_priority_class_name: | ||||
|                   type: string | ||||
|                 pod_role_label: | ||||
|                   type: string | ||||
|                 pod_service_account_definition: | ||||
|                   type: string | ||||
|                 pod_service_account_name: | ||||
|                   type: string | ||||
|                 pod_service_account_role_binding_definition: | ||||
|                   type: string | ||||
|                 pod_terminate_grace_period: | ||||
|                   type: string | ||||
|                 secret_name_template: | ||||
|  | @ -165,16 +173,16 @@ spec: | |||
|             load_balancer: | ||||
|               type: object | ||||
|               properties: | ||||
|                 custom_service_annotations: | ||||
|                   type: object | ||||
|                   additionalProperties: | ||||
|                     type: string | ||||
|                 db_hosted_zone: | ||||
|                   type: string | ||||
|                 enable_master_load_balancer: | ||||
|                   type: boolean | ||||
|                 enable_replica_load_balancer: | ||||
|                   type: boolean | ||||
|                 custom_service_annotations: | ||||
|                   type: object | ||||
|                   additionalProperties: | ||||
|                     type: string | ||||
|                 master_dns_name_format: | ||||
|                   type: string | ||||
|                 replica_dns_name_format: | ||||
|  | @ -197,21 +205,21 @@ spec: | |||
|             logical_backup: | ||||
|               type: object | ||||
|               properties: | ||||
|                 logical_backup_schedule: | ||||
|                   type: string | ||||
|                   pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$' | ||||
|                 logical_backup_docker_image: | ||||
|                   type: string | ||||
|                 logical_backup_s3_access_key_id: | ||||
|                   type: string | ||||
|                 logical_backup_s3_bucket: | ||||
|                   type: string | ||||
|                 logical_backup_s3_endpoint: | ||||
|                   type: string | ||||
|                 logical_backup_s3_sse: | ||||
|                   type: string | ||||
|                 logical_backup_s3_access_key_id: | ||||
|                   type: string | ||||
|                 logical_backup_s3_secret_access_key: | ||||
|                   type: string | ||||
|                 logical_backup_s3_sse: | ||||
|                   type: string | ||||
|                 logical_backup_schedule: | ||||
|                   type: string | ||||
|                   pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$' | ||||
|             debug: | ||||
|               type: object | ||||
|               properties: | ||||
|  |  | |||
|  | @ -34,6 +34,7 @@ configuration: | |||
|     # inherited_labels: | ||||
|     # - application | ||||
|     # - environment | ||||
|     master_pod_move_timeout: 20m | ||||
|     # node_readiness_label: | ||||
|     #   status: ready | ||||
|     oauth_token_secret_name: postgresql-operator | ||||
|  | @ -41,8 +42,11 @@ configuration: | |||
|     pod_antiaffinity_topology_key: "kubernetes.io/hostname" | ||||
|     # pod_environment_configmap: "" | ||||
|     pod_management_policy: "ordered_ready" | ||||
|     # pod_priority_class_name: "" | ||||
|     pod_role_label: spilo-role | ||||
|     # pod_service_account_definition: "" | ||||
|     pod_service_account_name: zalando-postgres-operator | ||||
|     # pod_service_account_role_binding_definition: "" | ||||
|     pod_terminate_grace_period: 5m | ||||
|     secret_name_template: "{username}.{cluster}.credentials.{tprkind}.{tprgroup}" | ||||
|     # spilo_fsgroup: 103 | ||||
|  | @ -79,10 +83,10 @@ configuration: | |||
|     # wal_s3_bucket: "" | ||||
|   logical_backup: | ||||
|     logical_backup_docker_image: "registry.opensource.zalan.do/acid/logical-backup" | ||||
|     logical_backup_s3_access_key_id: "" | ||||
|     # logical_backup_s3_access_key_id: "" | ||||
|     logical_backup_s3_bucket: "my-bucket-url" | ||||
|     logical_backup_s3_endpoint: "" | ||||
|     logical_backup_s3_secret_access_key: "" | ||||
|     # logical_backup_s3_endpoint: "" | ||||
|     # logical_backup_s3_secret_access_key: "" | ||||
|     logical_backup_s3_sse: "AES256" | ||||
|     logical_backup_schedule: "30 00 * * *" | ||||
|   debug: | ||||
|  |  | |||
|  | @ -13,7 +13,3 @@ spec: | |||
| # Make this a standby cluster and provide the s3 bucket path of source cluster for continuous streaming. | ||||
|   standby: | ||||
|     s3_wal_path: "s3://path/to/bucket/containing/wal/of/source/cluster/" | ||||
| 
 | ||||
|   maintenanceWindows: | ||||
|   - 01:00-06:00  #UTC | ||||
|   - Sat:00:00-04:00 | ||||
|  |  | |||
|  | @ -717,6 +717,9 @@ var OperatorConfigCRDResourceValidation = apiextv1beta1.CustomResourceValidation | |||
| 									}, | ||||
| 								}, | ||||
| 							}, | ||||
| 							"master_pod_move_timeout": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"node_readiness_label": { | ||||
| 								Type: "object", | ||||
| 								AdditionalProperties: &apiextv1beta1.JSONSchemaPropsOrBool{ | ||||
|  | @ -748,12 +751,21 @@ var OperatorConfigCRDResourceValidation = apiextv1beta1.CustomResourceValidation | |||
| 									}, | ||||
| 								}, | ||||
| 							}, | ||||
| 							"pod_priority_class_name": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"pod_role_label": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"pod_service_account_definition": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"pod_service_account_name": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"pod_service_account_role_binding_definition": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"pod_terminate_grace_period": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
|  | @ -826,6 +838,14 @@ var OperatorConfigCRDResourceValidation = apiextv1beta1.CustomResourceValidation | |||
| 					"load_balancer": { | ||||
| 						Type: "object", | ||||
| 						Properties: map[string]apiextv1beta1.JSONSchemaProps{ | ||||
| 							"custom_service_annotations": { | ||||
| 								Type: "object", | ||||
| 								AdditionalProperties: &apiextv1beta1.JSONSchemaPropsOrBool{ | ||||
| 									Schema: &apiextv1beta1.JSONSchemaProps{ | ||||
| 										Type: "string", | ||||
| 									}, | ||||
| 								}, | ||||
| 							}, | ||||
| 							"db_hosted_zone": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
|  | @ -835,14 +855,6 @@ var OperatorConfigCRDResourceValidation = apiextv1beta1.CustomResourceValidation | |||
| 							"enable_replica_load_balancer": { | ||||
| 								Type: "boolean", | ||||
| 							}, | ||||
| 							"custom_service_annotations": { | ||||
| 								Type: "object", | ||||
| 								AdditionalProperties: &apiextv1beta1.JSONSchemaPropsOrBool{ | ||||
| 									Schema: &apiextv1beta1.JSONSchemaProps{ | ||||
| 										Type: "string", | ||||
| 									}, | ||||
| 								}, | ||||
| 							}, | ||||
| 							"master_dns_name_format": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
|  | @ -877,27 +889,27 @@ var OperatorConfigCRDResourceValidation = apiextv1beta1.CustomResourceValidation | |||
| 					"logical_backup": { | ||||
| 						Type: "object", | ||||
| 						Properties: map[string]apiextv1beta1.JSONSchemaProps{ | ||||
| 							"logical_backup_schedule": { | ||||
| 								Type:    "string", | ||||
| 								Pattern: "^(\\d+|\\*)(/\\d+)?(\\s+(\\d+|\\*)(/\\d+)?){4}$", | ||||
| 							}, | ||||
| 							"logical_backup_docker_image": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"logical_backup_s3_access_key_id": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"logical_backup_s3_bucket": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"logical_backup_s3_endpoint": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"logical_backup_s3_secret_access_key": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"logical_backup_s3_sse": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"logical_backup_s3_access_key_id": { | ||||
| 								Type: "string", | ||||
| 							}, | ||||
| 							"logical_backup_s3_secret_access_key": { | ||||
| 							"logical_backup_schedule": { | ||||
| 								Type:    "string", | ||||
| 								Pattern: "^(\\d+|\\*)(/\\d+)?(\\s+(\\d+|\\*)(/\\d+)?){4}$", | ||||
| 							}, | ||||
| 						}, | ||||
| 					}, | ||||
|  |  | |||
|  | @ -118,7 +118,7 @@ type OperatorDebugConfiguration struct { | |||
| 	EnableDBAccess bool `json:"enable_database_access,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // TeamsAPIConfiguration defines the configration of TeamsAPI
 | ||||
| // TeamsAPIConfiguration defines the configuration of TeamsAPI
 | ||||
| type TeamsAPIConfiguration struct { | ||||
| 	EnableTeamsAPI           bool              `json:"enable_teams_api,omitempty"` | ||||
| 	TeamsAPIUrl              string            `json:"teams_api_url,omitempty"` | ||||
|  | @ -150,6 +150,17 @@ type ScalyrConfiguration struct { | |||
| 	ScalyrMemoryLimit   string `json:"scalyr_memory_limit,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // OperatorLogicalBackupConfiguration defines configuration for logical backup
 | ||||
| type OperatorLogicalBackupConfiguration struct { | ||||
| 	Schedule          string `json:"logical_backup_schedule,omitempty"` | ||||
| 	DockerImage       string `json:"logical_backup_docker_image,omitempty"` | ||||
| 	S3Bucket          string `json:"logical_backup_s3_bucket,omitempty"` | ||||
| 	S3Endpoint        string `json:"logical_backup_s3_endpoint,omitempty"` | ||||
| 	S3AccessKeyID     string `json:"logical_backup_s3_access_key_id,omitempty"` | ||||
| 	S3SecretAccessKey string `json:"logical_backup_s3_secret_access_key,omitempty"` | ||||
| 	S3SSE             string `json:"logical_backup_s3_sse,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // OperatorConfigurationData defines the operation config
 | ||||
| type OperatorConfigurationData struct { | ||||
| 	EnableCRDValidation        *bool                              `json:"enable_crd_validation,omitempty"` | ||||
|  | @ -176,24 +187,5 @@ type OperatorConfigurationData struct { | |||
| 	LogicalBackup              OperatorLogicalBackupConfiguration `json:"logical_backup"` | ||||
| } | ||||
| 
 | ||||
| // OperatorConfigurationUsers defines configration for super user
 | ||||
| type OperatorConfigurationUsers struct { | ||||
| 	SuperUserName            string            `json:"superuser_name,omitempty"` | ||||
| 	Replication              string            `json:"replication_user_name,omitempty"` | ||||
| 	ProtectedRoles           []string          `json:"protected_roles,omitempty"` | ||||
| 	TeamAPIRoleConfiguration map[string]string `json:"team_api_role_configuration,omitempty"` | ||||
| } | ||||
| 
 | ||||
| //Duration shortens this frequently used name
 | ||||
| type Duration time.Duration | ||||
| 
 | ||||
| // OperatorLogicalBackupConfiguration defines configration for logical backup
 | ||||
| type OperatorLogicalBackupConfiguration struct { | ||||
| 	Schedule          string `json:"logical_backup_schedule,omitempty"` | ||||
| 	DockerImage       string `json:"logical_backup_docker_image,omitempty"` | ||||
| 	S3Bucket          string `json:"logical_backup_s3_bucket,omitempty"` | ||||
| 	S3Endpoint        string `json:"logical_backup_s3_endpoint,omitempty"` | ||||
| 	S3AccessKeyID     string `json:"logical_backup_s3_access_key_id,omitempty"` | ||||
| 	S3SecretAccessKey string `json:"logical_backup_s3_secret_access_key,omitempty"` | ||||
| 	S3SSE             string `json:"logical_backup_s3_sse,omitempty"` | ||||
| } | ||||
|  |  | |||
|  | @ -300,34 +300,6 @@ func (in *OperatorConfigurationList) DeepCopyObject() runtime.Object { | |||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 | ||||
| func (in *OperatorConfigurationUsers) DeepCopyInto(out *OperatorConfigurationUsers) { | ||||
| 	*out = *in | ||||
| 	if in.ProtectedRoles != nil { | ||||
| 		in, out := &in.ProtectedRoles, &out.ProtectedRoles | ||||
| 		*out = make([]string, len(*in)) | ||||
| 		copy(*out, *in) | ||||
| 	} | ||||
| 	if in.TeamAPIRoleConfiguration != nil { | ||||
| 		in, out := &in.TeamAPIRoleConfiguration, &out.TeamAPIRoleConfiguration | ||||
| 		*out = make(map[string]string, len(*in)) | ||||
| 		for key, val := range *in { | ||||
| 			(*out)[key] = val | ||||
| 		} | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigurationUsers.
 | ||||
| func (in *OperatorConfigurationUsers) DeepCopy() *OperatorConfigurationUsers { | ||||
| 	if in == nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	out := new(OperatorConfigurationUsers) | ||||
| 	in.DeepCopyInto(out) | ||||
| 	return out | ||||
| } | ||||
| 
 | ||||
| // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 | ||||
| func (in *OperatorDebugConfiguration) DeepCopyInto(out *OperatorDebugConfiguration) { | ||||
| 	*out = *in | ||||
|  |  | |||
|  | @ -69,7 +69,7 @@ type Scalyr struct { | |||
| 	ScalyrMemoryLimit   string `name:"scalyr_memory_limit" default:"1Gi"` | ||||
| } | ||||
| 
 | ||||
| // LogicalBackup defines configration for logical backup
 | ||||
| // LogicalBackup defines configuration for logical backup
 | ||||
| type LogicalBackup struct { | ||||
| 	LogicalBackupSchedule          string `name:"logical_backup_schedule" default:"30 00 * * *"` | ||||
| 	LogicalBackupDockerImage       string `name:"logical_backup_docker_image" default:"registry.opensource.zalan.do/acid/logical-backup"` | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue