Skip to content
Snippets Groups Projects
Commit 237674b6 authored by David José Araújo Ferreira's avatar David José Araújo Ferreira Committed by David José Araújo Ferreira
Browse files

CRDB and NATS cluter mode

Restore default values
parent 1cc1683a
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!226Resolve "Testing configurations for DDOS protection"
...@@ -107,7 +107,6 @@ export NATS_EXT_PORT_CLIENT=${NATS_EXT_PORT_CLIENT:-"4222"} ...@@ -107,7 +107,6 @@ export NATS_EXT_PORT_CLIENT=${NATS_EXT_PORT_CLIENT:-"4222"}
# If not already set, set the external port NATS HTTP Mgmt GUI interface will be exposed to. # If not already set, set the external port NATS HTTP Mgmt GUI interface will be exposed to.
export NATS_EXT_PORT_HTTP=${NATS_EXT_PORT_HTTP:-"8222"} export NATS_EXT_PORT_HTTP=${NATS_EXT_PORT_HTTP:-"8222"}
# TESTING
# If not already set, set NATS installation mode. Accepted values are: 'single' and 'cluster'. # If not already set, set NATS installation mode. Accepted values are: 'single' and 'cluster'.
# - If NATS_DEPLOY_MODE is "single", NATS is deployed in single node mode. It is convenient for # - If NATS_DEPLOY_MODE is "single", NATS is deployed in single node mode. It is convenient for
# development and testing purposes and should fit in a VM. IT SHOULD NOT BE USED IN PRODUCTION ENVIRONMENTS. # development and testing purposes and should fit in a VM. IT SHOULD NOT BE USED IN PRODUCTION ENVIRONMENTS.
......
...@@ -31,7 +31,6 @@ export NATS_EXT_PORT_CLIENT=${NATS_EXT_PORT_CLIENT:-"4222"} ...@@ -31,7 +31,6 @@ export NATS_EXT_PORT_CLIENT=${NATS_EXT_PORT_CLIENT:-"4222"}
# If not already set, set the external port NATS HTTP Mgmt GUI interface will be exposed to. # If not already set, set the external port NATS HTTP Mgmt GUI interface will be exposed to.
export NATS_EXT_PORT_HTTP=${NATS_EXT_PORT_HTTP:-"8222"} export NATS_EXT_PORT_HTTP=${NATS_EXT_PORT_HTTP:-"8222"}
# TESTING
# If not already set, set NATS installation mode. Accepted values are: 'single' and 'cluster'. # If not already set, set NATS installation mode. Accepted values are: 'single' and 'cluster'.
# - If NATS_DEPLOY_MODE is "single", NATS is deployed in single node mode. It is convenient for # - If NATS_DEPLOY_MODE is "single", NATS is deployed in single node mode. It is convenient for
# development and testing purposes and should fit in a VM. IT SHOULD NOT BE USED IN PRODUCTION ENVIRONMENTS. # development and testing purposes and should fit in a VM. IT SHOULD NOT BE USED IN PRODUCTION ENVIRONMENTS.
...@@ -73,7 +72,8 @@ function nats_deploy_single() { ...@@ -73,7 +72,8 @@ function nats_deploy_single() {
echo ">>> NATS is present; skipping step." echo ">>> NATS is present; skipping step."
else else
echo ">>> Deploy NATS" echo ">>> Deploy NATS"
helm3 install ${NATS_NAMESPACE} nats/nats --namespace ${NATS_NAMESPACE} --set nats.image=nats:2.9-alpine helm3 install ${NATS_NAMESPACE} nats/nats --namespace ${NATS_NAMESPACE} --set nats.image=nats:2.9-alpine --set config.cluster.enabled=true --set config.cluster.tls.enabled=true
echo ">>> Waiting NATS statefulset to be created..." echo ">>> Waiting NATS statefulset to be created..."
while ! kubectl get --namespace ${NATS_NAMESPACE} statefulset/${NATS_NAMESPACE} &> /dev/null; do while ! kubectl get --namespace ${NATS_NAMESPACE} statefulset/${NATS_NAMESPACE} &> /dev/null; do
......
...@@ -33,13 +33,11 @@ spec: ...@@ -33,13 +33,11 @@ spec:
resources: resources:
requests: requests:
# This is intentionally low to make it work on local k3d clusters. # This is intentionally low to make it work on local k3d clusters.
# TESTING cpu: 4
cpu: 1 #4 memory: 4Gi
memory: 500Mi #4Gi
limits: limits:
# TESTING cpu: 8
cpu: 1 #8 memory: 8Gi
memory: 1Gi #8Gi
tlsEnabled: true tlsEnabled: true
# You can set either a version of the db or a specific image name # You can set either a version of the db or a specific image name
# cockroachDBVersion: v22.2.8 # cockroachDBVersion: v22.2.8
...@@ -54,7 +52,6 @@ spec: ...@@ -54,7 +52,6 @@ spec:
# disabled by default. To enable please see the operator.yaml file. # disabled by default. To enable please see the operator.yaml file.
# The affinity field will accept any podSpec affinity rule. # The affinity field will accept any podSpec affinity rule.
# TESTING: Force one pod per node, if possible
topologySpreadConstraints: topologySpreadConstraints:
- maxSkew: 1 - maxSkew: 1
topologyKey: kubernetes.io/hostname topologyKey: kubernetes.io/hostname
......
...@@ -381,7 +381,6 @@ spec: ...@@ -381,7 +381,6 @@ spec:
spec: spec:
containers: containers:
- args: - args:
# TESTING
- -feature-gates=TolerationRules=true,AffinityRules=true,TopologySpreadRules=true - -feature-gates=TolerationRules=true,AffinityRules=true,TopologySpreadRules=true
- -zap-log-level - -zap-log-level
- info - info
......
...@@ -9,11 +9,11 @@ container: ...@@ -9,11 +9,11 @@ container:
# recommended limit is at least 2 CPU cores and 8Gi Memory for production JetStream clusters # recommended limit is at least 2 CPU cores and 8Gi Memory for production JetStream clusters
resources: resources:
requests: requests:
cpu: 1 # 2 cpu: 1
memory: 500Mi # 4Gi memory: 500Mi
limits: limits:
cpu: 1 # 4 cpu: 1
memory: 1Gi # 8Gi memory: 1Gi
config: config:
cluster: cluster:
......
...@@ -117,7 +117,6 @@ spec: ...@@ -117,7 +117,6 @@ spec:
- name: grafana - name: grafana
port: 3000 port: 3000
targetPort: 3000 targetPort: 3000
# TESTING
--- ---
apiVersion: autoscaling/v2 apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler kind: HorizontalPodAutoscaler
......
...@@ -108,7 +108,7 @@ export CRDB_DATABASE="tfs" ...@@ -108,7 +108,7 @@ export CRDB_DATABASE="tfs"
# Set CockroachDB installation mode to 'single'. This option is convenient for development and testing. # Set CockroachDB installation mode to 'single'. This option is convenient for development and testing.
# See ./deploy/all.sh or ./deploy/crdb.sh for additional details # See ./deploy/all.sh or ./deploy/crdb.sh for additional details
export CRDB_DEPLOY_MODE="cluster" export CRDB_DEPLOY_MODE="single"
# Disable flag for dropping database, if it exists. # Disable flag for dropping database, if it exists.
export CRDB_DROP_DATABASE_IF_EXISTS="" export CRDB_DROP_DATABASE_IF_EXISTS=""
...@@ -128,7 +128,6 @@ export NATS_EXT_PORT_CLIENT="4222" ...@@ -128,7 +128,6 @@ export NATS_EXT_PORT_CLIENT="4222"
# Set the external port NATS HTTP Mgmt GUI interface will be exposed to. # Set the external port NATS HTTP Mgmt GUI interface will be exposed to.
export NATS_EXT_PORT_HTTP="8222" export NATS_EXT_PORT_HTTP="8222"
# TESTING
# Set NATS installation mode to 'single'. This option is convenient for development and testing. # Set NATS installation mode to 'single'. This option is convenient for development and testing.
# See ./deploy/all.sh or ./deploy/nats.sh for additional details # See ./deploy/all.sh or ./deploy/nats.sh for additional details
export NATS_DEPLOY_MODE="single" export NATS_DEPLOY_MODE="single"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment