Skip to content

Commit

Permalink
fix(pg) add postgress kb annotation and comments (#559)
Browse files Browse the repository at this point in the history
add postgress kb annotation and comments

fixed #552

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
  • Loading branch information
Ghostbaby committed Apr 24, 2021
1 parent 4828038 commit 9606f48
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
19 changes: 13 additions & 6 deletions apis/goharbor.io/v1alpha3/harborcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,19 @@ type Database struct {
type PostgresSQLSpec struct {
harbormetav1.ImageSpec `json:",inline"`

Storage string `json:"storage,omitempty"`
Replicas int `json:"replicas,omitempty"`
StorageClassName string `json:"storageClassName,omitempty"`
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
SslConfig string `json:"sslConfig,omitempty"`
ConnectTimeout int `json:"connectTimeout,omitempty"`
// Storage defines database data store pvc size
// +kubebuilder:validation:Optional
Storage string `json:"storage,omitempty"`
// Replicas defines database instance replicas
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Minimum:=1
Replicas int `json:"replicas,omitempty"`
// StorageClassName defines use which StorageClass to create pvc
// +kubebuilder:validation:Optional
StorageClassName string `json:"storageClassName,omitempty"`
// Resources defines database pod resource config
// +kubebuilder:validation:Optional
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

type Storage struct {
Expand Down
10 changes: 5 additions & 5 deletions manifests/cluster/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2967,8 +2967,6 @@ spec:
type: string
postgresSqlSpec:
properties:
connectTimeout:
type: integer
image:
description: Image name for the component.
type: string
Expand All @@ -2989,9 +2987,11 @@ spec:
type: object
type: array
replicas:
description: Replicas defines database instance replicas
minimum: 1
type: integer
resources:
description: ResourceRequirements describes the compute resource requirements.
description: Resources defines database pod resource config
properties:
limits:
additionalProperties:
Expand All @@ -3012,11 +3012,11 @@ spec:
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
type: object
type: object
sslConfig:
type: string
storage:
description: Storage defines database data store pvc size
type: string
storageClassName:
description: StorageClassName defines use which StorageClass to create pvc
type: string
type: object
required:
Expand Down
10 changes: 5 additions & 5 deletions manifests/harbor/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2967,8 +2967,6 @@ spec:
type: string
postgresSqlSpec:
properties:
connectTimeout:
type: integer
image:
description: Image name for the component.
type: string
Expand All @@ -2989,9 +2987,11 @@ spec:
type: object
type: array
replicas:
description: Replicas defines database instance replicas
minimum: 1
type: integer
resources:
description: ResourceRequirements describes the compute resource requirements.
description: Resources defines database pod resource config
properties:
limits:
additionalProperties:
Expand All @@ -3012,11 +3012,11 @@ spec:
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
type: object
type: object
sslConfig:
type: string
storage:
description: Storage defines database data store pvc size
type: string
storageClassName:
description: StorageClassName defines use which StorageClass to create pvc
type: string
type: object
required:
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/controllers/database/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (p *PostgreSQLController) GetPostgreResource(harborcluster *goharborv1.Harb
return resources
}

// GetRedisServerReplica returns postgres replicas.
// GetPostgreReplica returns postgres replicas.
func (p *PostgreSQLController) GetPostgreReplica(harborcluster *goharborv1.HarborCluster) int32 {
if harborcluster.Spec.InClusterDatabase.PostgresSQLSpec == nil {
return DefaultDatabaseReplica
Expand Down

0 comments on commit 9606f48

Please sign in to comment.