Skip to content

Commit

Permalink
Sync values from kyma and management-plane-config (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcobebway authored Sep 11, 2023
1 parent 225ce74 commit b5cbfbb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions api/v1alpha1/nats_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type NATS struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:default:={jetStream:{fileStorage:{storageClassName:"default", size:"1Gi"},memStorage:{size:"20Mi",enabled:false}}, cluster:{size:3},logging:{trace:false,debug:false}, resources:{limits:{cpu:"20m",memory:"64Mi"}, requests:{cpu:"5m",memory:"16Mi"}}}
// +kubebuilder:default:={jetStream:{fileStorage:{storageClassName:"default", size:"1Gi"},memStorage:{size:"1Gi",enabled:true}}, cluster:{size:3},logging:{trace:false,debug:false}, resources:{limits:{cpu:"500m",memory:"1Gi"}, requests:{cpu:"40m",memory:"64Mi"}}}
Spec NATSSpec `json:"spec,omitempty"`
Status NATSStatus `json:"status,omitempty"`
}
Expand All @@ -99,7 +99,7 @@ type NATSSpec struct {
Cluster `json:"cluster,omitempty"`

// JetStream defines configurations that are specific to NATS JetStream.
// +kubebuilder:default:={fileStorage:{storageClassName:"default", size:"1Gi"},memStorage:{size:"20Mi",enabled:false}}
// +kubebuilder:default:={fileStorage:{storageClassName:"default", size:"1Gi"},memStorage:{size:"1Gi",enabled:true}}
// +kubebuilder:validation:XValidation:rule="self.fileStorage == oldSelf.fileStorage",message="fileStorage is immutable once it was set"
JetStream `json:"jetStream,omitempty"`

Expand All @@ -108,7 +108,7 @@ type NATSSpec struct {
Logging `json:"logging,omitempty"`

// Resources defines resources for NATS.
// +kubebuilder:default:={limits:{cpu:"20m",memory:"64Mi"}, requests:{cpu:"5m",memory:"16Mi"}}
// +kubebuilder:default:={limits:{cpu:"500m",memory:"1Gi"}, requests:{cpu:"40m",memory:"64Mi"}}
Resources corev1.ResourceRequirements `json:"resources,omitempty"`

// Annotations allows to add annotations to NATS.
Expand All @@ -130,7 +130,7 @@ type Cluster struct {
// JetStream defines configurations that are specific to NATS JetStream.
type JetStream struct {
// MemStorage defines configurations to memory storage in NATS JetStream.
// +kubebuilder:default:={size:"20Mi",enabled:false}
// +kubebuilder:default:={size:"1Gi",enabled:true}
// +kubebuilder:validation:XValidation:rule="!self.enabled || self.size != 0", message="can only be enabled if size is not 0"
MemStorage `json:"memStorage,omitempty"`

Expand All @@ -143,11 +143,11 @@ type JetStream struct {
// MemStorage defines configurations to memory storage in NATS JetStream.
type MemStorage struct {
// Enabled allows the enablement of memory storage.
// +kubebuilder:default:=false
// +kubebuilder:default:=true
Enabled bool `json:"enabled,omitempty"`

// Size defines the mem.
// +kubebuilder:default:="20Mi"
// +kubebuilder:default:="1Gi"
Size resource.Quantity `json:"size,omitempty"`
}

Expand Down
12 changes: 6 additions & 6 deletions config/samples/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ spec:
size: "1Gi"
storageClassName: "default"
memStorage:
enabled: false
size: "20Mi"
enabled: true
size: "1Gi"
logging:
debug: false
trace: false
resources:
limits:
cpu: 20m
memory: 64Mi
cpu: 500m
memory: 1Gi
requests:
cpu: 5m
memory: 16Mi
cpu: 40m
memory: 64Mi
16 changes: 8 additions & 8 deletions pkg/manager/overrides_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,18 @@ func Test_Overrides_Keys(t *testing.T) {
keysToTest := map[string]interface{}{
IstioEnabledKey: true,
RotatePasswordKey: true,
ClusterSizeKey: float64(1),
ClusterEnabledKey: false,
DebugEnabledKey: true,
TraceEnabledKey: true,
ClusterSizeKey: float64(3),
ClusterEnabledKey: true,
DebugEnabledKey: false,
TraceEnabledKey: false,
FileStorageSizeKey: "1Gi",
FileStorageClassKey: "",
MemStorageEnabledKey: true,
MemStorageSizeKey: "1Gi",
ResourceRequestsCPUKey: "5m",
ResourceRequestsMemKey: "16Mi",
ResourceLimitsCPUKey: "20m",
ResourceLimitsMemKey: "64Mi",
ResourceRequestsCPUKey: "40m",
ResourceRequestsMemKey: "64Mi",
ResourceLimitsCPUKey: "500m",
ResourceLimitsMemKey: "1Gi",
CommonLabelsKey: map[string]interface{}{},
CommonAnnotationsKey: map[string]interface{}{},
}
Expand Down
22 changes: 11 additions & 11 deletions resources/nats/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ global:
images:
nats:
name: nats
version: v20230418-2.9.16-alpine3.17
version: v20230620-2.9.18-alpine3.18
directory: prod/external
nats_config_reloader:
name: natsio/nats-server-config-reloader
version: 0.10.1
version: 0.12.0
directory: prod/external
prometheus_nats_exporter:
name: natsio/prometheus-nats-exporter
version: 0.11.0
version: 0.12.0
directory: prod/external

jetstream:
Expand Down Expand Up @@ -158,11 +158,11 @@ nats:

resources:
limits:
cpu: 20m
memory: 64Mi
cpu: 500m
memory: 1Gi
requests:
cpu: 5m
memory: 16Mi
cpu: 40m
memory: 64Mi

# Server settings.
limits:
Expand Down Expand Up @@ -190,8 +190,8 @@ nats:
terminationGracePeriodSeconds: 150

logging:
debug: true
trace: true
debug: false
trace: false
logtime:
connectErrorReports:
reconnectErrorReports:
Expand Down Expand Up @@ -301,9 +301,9 @@ serviceAnnotations:
prometheus.io/port: "7777"

cluster:
enabled: false
enabled: true
name: eventing-nats
replicas: 1
replicas: 3
noAdvertise: false

appProtocol:
Expand Down

0 comments on commit b5cbfbb

Please sign in to comment.