-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: minor fixes * doc: add comments to queue package * feat: add load balancer * feat: add datastore for metric collection * feat: partial features * feat: expose metrics * feat: deployment webhook automation * feat: http forwarding working * fix: fix load balancer bottleneck * feat: add metric persistence to a timescale-db * feat: webhook automation (#6) * feat: deployment webhook automation * fix: minor fixes * refactor: move kube api utilites to apiutils package * fix; minor adjustments Co-authored-by: DragonBanana <[email protected]> Co-authored-by: SwagMaster <[email protected]> Co-authored-by: Luca Terracciano <[email protected]>
- Loading branch information
Showing
47 changed files
with
2,920 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: metrics-database | ||
namespace: kube-system | ||
spec: | ||
strategy: | ||
type: Recreate | ||
selector: | ||
matchLabels: | ||
app: metrics-database | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: metrics-database | ||
spec: | ||
containers: | ||
- name: metrics-database | ||
image: systemautoscaler/database:dev | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 5432 | ||
env: | ||
- name: POSTGRES_USER | ||
value: "user" | ||
- name: POSTGRES_PASSWORD | ||
value: "password" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: metrics-database | ||
namespace: kube-system | ||
labels: | ||
app: metrics-database | ||
spec: | ||
ports: | ||
- port: 5432 | ||
selector: | ||
app: metrics-database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
CREATE TABLE IF NOT EXISTS metric | ||
( | ||
timestamp TIMESTAMP, | ||
source VARCHAR(50), | ||
destination VARCHAR(50), | ||
function VARCHAR(50), | ||
namespace VARCHAR(50), | ||
community VARCHAR(50), | ||
latency INTEGER, | ||
gpu BOOLEAN, | ||
PRIMARY KEY (timestamp, source, destination, function, namespace, community) | ||
); | ||
|
||
SELECT create_hypertable('metric', 'timestamp', chunk_time_interval => INTERVAL '30 seconds'); | ||
SELECT add_dimension('metric', 'community', number_partitions => 4); | ||
SELECT add_dimension('metric', 'namespace', number_partitions => 4); | ||
|
||
-- ALTER TABLE candlestick SET ( | ||
-- timescaledb.compress, | ||
-- timescaledb.compress_segmentby = 'symbol' | ||
-- ); | ||
-- | ||
-- SELECT add_compression_policy('candlestick', INTERVAL '12 month'); | ||
-- SELECT remove_compression_policy('candlestick'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM timescale/timescaledb:2.0.0-pg12 | ||
|
||
ADD 002_init.sql docker-entrypoint-initdb.d/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: openfaas.com/v1 | ||
kind: Function | ||
metadata: | ||
creationTimestamp: "2021-07-19T21:22:34Z" | ||
generation: 1 | ||
name: figlet | ||
namespace: openfaas-fn | ||
resourceVersion: "1689214" | ||
selfLink: /apis/openfaas.com/v1/namespaces/openfaas-fn/functions/figlet | ||
uid: 21b5f4f5-3315-40d6-a900-25b11bca95bb | ||
spec: | ||
image: ghcr.io/openfaas/figlet:latest | ||
labels: | ||
com.openfaas.scale.factor: "20" | ||
com.openfaas.scale.max: "100" | ||
com.openfaas.scale.min: "1" | ||
com.openfaas.scale.zero: "false" | ||
edgeautoscaler.polimi.it/scheduler: edge-autoscaler | ||
name: figlet | ||
readOnlyRootFilesystem: false | ||
requests: | ||
memory: 1M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.