--- /dev/null
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: thingsdb
+ labels:
+ app: thingsdb
+spec:
+ selector:
+ matchLabels:
+ app: thingsdb
+ serviceName: thingsdb
+ replicas: 2
+ updateStrategy:
+ type: RollingUpdate
+ podManagementPolicy: Parallel
+ template:
+ metadata:
+ labels:
+ app: thingsdb
+ spec:
+ terminationGracePeriodSeconds: 90
+ dnsConfig:
+ searches:
+ - thingsdb.default.svc.cluster.local
+ containers:
+ - name: thingsdb
+ image: thingsdb/node:gcloud-v0.9.19
+ imagePullPolicy: Always
+ args: ["--deploy"]
+ env:
+ - name: SIRIDB_HTTP_STATUS_PORT
+ value: "8080"
+ - name: SIRIDB_HTTP_API_PORT
+ value: "80"
+ - name: SIRIDB_ENABLE_SHARD_COMPRESSION
+ value: "1"
+ - name: SIRIDB_BUFFER_SYNC_INTERVAL
+ value: "500"
+ - name: SIRIDB_DEFAULT_DB_PATH
+ value: /mnt/thingsdb/
+ - name: SIRIDB_BIND_SERVER_ADDRESS
+ value: "0.0.0.0"
+ - name: SIRIDB_BIND_CLIENT_ADDRESS
+ value: "0.0.0.0"
+ - name: SIRIDB_SERVER_NAME
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.name
+ ports:
+ - name: status
+ containerPort: 8080
+ - name: client
+ containerPort: 9200
+ - name: http
+ containerPort: 9210
+ - name: node
+ containerPort: 9220
+ volumeMounts:
+ - name: data
+ mountPath: /mnt/siridb/
+ resources:
+ requests:
+ memory: 100M
+ livenessProbe:
+ httpGet:
+ path: /healthy
+ port: 8080
+ periodSeconds: 10
+ timeoutSeconds: 5
+ readinessProbe:
+ httpGet:
+ path: /ready
+ port: 8080
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ timeoutSeconds: 2
+ volumeClaimTemplates:
+ - metadata:
+ name: data
+ spec:
+ accessModes: ["ReadWriteOnce"]
+ resources:
+ requests:
+ storage: 20Gi
}
}
- if ( !strlen(address) ||
- strlen(address) >= SIRI_CFG_MAX_LEN_ADDRESS ||
- !xstr_is_int(strport) ||
- strcpy(addr, address) == NULL ||
- xstr_replace_str(
- addr,
- "%HOSTNAME",
- hostname,
- SIRI_CFG_MAX_LEN_ADDRESS))
+ if (!strlen(address) || strlen(address) >= SIRI_CFG_MAX_LEN_ADDRESS)
{
- log_critical(
- "error: got an unexpected value '%s:%s'.",
- address,
- strport);
+ log_critical("error: got an unexpected address value '%s'.", s);
return -1;
}
- test_port = atoi(strport);
-
- if (test_port < 1 || test_port > 65535)
+ if (strcpy(addr, address) == NULL || xstr_replace_str(
+ addr,
+ "%HOSTNAME",
+ hostname,
+ SIRI_CFG_MAX_LEN_ADDRESS))
{
- log_critical(
- "error: port should be between 1 and 65535, got '%d'.",
- test_port);
+ log_critical("error: memory allocation while copying address");
return -1;
}
- *addrport = (uint16_t) test_port;
+ if (xstr_is_int(strport))
+ {
+ test_port = atoi(strport);
+ if (test_port < 1 || test_port > 65535)
+ {
+ log_critical(
+ "error: port should be between 1 and 65535, got '%d'.",
+ test_port);
+ return -1;
+ }
+
+ *addrport = (uint16_t) test_port;
+ }
log_debug("Read '%s': %s:%d",
s,